1)查看查詢數(shù)據(jù)顯示
SELECT ?* ?FORM student;
SELECE ?sname 姓名,sscore 分數(shù) FROM student; /*只顯示姓名,分數(shù)*/
SELECT * FROM student ?WHERE ?sscore<80;/*查詢的基本條件> < ?<= ?>= ?!= <> */
SELECT * FROM student WHERE sscore!=82 ;
SELECT * ?FROM student WHERE NOT sscore=82;
SELECT * FROM ?student WHERE sscore BETWEEN 70 AND 80;/*查詢條件between and范圍,可以在數(shù)字和日期類型劃分*/
SELECT * FROM ?student ?WHERE sbirthday ?BETWEEN '1991-1-1' AND '2002-1-1';
-----基本條件like條件%
-----查詢姓名是兩個字學(xué)生信息
SELECT * FROM student WHERE sanem LIKE '__';/*_代表一個任意字符*/
SELECT * FROM student WHERE sname LIKE '%麗%'; /*%代表0個或多個任意字符*/
----基本條件in在某范圍內(nèi),not in
SELECT ?* ?FROM ?student ?WHERE sno ? IN (201437,201445,201421)
SELECT * FROM student WHERE ?sname=' ';/*查詢名字為空的學(xué)生信息*/
---基本條件null運算
SELECT * FROM student WHERE sscore ?IS NULL;
UPDATE ?student ?SET sscore=0 WHERE sscore IS NULL;/*將沒有成績的學(xué)生成績改為0分*/