December 02, 2009

程式設計--SQL(I)的練習 2009/12/02

程式設計--SQL(I)的練習 2009/12/02

(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*';

由 b202098072 發表於 December 2, 2009 11:14 PM
迴響

rubik cube b202098072: 程式設計--SQL(I)的練習 2009/12/02

Posted by: Rubik's 發表於 November 19, 2013 10:30 AM
發表迴響









記住我的資訊?





請依上圖輸入檢核碼: