Driver={Microsoft Access Driver (*.mdb)};
Dbq=途径;
Uid=Admin;
Pwd=暗码;
刺进:
INSERT INTO xs(学号,名字,专业名,性别,出生日期,身高,党员否) VALUES (082212,李晓姝,机电一体化,女,1990-9-28,168,0)
也能够:
INSERT INTO xs VALUES (082212,李晓姝,机电一体化,女,1990-9-28,168,0,NULL)
删去:
DELETE FROM xs WHERE 专业名=机电一体化
删去一切行: DELETE FROM xs
修正记载:
xs表中一切学生成果加10分:UPDATE xs_kc SET 成果=成果+10
名字为李晓姝的同学专业改为“通信工程”,补白改为“转专业学习”,学号改为082141
UPDATE xs
SET 专业名=通信工程,
补白=转专业学习,
学号=082141
WHERE 名字=李晓姝
查询:
SELECT * FROM xs WHERE 专业名=通信工程
SELECT * FORM xs WHERE 身高>=170
SELECT * FORM xs WHERE 专业名=通信工程 OR 专业名=计算机网络
SELECT * FORM xsWHERE专业名=计算机网络 AND 性别=男
SELECT * FORM xsWHERE 出生日期 BETWEEN 1990-1-1 AND 1990-12-31 等价于 SELECT * FORM xsWHERE 出生日期>=1990-1-1 AND 出生日期<=1990-12-31
SELECT * FORM xsWHERE IN(计算机网络,计算机软件,通信工程) 等价于 SELECT * FORM xsWHERE 专业名=计算机网络 OR 专业名=计算机软件 OR 专业名=通信工程
SELECT * FORM xsWHERE 名字 LIKE 王%
DESC :按递减输出
ASC:按递加输出
select * from student order by age desc , id desc;用“,”号离隔多个排序条件,这样,先按age 再按id,就是说,先按age从大到小排序,如果有相同年纪的,那么相同年纪的学生再按他们的id从大到小排序。
select sno, avg(DISTINCT grade) as 均匀成果from SCgroup by snowhere avg(DISTINCT grade)>70order by avg(grade) desc