December 06, 2009

SQL 作業

(1)查出貨運公司編號為1,2的貨運公司名稱、電話

SELECT CompanyName AS 貨運公司名稱, Phone AS 電話
FROM Shippers
WHERE ShipperID IN (1,2);


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

SELECT CustomerID AS 客戶編號
FROM Orders
WHERE ShipVia IN
(SELECT ShipperID
FROM Shippers
WHERE CompanyName IN ('United Package','Federal Shipping' ))
AND ShippedDate Between CDate('2002/11/9')And CDate('2002/11/16')
AND EmployeeID IN (1,6,9)
ORDER BY CustomerID DESC;


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

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

由 b114097076 發表於 December 6, 2009 03:44 PM
迴響
發表迴響









記住我的資訊?





請依上圖輸入檢核碼: