In: Computer Science
Database
Normalize the relations to BCNF:
Member- (MemID, dateJoined, firstName, lastName, street, city, state, zip, areaCode, phoneNumber, currentOfficeHeld)
Play- (title, author, numberOfActs, setChanges)
Sponsor- (sponID, name, street, city, state, zip, areaCode, phoneNumber)
Subscriber- (subID, firstName, lastName, street, city, state, zip, areaCode, phoneNumber)
Production- (prodyear, seasonStartDate, seasonEndDate, title)
Performance – (perfyear,perfdate, time, seasonStartDate)
TicketSale- (saleID, saleDate, totalAmount, perfyear, perfdate,subID)
DuesPayment- (MemID, duesYear, amount, datePaid)
Donation – (sponID, donationDate, donationType, donationValue, prodYear, seasonStartDate)
Ticket- (saleID, seatLocation, price, type)
Member - Production-(MemID, prodYear, seasonStartDate, role, task)
Normalization: In DBMS, normalization is the process of arranging and adjusting data so that data does not contain insert,update and delete anomalies.
Given relational tables are:
Member- (MemID, dateJoined, firstName, lastName, street, city,
state, zip, areaCode, phoneNumber, currentOfficeHeld)
Play- (title, author, numberOfActs, setChanges)
Sponsor- (sponID, name, street, city, state, zip, areaCode,
phoneNumber)
Subscriber- (subID, firstName, lastName, street, city, state, zip,
areaCode, phoneNumber)
Production- (prodyear, seasonStartDate, seasonEndDate, title)
Performance – (perfyear,perfdate, time, seasonStartDate)
TicketSale- (saleID, saleDate, totalAmount, perfyear,
perfdate,subID)
DuesPayment- (MemID, duesYear, amount, datePaid)
Donation – (sponID, donationDate, donationType, donationValue,
prodYear, seasonStartDate)
Ticket- (saleID, seatLocation, price, type)
Member_Production-(MemID, prodYear, seasonStartDate, role,
task)
First normal
form:
Second normal form:
Let us convert tables into 2NF:
Member- (MemID, dateJoined, firstName, lastName, street,
city, state, zip, areaCode, phoneNumber,
currentOfficeHeld)
Here, {dateJoined, firstName, lastName,phoneNumber, currentOfficeHeld} is only dependent of MemID not on ZIP. {MemID} is a subset of candidate key {MemID, ZIP}. As per 2NF each non_prime attribute should not dependent on subset of candidate key,they should depend on complete composite key.
Now let us devide the table as per 2NF:
Member(MemID,dateJoined,
firstName, lastName,phoneNumber,
currentOfficeHeld,Zip)
Address(Zip,street,
city, state, areaCode)
Here Zip in Member table acts as foreign key.
Play- (title, author,
numberOfActs, setChanges):
In Play table, non_prime attribute {author, numberOfActs, setChanges} dependent on {title} which is a complete candidate key.So that this table satosfies 2NF.
Sponsor- (sponID, name, street, city, state, zip, areaCode, phoneNumber):
Here, {Name, phoneNumber} is only dependent of SponID not on ZIP. {SponID} is a subset of candidate key {SponID, ZIP}. As per 2NF each non_prime attribute should not dependent on subset of candidate key,they should depend on complete composite key.
Sponsor(sponID,Name,
phoneNumber,Zip)
Address(Zip,street,
city, state, areaCode) Which is already exists. So we simply relate
these tables.
Subscriber- (subID, firstName, lastName, street, city, state, zip, areaCode, phoneNumber):
Here, {firstName, lastName, phoneNumber} is only dependent of SunID not on ZIP. {SubID} is a subset of candidate key {SubID, ZIP}. As per 2NF each non_prime attribute should not dependent on subset of candidate key,they should depend on complete composite key.
Now let us devide the table as per 2NF:
Subscriber(SubID,firstName,
lastName,phoneNumber,Zip)
Address(Zip,street,
city, state, areaCode)
Here Zip in Member table acts as foreign key.
Production- (prodyear,
seasonStartDate, seasonEndDate, title):
In production table, non_prime attribute{seasonStartDate, seasonEndDate,title} dependent on {ProdYear} which is a complete candidate key.So that this table satisfies 2NF.
Performance – (perfyear,perfdate, time, seasonStartDate):
In performance table, non_prime attribute{perfdate, time, seasonStartDate} dependent on {PerfYear} which is a complete candidate key.So that this table satisfies 2NF.
TicketSale- (saleID, saleDate, totalAmount, perfyear, perfdate,subID):
In TicketSale table, non_prime attribute{totalAmount, perfyear, perfdate,subID} dependent on {SaleID} which is a complete candidate key.So that this table satisfies 2NF.
DuesPayment- (MemID,
duesYear, amount, datePaid):
In DuesPayment table, non_prime attribute {MemID amount, datePaid} dependent on {DuesYear} which is a complete candidate key.So that this table satisfies 2NF.
Donation – (sponID,
donationDate, donationType, donationValue,
prodYear, seasonStartDate):
In Donation table, non_prime attribute {donationDate, donationType, donationValue, prodYear, seasonStartDate} dependent on {SponID} which is a complete candidate key.So that this table satisfies 2NF.
Ticket- (saleID, seatLocation, price, type):
Member_Production(MemID, prodYear,
seasonStartDate, role, task):
So after applying 2NF, relational models are as folows:
Member(MemID,dateJoined,
firstName, lastName,phoneNumber,
currentOfficeHeld,Zip)
Address(Zip,street,
city, state, areaCode)
Play- (title, author, numberOfActs, setChanges):
Sponsor(sponID,Name, phoneNumber,Zip)
Subscriber(SubID,firstName, lastName,phoneNumber,Zip)
Production- (prodyear, seasonStartDate, seasonEndDate, title)
Performance – (perfyear,perfdate, time, seasonStartDate)
TicketSale- (saleID, saleDate, totalAmount, perfyear, perfdate,subID)
DuesPayment- (MemID, duesYear, amount, datePaid)
Donation – (sponID, donationDate, donationType, donationValue, prodYear, seasonStartDate)
Ticket- (saleID, seatLocation, price, type)
Member_Production(MemID, prodYear, seasonStartDate, role, task):
Third Normal form:
BCNF:
Hence tables are in BCNF