Spring 2014: Database Final
- The weight for each question is given with the question.
- Use as much paper as you wish, but make your answers are legible.
- Please answer each question thoughtfully and carefully.
- Two points each. Answer each with respect to databases in general and MySQL when applicable.
- What is a stored procedure?
- What are the advantages of stored procedures?
- What are the costs of stored procedures?
- What is a user defined function?
- How is a user defined function different from a stored procedure?
- What is a vie?
- What why would a database program employ views?
- What is a trigger?
- Why would a trigger be employed in a database?
- What is an index?
- What is a cascading delete?
- Under what circumstances would a cascading delete be employed?
- What is a cursor?
- What is the impact of the SQL command START TRANSACTION
- A pet store has a database where an pet owner (name, address) may be associated with zero or more pets (ID number, name, species). Each pet has only one owner.
- [2 points] Represent this relation with an E-R diagram.
- [4 points] Describe the tables you would produce to implement this relationship. Include how you would enforce the cardinality requirements.
- [4 points] What should happen when
- A new pet is received in the store (for sale)
- A pet is sold.
- An owner is removed from the database.
- In the same pet store, a product (UPC, name) may be supplied by multiple companies (name, address). Some companies, however, may not supply any products, they simply provide services.
- [2 points] Represent this relation with an E-R diagram.
- [4 points] Describe the tables you would produce to implement this relationship. Include how you would enforce the cardinality requirements.
- A take home kit at this pet store may be represented as follows:
-
- [2 points] Describe this relationship in English.
- [4 points] Describe the problems this relationship represents to a database implementer.