The following example is a table named "Persons":
id |
lastname |
firstname |
address |
city |
1 |
adams |
john |
oxford Street |
london |
2 |
bush |
george |
fifth Avenue |
new York |
3 |
carter |
thomas |
changan Street |
beijing |
The table above contains three records (one per person) and five columns (Id, last name, first name, address, and city).
Now let's create the data table above:
Mysql> CREATE TABLE Persons (
ID int auto_increment NOT NULL primary key,
Lastname varchar (30),
Firstname varchar (30),
Address varchar (30),
City varchar (30)
);
Okay, now the creation column is successful.
Use the command SELECT * from persons to see if it is a hint to empty set, that's right, because no specific data has been added, so far it has just created columns.
So now it's time to add the data:
Mysql> INSERT INTO persons (lastname,firstname,address,city) values ("Adams", "John", "Oxford Street", "London");
The creation of the entire table can be done by adding two additional sets of data according to the insert command above.
Insert into persons (lastname,firstname,address,city) values ("Bush", "George", "Fifth Avenue", "New York");
Insert into persons (lastname,firstname,address,city) values ("Carter", "Thomas", "Changan Street", "Beijing");
Let's summarize the creation of the table today. Tomorrow write again, recently mood is not good, change a job quite helpless. Very tangled do not know where to go to the best.
Received ZTE's offer, do not know whether or not to go.
Another two companies offer, one is to do graphics processing using OPENCV and OpenGL and other graphics libraries,
One is to do the development and use of C + + service, this is more in line with my ideal job, the specific content is: Google specification, List,unordered_map,redis,dump analysis method, STL's bind function, memory pool and thread pool
MySQL learning starting from 0: creating a Table