December 06, 2009

SQL(I)的練習

(1)請查詢出貨運公司編號為1,2的貨運公司名稱,電話(資料表:Shippers)

SELECT CompanyName AS 貨運公司名稱, Phone AS 電話
FROM Shippers
WHERE ShipperID<=2;

(2)請查詢出訂單(資料表: Orders)的客戶編號(由大至小排序),限制條件為
已知貨運名稱為‘United Package‘,’Federal Shipping’ (資料表:Shippers)且
送貨日期範圍為‘2002/11/9’至‘2002/11/16‘ 且
處理此訂單的員工編號為1,6,9

SELECT CustomerID AS 客戶編號
FROM Orders
WHERE ShipName LIKE 'United Package' OR 'Federal Shipping'
And RequiredDate Between CDate('2002/11/9') And CDate('2002/11/16')
And EmployeeID IN (1,6,9)
ORDER BY CustomerID DESC;

(3)請查詢出產別類別(資料表: Categories)說明有’Pasta’的類別名稱

SELECT DISTINCT CategoryName AS 類別名稱
FROM Categories
WHERE Description LIKE '*pasta*';

由 b202097029 發表於 December 6, 2009 07:34 PM
迴響

Adam Sculthorpe is a marketing expert. Welcome to my google alerts monitoring test.

Posted by: Adam Sculthorpe 發表於 July 11, 2011 01:10 AM
發表迴響









記住我的資訊?





請依上圖輸入檢核碼: