data tables: Data tables (or tables) are one of the most important components of a database and are the foundation of other objects. 1, first we open a database (here I opened a newly created AAA database). Open the database:Use + database name; 2. Start creating a table with the table name set to TB1. Rows are called records, and columns are called fields. Create a table for the name, age, and salaryVARCHAR has a limit of 20 characters for a character type of 20Age is an integral type UNSIGNED No negative number is required. FLOAT (8,2) is an integer eight-digit number, leaving two bits after the decimal point. 00000000.00 View (database to exist):SHOW DATABASES;
3. Next, look at the structure of the data table:SHOW COLUMNS from data table name;The picture is the structure of the data table tb1 that we just created, and all the data we set up when we created it was displayed; 4. Insert the data to see: First method:This method must have the number of columns to insert how much data, not a column must have the corresponding data. Insert a nameJack , he's 23, 2500.23. Second method: Insert a nameRose 's salary is 65000.66, and we didn't insert her age data here. So this format can be selectively inserted. 5. Finally, check the data we inserted:SELECT * from data table name;(Rose does not insert the age data, so it is null)additional small features:To view the currently open database name:SELECT DATABASE ()To view a large list of all data tables in the database:
MySQL data table creation, viewing, inserting