Database Reference
In-Depth Information
7.40 Give an example of a view that is clearly not updatable.
7.41 Summarize the general idea for determining whether a view is updatable.
7.42 If a view is missing required items, what action on the view is definitely not allowed?
7.43 Explain the paradigm mismatch between SQL and programming languages.
7.44 How is the mismatch in your answer to Review Question 7.45 corrected?
7.45 Describe the SQL/PSM component of the SQL standard. What are PL/SQL and T-SQL?
What is the MySQL equivalent?
7.46 What is a user-defined function?
Using the WPC database, create an SQL script named WPC-Create-Function-and-
View.sql to answer Review Questions 7.47 through 7.48.
7.47 Create and test a user-defined function named LastNameFirst that combines two pa-
rameters named FirstName and LastName into a concatenated name field formatted
LastName, FirstName (including the comma and space).
7.48 Create and test a view called EmployeeDepartmentDataView that contains the
employee name concatenated and formatted as LastName, FirstName in a field
named EmployeeName , EMPLOYEE.Department, DEPARTMENT.OfficeNumber,
DEPARTMENT.Phone as DepartmentPhone , and EMPLOYEE.Phone as EmployeePhone .
Run this statement to create the view, and then test the view by writing and running an
appropriate SQL SELECT statement.
7.49 What is a trigger?
7.50 What is the relationship between a trigger and a table or view?
7.51 Name nine possible trigger types.
7.52 Explain, in general terms, how new and old values are made available to a trigger.
7.53 Describe four uses for triggers.
7.54 Assume that the View Ridge Gallery will allow a row to be deleted from WORK if the
work has never been sold. Explain, in general terms, how to use a trigger to accomplish
such a deletion.
7.55 Assume that the Wedgewood Pacific Corporation will allow a row to be deleted from
EMPLOYEE if the employee has no project assignments. Explain, in general terms, how
to use a trigger to accomplish such a deletion.
7.56 What is a stored procedure? How do they differ from triggers?
7.57 Summarize how to invoke a stored procedure.
7.58 Summarize the key advantages of stored procedures.
Project Questions
These Project Questions extend the Wedgewood Pacific Corporation database you
created and used in the Review Questions with two new tables named COMPUTER
and COMPUTER_ASSIGNMENT.
The data model for these modifications is shown in Figure 7-33. The column
characteristics for the COMPUTER table are shown in Figure 7-34, and those for the
 
 
Search WWH ::




Custom Search