關於SQLite資料庫的作業 2

來源:互聯網
上載者:User

標籤:

1查詢Student表中的所有記錄的Sname、Ssex和Class列。

SELECT sname,ssex,class from Student

2查詢教師所有的單位即不重複的Depart列。

SELECT Depart from Teachear

3查詢Student表的所有記錄。

SELECT * from Student

4查詢Score表中成績在60到80之間的所有記錄。

SELECT degree from Score where Degree>60 and Degree<80

5查詢Score表中成績為85,86或88的記錄。

SELECT Degree from Score WHERE Degree=85 OR Degree=86 or Degree=88

6查詢Student表中“95031”班或性別為“女”的同學記錄。

SELECT * FROM Student WHERE Ssex=‘女‘AND Class=‘95031‘

SELECT * FROM Student WHERE Ssex=‘女‘OR Class=‘95031‘

7以Class降序查詢Student表的所有記錄。

SELECT * FROM Student ORDER BY class DESC

8以Cno升序、Degree降序查詢Score表的所有記錄。

升序:SELECT *from Score ORDER BY degree ASC

降序:SELECT *from Score ORDER BY degree DESC

9查詢“95031”班的學生人數。

SELECT * FROM Student WHERE Class=‘95031‘

關於SQLite資料庫的作業 2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.