- INT– For storing integer values.
- CHAR– For Storing fixed-length character values.
- VARCHAR– For Storing character values with variable lengths.
- DATETIME– For Storing Date and Time Information.
- TIMESTAMPS– For Storing timestamps of various actions.
- TEXT– For storing large amounts of text data.
- ENUM– For storing one of the preset values.
- BOOLEAN– For storing a single Boolean value.
- BLOB– For storing binary files and objects.
Rows contain the actual data in your database. If you had a student table with different types of student data, you would have many rows in that table. Each row would be a student’s entry into that table. The overall schema of a table is very much like an excel sheet. You can see in the image below that there are columns such as RollNo, Name, Birth Date and they have multiple records. The MySQL data is structured exactly like this.
Firstly we will run a simple command to see how many databases do we have right now. Type in show databases; in the SQL command window. It should give you similar output.
Now we will create a database. To do that type in create database theitstuff; You can replace theitstuff with any name of your choice. And then run show tables; again.
You can see that we have created a new database and it is visible in the database listing above.
Now, to delete this database we will run drop database theitstuff;
MySQL has a lot of data types that can be used to store various types of data in databases. MySQL structures data into tables that consist of columns related to each other. Each new row in such a table is called a record or entry into the table.2 tables from a database can communicate with each other but 2 tables from 2 different databases cannot.I hope you have a basic idea of how data is structured in MySQL databases. If you have any doubt regarding this topic, do let me know in the comment section below.
Our sponsor - Deploy your server within 3 minutes