Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1. Consider the following relation schemas. Primary keys are underlined. Relation Schemas Musicians(ssn, name,Registers the ssn of musicians and annualIncome) Instruments(instrID, iname, key) Plays(ssn,
Problem 1. Consider the following relation schemas. Primary keys are underlined. Relation Schemas Musicians(ssn, name,Registers the ssn of musicians and annualIncome) Instruments(instrID, iname, key) Plays(ssn, instrID) Meaning and additional information their names and annual incomes egisters instruments. Registers which musicians play which instruments SongsAppears(songID, authorSSN, title, albumIdentifier) Registers songs and which albums they appear. Every song must have exactly one author who is a musician, and appears in exactly one album Registers where musicians live and which phones they use Lives(ssn, address, phone) Place(address, otherInfo) Register all addresses. Perform(songID, sSn)Register which songs are performed which musicians lbumProducer(ssn, albumIdentifier copyrightDate, speed, title) Registers albums and their oducers (who are musicians). Use (1) Relational Algebra and (2) Tuple Relational Calculus to express the following queries: 1. Find the instruments (InstID) played by a musician named 'John'. 2. Find the instruments (InstID) played by every musicians whose name is "John' 3. Find the instruments (InstID) played only by musicians whose name is "John', i.e., are not played by any musician with a different name. Find the titles of the albums produced by musicians who play guitar or piano (iname-'guitar' or 'piano'). 4. 5. Find the musicians who played both songl (songlD-'songl') and song2 6. (songID-song2') Find the musician(s) with the highest annual income. Find the musicians who earn more than every other musician. 7. 8. Find all the pairs of musicians (give names) who share an address. 9. Find the songs that are not performed by any musician. 10. Find the musicians (names) who played all the songs written by 'John' (musiciarn author name- 'John') 11. Find the musicians who perform a song they have authored 12. Find the musicians who perform all songs they have authored 13. Find the musicians who have authored all songs they perform 14. Find the musicians who perform only songs they have authored, i.e., do not perform any songs they have not authored. Problem 1. Consider the following relation schemas. Primary keys are underlined. Relation Schemas Musicians(ssn, name,Registers the ssn of musicians and annualIncome) Instruments(instrID, iname, key) Plays(ssn, instrID) Meaning and additional information their names and annual incomes egisters instruments. Registers which musicians play which instruments SongsAppears(songID, authorSSN, title, albumIdentifier) Registers songs and which albums they appear. Every song must have exactly one author who is a musician, and appears in exactly one album Registers where musicians live and which phones they use Lives(ssn, address, phone) Place(address, otherInfo) Register all addresses. Perform(songID, sSn)Register which songs are performed which musicians lbumProducer(ssn, albumIdentifier copyrightDate, speed, title) Registers albums and their oducers (who are musicians). Use (1) Relational Algebra and (2) Tuple Relational Calculus to express the following queries: 1. Find the instruments (InstID) played by a musician named 'John'. 2. Find the instruments (InstID) played by every musicians whose name is "John' 3. Find the instruments (InstID) played only by musicians whose name is "John', i.e., are not played by any musician with a different name. Find the titles of the albums produced by musicians who play guitar or piano (iname-'guitar' or 'piano'). 4. 5. Find the musicians who played both songl (songlD-'songl') and song2 6. (songID-song2') Find the musician(s) with the highest annual income. Find the musicians who earn more than every other musician. 7. 8. Find all the pairs of musicians (give names) who share an address. 9. Find the songs that are not performed by any musician. 10. Find the musicians (names) who played all the songs written by 'John' (musiciarn author name- 'John') 11. Find the musicians who perform a song they have authored 12. Find the musicians who perform all songs they have authored 13. Find the musicians who have authored all songs they perform 14. Find the musicians who perform only songs they have authored, i.e., do not perform any songs they have not authored
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