0% found this document useful (0 votes)
20 views2 pages

Database Assignment

The document discusses database design and relationships between tables. It defines primary and candidate keys for various tables like Branch, Staff, PropertyForRent, Client, and PrivateOwner. It also describes foreign key relationships between the tables like BranchNo as a foreign key in Staff and primary key in Branch. Sample insert, delete statements are provided at the end.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Database Assignment

The document discusses database design and relationships between tables. It defines primary and candidate keys for various tables like Branch, Staff, PropertyForRent, Client, and PrivateOwner. It also describes foreign key relationships between the tables like BranchNo as a foreign key in Staff and primary key in Branch. Sample insert, delete statements are provided at the end.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

DATABASE ASSIGNMENT

19k-0287
Section f
Abdul Ghaffar Ansari
Q1:
Branch => let assuming “BranchNo” as a primary key while
“PostCode” is the candidate key.
Staff => “StaffNo” is a primary key and there is no candidate key
except “StaffNo”.
PropertyForRent => “PostCode” is the only candidate key except
primary key.
Client => “telNo” and ”email” are the candidate keys.
PrivateOwner => “telNo”,” address”,” email” are the candidate keys.
Viewing => There is no any candidate key.
Registration => There is no any candidate key.

Q2:
“branchNo” is the Primary key in Branch Database, “branchNo” also
exist in Staff database, assume “branchNo” of Branch database is the
Primary key while “branchNo” of Staff database is the Foreign key.

“branchNo” is the Primary key in Branch Database and “StaffNo” is


the Primary key in Staff Database. let’s assume two Foreign keys in
PropertyForRent are “StaffNo” and “branchNo” referenced by Staff
Database and Branch Database respectively.
“clientNo” is the Primary key in Client Database, ““clientNo”” also
exist in Viewing database, assume “clientNo” of Branch database is
the Primary key while “clientNo” of Staff database is the Foreign
key.

“clientNo”, “branchNo”, “staffNo” of Registration Database are


Foreign keys referenced by “clientNo” of Client Database,
“branchNo” of Branch Database, and “staffNo” of Staff Database
respectively.

Q3:
 Insert into staff values (SA9,’Scott’,’Jeff’,’Clerk’,1,’1977-10-
01’,58000, B007);
 Insert into registration values (CR56,’’,’’,’1990-12-07’);
 delete from branch where branchNo=’B002’;
 delete from privateOwner where name=’Tony Show’;

You might also like