Many to Many relationship Create a relational database design from the following
ID: 3708843 • Letter: M
Question
Many to Many relationship Create a relational database design from the following data model:
This includes the CUSTOMER, SEMINAR, and CONTACT entities and relationships in the E-R diagram
SQLQuery-D and QBEQuery-D: Write an SQL query to display all the seminar and customer information for each seminar (but not the contacts), by joining the SEMINAR and CUSTOMER tables.
SQLQuery-E and QBEQuery-E: Write an SQL query to display all the contact and customer information (but not the seminars), by joining the CONTACT and CUSTOMER tables.
SQLQuery-F and QBEQuery-F: Write an SQL query to display all the seminar and contact information (but not the customers), by joining the SEMINAR and CONTACT tables.
SEMINAR CUSTOMER SeminarlD EmailAddress SeminarDate SeminarTime Location SeminarTitle LastName OFirstName Phone StreetAddress Clty State ZIP CONTACT EmailAddress ContactDate ContactNumber ContactTypeExplanation / Answer
Solution:
Note: The queries are given below
D)
SELECT SeminarDate, SeminarTime, Location, SeminarTitle, LastName, FirstName, Phone, StreetAddress, Cirty, State, Zip FROM Seminar, Customer GROUP BY SeminarTitle
E)
SELECT EmailAddress, ContactDate, ContactNumber, ContactType, LastName, FirstName, Phone, StreetAddress, City, State, Zip FROM Contact, Custome
F)
SELECT SeminarDate, SeminarTime, Location, SeminarTitle, EmailAddress, ContactDate, ContactNumber, ContactType FROM Seminar, Contact
PS: There is no common attribute between tables that is why Join cannot be performed but the above query will give us the desired result.
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)