Mysql learning starts from 0: Table Creation
The following example shows a table named "persons:
Id |
LastName |
FirstName |
Address |
City |
1 |
Adams |
John |
Oxford Street |
London |
2 |
Bush |
George |
Th Avenue |
New York |
3 |
Carter |
Thomas |
Changan Street |
Beijing |
The table above contains three records (each corresponding to one person) and five columns (Id, last name, name, address, and city ).
Now let's create the above data table:
mysql> create table persons(id int auto_increment not null primary key,Lastname varchar(30),Firstname varchar(30),Address varchar(30),City varchar(30));
Now the topic is successfully created.
Run the select * from persons command to check whether empty set is prompted. That's right, because no specific data has been added, so far, only the topic has been created.
Now we can add the data:
Mysql> insert into persons (Lastname, Firstname, Address, City) values ("Adams", "John", "Oxford Street", "London ");
Add the other two groups of data according to the insert command above to create the entire table.
Insert into persons (Lastname, Firstname, Address, City) values ("Bush", "George", "th Avenue", "New York ");
Insert into persons (Lastname, Firstname, Address, City) values ("Carter", "Thomas", "Changan Street", "Beijing ");
Today, we will summarize the table creation. I will write it again tomorrow. I am in a bad mood recently and it is quite helpless to change my job. I am so entangled that I don't know which one to choose.
I have received an offer from ZTE, but I don't know if I want to go.
It also collects offer from two other companies. One company uses opencv, opengl, and other graphics libraries for graphic processing,
One is to develop and use the c ++ server. This is an ideal job for me. The specific content is: google specifications, list, unordered_map, redis, and dump analysis methods, STL bind function, memory pool and thread pool