1、建库建表语句
2、增删查改语句
3、表关联查询
SELECT t1.*,t2.* FROM table_name1 t1 INNER JOIN table_name2 t2 ON t1.id=t2.id;
4、子查询
例:查询StudentInfo表中所有upwd与用户zhangsan一样的用户名
SELECT * FROM StudentInfo
WHERE upwd=(
SELECT upwd FROM StudentInfo WHERE username="zhangsan"
)
AND username=(
SELECT username FROM StudentInfo
)