Chapter 10B – Managing Databases with Oracle Database
Page 10B-167
Using the MI database, create an SQL script named MI–Create-Views-and-Functions.sql to
answer parts B through E.
Answers to parts B through E are below and in the file DBP-e14-Oracle-MI-Create-Views-and-
Functions.sql.
B. Create and test a user-defined function named LastNameFirst that combines two
parameters named FirstName and LastName into a concatenated name field formatted
LastName, FirstName (including the comma and space).
Tested in view that follows in part C.
C. Create and test a view called PurchasingAgentSummaryView that contains the
employee name of any MI employees who purchase items for the company,
concatenated and formatted as LastName, FirstName (including the comma and space)
in a field named PurchasingAgentName, ITEM.ItemDescription, ITEM.PurchaseDate,
STORE.StoreName, STORE.City, and Store.Country.
SELECT * FROM PurchasingAgentSummaryView;