當前位置:首頁 » 操作系統 » 資料庫查詢姓王

資料庫查詢姓王

發布時間: 2025-08-02 12:33:29

⑴ 請教這個sql查詢like語句怎麼寫我要查詢姓王

用以「王」字開頭做like模糊查詢就可以了。例如:
select * from students where sName like '王%';
請留意不同的資料庫所使用的通配符是不一樣的,例如access資料庫默認語法上述語句要改為如下:
select * from students where sName like '王*';

⑵ 查詢全體學生的姓名及其出生年份 (資料庫)

1: select name , age from student;

2: select major_num from student where major = '計算機專業';

3: select * from student where age >19;

4: select name , ID from stent where major = '...';

5: select name , age from student where sex = '男' or age >19

6: select name , ID , sex from student where name like '王%'

7: select name , ID , sex from student where name NOT like '王%'

8: select name , ID , sex from student where name NOT like '_佳%'

9: select name , age ,major where age like [18-25]

10: select name , age ,major where age NOT like [18-25]

11: select * from student where name = (select major from student
where name = '王濤')

12: select ID,name from student where major_id = 001

13: select ID,name from student where major_id <> 001

14: select * from student where zhuanyechengji > 80

15: select ID,score from student where major_id = 001
Order by score DESC

16: select * from student order by age DESC ,major

17:

18: select count(*) from student

19: select count(*) from student where EXISTS (select scroe from

student)

20:

21:

22:

其他幾道沒有把握....就不放出來了

⑶ 在學生表,中要查找所有年齡大於30歲姓王的男同學,應該採用的關系運算 是()。

【答案】:A

關系資料庫系統至少應當支持三種關系運算,即選擇、投影和連接。選擇是從二維表中選出符合條件的記錄,它是從行的角度對關系進行的運算。投影是從二維表中選出所需要的列,它是從列的角度對關系進行的運算。連接是同時涉及兩個二維表的運算,它是將兩個關系在給定的屬性上滿足給定條件的記錄連接起來而得到的一個新的關系。

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:585
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:881
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:574
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:761
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:677
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1005
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:250
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:108
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:799
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:705