Appendix E – Advanced SQL
© 2018 Pearson Education, Inc. Page 98 of 107
J. Suppose that the Queen Anne Curiosity Shop owners are considering changing the primary
key of CUSTOMER to (FirstName, LastName). Write a correlated subquery to display any
data that indicate that this change is not justifiable. Hint: If no employees meet this
condition, the correct query result will be an empty set.
SELECT C1.CustomerID, C1.FirstName, C1.LastName
FROM CUSTOMER C1
K. Write a user-defined function named FirstNameFirst that concatenates the employee’s
LastName and FirstName into a single value named FullName, and displays, in order,
the FirstName, a space, and the LastName (hint: Smith and Steve would be combined
to read Steve Smith).
For Microsoft Access: