Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Topic 1 : 1 a . i . Construct an E - R diagram for a hospital with a set of patients and a set

Topic 1:
1a.
i. Construct an E-R diagram for a hospital with a set of patients and a set of medical
doctors. Associate with each patient a log of the various tests and examinations
conducted.
Ensure that you document all assumptions that you make about the mapping constraints.
Ensure that the entities, actions, attributes, and relationships are all shown.
ii. Explain the distinctions among the terms primary key, candidate key, and super key.
1b. For the following relation schema:
employee (employee-name, street, city)
works (employee-name, company-name, salary)
company (company-name, city)
manages (employee-name, manager-name)
Give an expression in SQL for each of the following queries:
i. Find the names, street addresses, and cities of residence for all employees who work
for 'First Halal Bank Corporation' and earn more than $20,000.
ii. Find the names of all employees in the database who earn more than every employee
of 'Barakah Bank Corporation'. Assume that all people work for at most one company.
iii. Find the names of all employees in the database who live in the same cities but on
different streets as do their managers.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

ISBN: 978-0764535376

More Books

Students also viewed these Databases questions