Page 1 of 1

Consider the following relational database schema (primary keys are underlined, foreign keys are in italic, referring to

Posted: Mon Jun 06, 2022 5:48 pm
by answerhappygod
Consider The Following Relational Database Schema Primary Keys Are Underlined Foreign Keys Are In Italic Referring To 1
Consider The Following Relational Database Schema Primary Keys Are Underlined Foreign Keys Are In Italic Referring To 1 (52.87 KiB) Viewed 16 times
Consider the following relational database schema (primary keys are underlined, foreign keys are in italic, referring to the same attribute in a different table): MedicalCentres (cid, centre, address) Patients (pid, name, date_of_birth, insurance) Appointments (aid, cid, pid, date, time, vaccination, payment) On this schema, the following two SQL queries are given: Q1: SELECT centre FROM Medical Centres M, Appointments A WHERE M. cid = A.cid; Q2: SELECT centre FROM Medical Centres M WHERE M.cid IN (SELECT A.cid FROM Appointments A ); Although these queries Q1 and Q2 seem to ask for the same information, they actually can produce different answers, especially for medical centres with many appointments. Describe in your own words what each query is doing, ideally using a small example. How do the results of queries Q1 and Q2 differ? Edit View Insert Format Tools Table 12pt ✓ Paragraph B I U T² V 2 To 8 1