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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post by answerhappygod »

Consider The Following Relational Database Schema Primary Keys Are Underlined Foreign Keys Are In Italic Referring Th 1
Consider The Following Relational Database Schema Primary Keys Are Underlined Foreign Keys Are In Italic Referring Th 1 (131.53 KiB) Viewed 27 times
Consider the following relational database schema (primary keys are underlined, foreign keys are in italic, referring the same attribute in a different table): Medical Centres (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?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply