MySQL data table creation, viewing, inserting

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.