Databases Reference
In-Depth Information
EXAMPLE 14
List the number, name, and complete address of every customer located on a street that contains the letters
Oxford .
108
SELECT CustomerNum, CustomerName, Street, City, State, Zip
FROM Customer
WHERE Street LIKE '%Oxford%'
;
Access:
SELECT CustomerNum, CustomerName, Street, City, State, Zip
FROM Customer
WHERE Street LIKE '*Oxford*'
;
EXAMPLE 15
List the number, name, street, and credit limit for every customer with a credit limit of $7,500, $10,000, or
$15,000.
SELECT CustomerNum, CustomerName, Street, CreditLimit
FROM Customer
WHERE CreditLimit IN (7500, 10000, 15000)
;
EXAMPLE 16
List the number, name, street, and credit limit of all customers. Order (sort) the customers by name.
SELECT CustomerNum, CustomerName, Street, CreditLimit
FROM Customer
ORDER BY CustomerName
;
EXAMPLE 17
List the number, name, street, and credit limit of all customers. Order the customers by name within descend-
ing credit limit.
SELECT CustomerNum, CustomerName, Street, CreditLimit
FROM Customer
ORDER BY CreditLimit DESC, CustomerName
;
EXAMPLE 18
How many parts are in item class HW?
SELECT COUNT(*)
FROM Part
WHERE Class='HW'
;
 
Search WWH ::




Custom Search