Relational Algebra
Relational Algebra
Relation: OFFICE_BRANCH
BranchNo Street City Postcode
B005 22 Deer Rd London SW1 4EH
B007 16 Argyll St. Aberdeen AB2 3SU
B003 163 Main St. Glasgow G11 9QX
B004 32 Manse Rd. Bristol BS99 INZ
B002 56 Clover Dr. London NW10 6EU
Relation: STAFF
staffNo fName lName position sex DOB salary branchNo
SL21 John White Manager M 10/01/1955 30000 B005
SG37 Ann Beech Assistant F 11/10/1960 12000 B003
SG14 David Ford Supervisor M 03/24/1958 18000 B003
SA9 Mary Howe Assistant F 02/19/1970 9000 B007
SG5 Susan Brand Manager F 06/03/1960 24000 B003
SL41 Julie Lee Assistant F 06/13/1965 9000 B005
Relation: PROPERTY_FOR_RENT
propertyNo Street City postcode type rooms rent ownerNo staffNo branchNo
PA14 16 Holhead Aberdeen AB7 5SU House 5 650 C046 SA9 B007
PL94 6 Argyll St. London NW2 Flat 4 400 C087 SL41 B005
PG4 6 Lawrence Glasgow G11 Flat 3 350 C040 BA B003
St. 9QX
PG36 2 Manor Rd Glasgow G32 Flat 3 375 C093 SG37 B003
4QX
PG21 18 Dale Rd Glasgow G12 House 5 600 C087 SG37 B003
PG16 5 Novar Dr Glasgow G12 9AX Flat 4 450 C093 SG14 B003
Relation: CLIENT
clientNo FName lName telNo prefType maxRent
CR76 John Kay 0207-774-5632 Flat 425
C056 Aline Stewart 0141-848-1825 Flat 350
CR74 Mike Ritchie 01475-392178 House 750
CR62 Mary Tregear 01224-196720 Flat 600
Relation: PRIVATE_OWNER
OwnerNo fName lName cityAddress telNo
CO46 Joe Keogh Aberdeen 01224-861212
C087 Carol Farrel Glasgow 0141-347-7419
C040 Tina Murphy Glasgow 0141-943-1728
C093 Tony Shaw Glasgow 0141-225-7025
Relation: VIEWING
ClientNo propertyNo viewDate Comment
CR56 PA14 05/24/2010 Too small
CR76 PG4 O4/20/2010 Too remote
CR56 PG4 05/26/2010
CR62 PA14 05/14/2010 No dining room
CR56 PG36 04/28/2010
Relation: REGISTRATION
ClientNo branchNo staffNo dateJoined
CR76 B005 SL41 01/02/2001
CR56 B003 SG37 04/11/2000
CR74 B003 SG37 11/16/1999
CR62 B007 SA9 03/07/2000
REQUIREMENTS:
3. List the client numbers of all clients who have not viewed any property yet.
4. List the city where there is property for rent and where a registered owner resides, too.
5. List all comments given by clients who have viewed any of the property.
6. List the staff of branch B003 and B007 with a salary of at least 24000.00. Include on the list the
StaffNo, name, and salary.
11. List all client names needing a house with a budget of at most 750.00.
12. Produce a report on all registrations done for the first quarter of 2011.
13. List all cities where there is either a branch office or a property for rent.
14. List all cities where there is a branch office but no properties for rent yet.
15. List all cities where there is both a branch office and at least one property for rent.
16. List all staff numbers of staff who have not handled any registration yet.
17. List the property number, location, type, number of rooms, and rent amount of all properties
viewed by client number 56.
18. List the names (first name and last name on separate columns) and comments of all clients who
have viewed a property for rent.
19. Produce a report on status viewing. The relation would consist of the properties that have been
viewed and those that have not been viewed yet. Include on the list the property number,
street, city, client number, view date and comment.
propertyNo street City clientNo viewDate Comments
PA14 16 Holhead Aberdeen CR56 05/24/2010 Too small
PA14 16 Holhead Aberdeen CR62 05/14/2010 No dining
room
PL94 6 Argyll St. London null Null Null
PG4 6 Lawrence Glasgow CR76 O4/20/2010 Too remote
St.
PG4 6 Lawrence Glasgow CR56 05/26/2010
St.
PG36 2 Manor Rd Glasgow CR56 04/28/2010
PG21 18 Dale Rd Glasgow null Null Null
PG16 5 Novar Dr Glasgow null Null Null
20. List complete details of all staff who work at the branch in Glassgow.
staffNo fName lName position Sex DOB salary branchNo
SG37 Ann Beech Assistant F 11/10/1960 12000 B003
SG14 David Ford Supervisor M 03/24/1958 18000 B003
SG5 Susan Brand Manager F 06/03/1960 24000 B003