1: A table has multiple primary keys.
Composite primary key
Create Table SC
(Studentno int, courseid int, score int, primary key (studentno, courseid ));
2: Use Chinese storage in the database
Create Database 'Article' default Character Set utf8 collate utf8_general_ci;
3: A good tutorial on SQL statements
Http://www.w3school.com.cn/ SQL/SQL _alter.asp
4. Modify Table content
Update class set c_year = "2011" where c_id = 1;
5. delete a row
Delete from test where t_id = "1 ";
6: Pretty good. MySQL functions commonly used in PHP
Http://www.php.net/manual/zh/ref.mysql.php
7. Set Foreign keys in the table
Create Table notice_ziliao (z_id varchar (20) primary key, z_date varchar (20), z_name varchar (128), z_t_id varchar (40), foreign key (z_t_id) references teacher (t_id ));
In the foreign key (z_t_id), do not add double quotation marks or quotation marks. Otherwise, a syntax error is returned.