Another way to create a table is to enter code to create it.
After the address that needs to be manipulated on the connection, select the database from which to create the query, and the following interface appears:
Enter the code here to create the table:
Create table for creating tables;
Primary key is the main key;
Not NULL is non-null;
Auto_increment for self-growth columns;
Foreign key is a foreign key;
References is a reference.
Create a data table with a foreign key:
#民族Create TableMinzu (XuhaointAuto_incrementPrimary Key, #民族序号 Minzuvarchar( -) not NULL#民族); #用户Create TableYonghu (Shunxuint Primary Key, #用户顺序 namevarchar( -) not NULL, #用户名ageint, #年龄 Minzuint, #民族Foreign Key(Minzu)ReferencesMinzu (Xuhao))
To create a data table notation:
1. Create table+ table name (column name + Type + properties of the column such as primary key, non-null, column name + type + attribute)
2. The contents of the created table are written in (), in the order of the columns;
3. Each column is written with "," separated, and the last column is not added ",";
4. After writing a statement, add ";" Separated
5. The main table should be written on the top of the table;
6. If the column type is a character or string must be appended (length) after char (character) or varchar (string);
The 7.MySQL is commented in the following way: # + Comment Content
Click to run if the following page appears, the creation succeeds and the refresh within the table is displayed.
Creating a data table with T-SQL statements