Question
Based on the following Sql script in Music Library data base, please solve the following question. 1) Please draw Schema Design for this given (following)
Based on the following Sql script in Music Library data base, please solve the following question.
1) Please draw Schema Design for this given (following) data SQL Script Music Liabrary Start with Schema table design, generate the tables and (if needed) recursively decompose the tables into BCNF and 4NF. Identify all non-trivial MVD and FD's.
USE test; DROP TABLE IF EXISTS Customer; DROP TABLE IF EXISTS Artist; DROP TABLE IF EXISTS MusicGroup; DROP TABLE IF EXISTS ReleaseAlbum; DROP TABLE IF EXISTS Employee;
/*CRUD action (Create, Retrieve, Update, Delete)*/ /* Customer Table */ CREATE TABLE Customer ( Membership_Id int, Name varchar(255), Phone_Number int, Address varchar(255), Email varchar(255), product_rented varchar(45) product_purchesed varchar(45) );
/*Artist Table or products */ CREATE TABLE Artist ( firstName VARCHAR(30) , lastName VARCHAR(30) , dateOfBirth VARCHAR(30) , genre VARCHAR(30) , address VARCHAR(30) , city VARCHAR(20) , state VARCHAR(20) , phoneNumber BIGINT , email VARCHAR(50) , PRIMARY KEY(firstName, lastName, dateOfBirth) ); /*Create*/ /*MusicGroup Table*/ CREATE TABLE MusicGroup ( groupName VARCHAR(30) , groupGenre VARCHAR(30) , numberOfMembers INT , groupAddress VARCHAR(30) , city VARCHAR(20) , state VARCHAR(20) , phoneNumber BIGINT , email VARCHAR(50) , memberFirstName VARCHAR(30) , memberLastName VARCHAR(30) , memberDateOfBirth VARCHAR(30) , memberRole VARCHAR(30) , memberId INT , PRIMARY KEY AUTO_INCREMENT(groupName, memberId) , FOREIGN KEY(memberFirstName, memberLastName, memberDateOfBirth) REFERENCES Artist(firstName, lastName, dateOfBirth) );
/*ReleaseAlbum Table*/ CREATE TABLE ReleaseAlbum ( title VARCHAR(30) PRIMARY KEY , musicLength VARCHAR(30) , releaseYear VARCHAR(10) , playSequence VARCHAR(10) , copiesSold BIGINT , artistFirstName VARCHAR(30) , artistLastName VARCHAR(30) , groupName VARCHAR(30) , albumGenre VARCHAR(30) , FOREIGN KEY(artistFirstName, artistLastName) REFERENCES Artist(firstName, lastName) , FOREIGN KEY(groupName) REFERENCES MusicGroup(groupName) );
CREATE TABLE Employee( EmployeeId INT PRIMARY KEY, FirstName VARCHAR(50), LastName VARCHAR(50), Gender VARCHAR(1), ManagerId INT, EmailAddress VARCHAR(50));
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started