Chapter Seven – SQL For Database Construction and Application Processing
Page 7-100
J. Write an SQL statement to list the FirstName, LastName, and Phone of customers (list
each name only once) who have attended the Kitchen on a Big D Budget seminar. Sort
the results by LastName in descending order, and then by FirstName in descending
order.
/***** Case Question J ******************************************************/
SELECT DISTINCT FirstName, LastName, Phone
FROM CUSTOMER AS C JOIN SEMINAR_CUSTOMER AS SC
ON C.CustomerID = SC.CustomerID
JOIN SEMINAR AS S
ON SC.SeminarID = S.SeminarID
K. Write an SQL statement to list the FirstName, LastName, Phone, ProductNumber and
Description of customers (list each combination of name and video product only once)
who have purchased a video product. Sort the results by LastName in descending order,
then by FirstName in descending order, and then by ProductNumber in descending
order. (Hint: Video products have a ProductNumber that starts with VK.)
/***** Case Question K ******************************************************/
SELECT DISTINCT FirstName, LastName, Phone,
P.ProductNumber, P.ProductDescription
FROM CUSTOMER AS C JOIN INVOICE AS I