A. In the SQL Server Management Studio folder structure in your My Documents folder, create a folder named DBP-e12-MDC-CH10-Database in the Projects folder. Use this folder to save and store *.sql scripts containing the SQL statements that you are asked to create in the remaining questions in this section.
B. Using SQL Server 2008 R2 and the Microsoft SQL Server Management Studio, create a database named
MI-CH10.
C. Answer questions A through M for Marcia’s Dry Cleaning at the end of Chapter 7, page 306–308, if you have not already done so. If you have already answered the Chapter 7 questions, reuse your answers and apply them to the MDC-CH10 database. Use the SQL Server data types in your answer, and store your answers in *.sql scripts, as appropriate.
D. Execute all of the SQL statements that you created in your answers to A through M for Marcia’s Dry Cleaning at the end of Chapter 7.
E. Assume that the relationship between INVOICE and INVOICE_ITEM is M-M. Design triggers to enforce this relationship. Use Figure 1 and the discussion of that figure as an example, but assume that Marcia does allow INVOICEs and their related INVOICE_ITEM rows to be deleted. Use the deletion strategy shown in Figures 2 and 3 for this case.
Figure 1 Actions to Enforce Minimum Cardinality for the WORK-to- TRANS Relationship

Figure 2 Trigger Code to Delete All But Last Child

Figure 3 Trigger Code to Delete Last Child and Parent When Necessary

F. Write and test the triggers you designed in part D.
G. Create a SQL Server login named MDC-User, with a password of MDC-User+password. Create a MDC-CH10 database user named MDC-CH10-Database-User, which is linked to the MDC-User login. Assign MDC-CH10-Database-User
db_owner permissions to the MDC-CH10 database.