Suppose you have the following relational database scheme for a real estate agency:   Real Estate Office (officeID, street, city, postalCode) Employee (employeeID, name, surname, position, gender, salary, officeID) Rental Property (propertyID, street, city, postalCode, type, number of rooms, rent, property ownerID, employeeID, officeID) Customer (customerID, name, surname, phone number, maxRent) Property Owner (Property OwnerID, name, surname, address, teephone number) Property show (clientID, propertyID, show time comment) Record (customerID, officeID, employeeID, recordDate)   First, determine the appropriate primary key for each relationship. Then create the appropriate queries using SQL.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Suppose you have the following relational database scheme for a real estate agency:

 

Real Estate Office (officeID, street, city, postalCode)

Employee (employeeID, name, surname, position, gender, salary, officeID)

Rental Property (propertyID, street, city, postalCode, type, number of rooms, rent, property ownerID, employeeID, officeID)

Customer (customerID, name, surname, phone number, maxRent)

Property Owner (Property OwnerID, name, surname, address, teephone number)

Property show (clientID, propertyID, show time comment)

Record (customerID, officeID, employeeID, recordDate)

 

First, determine the appropriate primary key for each relationship. Then create the appropriate queries using SQL.

 

1. Relational Algebra Queries

List the ID, street, city and rent information of the properties managed by the employees in the office located on "Galata Cad" street.

b. List all cities with offices but no rental properties.

List the names and comments of all customers who have viewed a rental property.

d.List the first and last names of all customers viewing three-room properties.

e. List customers who are registered customers who have never been shown a property.

 

2.SQL Queries

List the ID, street, city and rent information of the properties managed by the employees in the office located on "Galata Cad" street.

b.List all cities with offices but no rental properties

c. List customers who are registered customers who have never been shown a property.

d. List all employees whose salaries are higher than the average salary.

Find the number of properties managed by each employee

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY