CS360: Lab 7


Due: See Moodle for the due date.

Goals:

·         Create an ERD from a problem statement

·         Create an initialization script that creates tables needed by the ERD

·         Create stored procedures as the interface used to manipulate data in these tables

Background:

This lab defines a database for collecting basketball statistics.

 

The database must store data for a basketball league as follows:

 

NOTE: Items not listed in the ‘background’ list above do NOT have to be accounted for.

·         The basketball example occurs at two different places in the notes, and both of them are slightly different from each other and different than what is shown in the list above.  The list above does not mention uniform, but it does mention player number, and it does mention basket.

Requirements:

1.    Save lab7.sql.  You will modify this file and submit your modified version for this lab.

 

2.    In lab7.sql, find the comment containing – ERD GOES HERE:.  Modify this comment as follows:

·         Insert your own name in place of <Your Name>

 

·         Write an ERD in Pete’s foot.  Show all entities and relationships, but not attributes.  Give each many to many relationship a name -- remember, many to many relationships produce new weak entitites -- e.g.,
Team = 0 ----  hosts / visits ---- 0 = Team  (the ‘Game’ relationship). 
Note: you can use new weak entities like ‘Game’ in other relationships.

 

·         Below this set of relationships diagrams, show the attributes for each entity shown in the relationships in the form:

EntityName:

attributeName1

attributeName2

For example:

Game:

            home

            away

            date

 

3.    Below this comment, write the SQL statements necessary to drop if exists then create the tables necessary for your ERD.

 

4.    Modify the stored procedure bodies given at the bottom of lab7.sql according to the requirements given in the comment at the top of lab7.sql.  Note: you may NOT modify the stored procedure headers.

 

 5. Submit your lab7.sql file on moodle by clicking on the Lab 7 assignment.  NOTE: You can continue to add to your assignment as long as you click the Edit Submission button, but you must click the Submit Assignment button, then the ‘my own work’ checkbox, then the Continue button to finalize your submission.

Hints: