Question: Code a) and b) in SQL Q1. Consider the following tables (relations) that contain information (all stored as names) about persons visiting hospitals, treatments offered

 Code a) and b) in SQL Q1. Consider the following tables(relations) that contain information (all stored as names) about persons visiting hospitals,

Code a) and b) in SQL

treatments offered by hospitals, treatments liked by persons, and treatments effective for

Q1. Consider the following tables (relations) that contain information (all stored as names) about persons visiting hospitals, treatments offered by hospitals, treatments liked by persons, and treatments effective for diseases. A person can like several treatments; a treatment can be liked by many persons. A person can go to several hospitals, and a hospital may be visited by many persons. A hospital can offer many different treatments, and a treatment can be offered by several hospitals. A treatment may be effective for several diseases and a disease may be effected by many treatments. Please note that in all the queries at least one some means Visits(person, hospital) Offers(hospital, treatment) Likes(person, treatment) Effects(treatment, disease) a) Find persons who visited all hospitals that offer some treatments liked only by Obama? b) Find treatments which effect at most 20 diseases and are offered by at least 100 hospitals visited by Bush

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure lets work through the SQL queries step by step a Find persons who visited all hospitals that of... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!