Question: Create a database eith one - to - many relationship between two entity classes. Using entities > ( Musician:performance ) Each entity class in your

Create a database eith one-to-many relationship between two entity classes. Using entities>(Musician:performance)
Each entity class in your database schema should have a single theme. Choose at least four logical and useful attributed for each entity class. Use natural language names for the table and columns, and avoid codes or abbreviations for the names and data. It is expected that the schema will include each of the major attribute types: integer, character or variable-length character, a date type, and decimal with fraction. Specify data types and lengths compatible with the data collected. Also, use case consistently for the character data loaded.
Define primary key contraints for both tables to ensure entity integrity. Define foreign key in the child table (or the many end of the relationship) to enforce referential integrity.
For the entity classes chosen collect authentic data for all known instances or a meaningful subset. At minimum one relationship between the one and the many tables should illustrate a participation constraint of "1:M"(one parent row, many children), another "1:1", and "1:0"
Invoke the following SQL commands to demonstrate and test your design:
1) query each of the tables. Project all columns with rows ordered by primary key;
2) verify entity integrity by attempting to insert a row with an invalid primary key value into the "one" table, and another into the "many" table;
3) verify referential integrity by attempting to insert a row into your "many" ("child") table with foreign key that has no corresponding parent row;
4) issue a query with subquery (nested query) to show the existance of a 1:M participation between a parent row and related child rows (i.e. list child rows related to a single row from the parent table)
5) join the "one" and "many" tables and project columns corresponding to the primary key and a single non-key column, and the foreign key from the child table with results ordered by the primary key of the "one" (major sort key) and the primary key of the "many" table (minor sort key)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!