logo

Fundamentals On Database Question and Answer 2022

Submit Assignment #1 on Blackboard in WORD format.

6 Pages616 Words26 Views
   

Added on  2022-09-29

Fundamentals On Database Question and Answer 2022

Submit Assignment #1 on Blackboard in WORD format.

   Added on 2022-09-29

ShareRelated Documents
Running Head: FUNDAMENTALS OF DATABASE 1
FUNDAMENTALS OF DATABASE
Student Name
Institution
Course
Date
Fundamentals On Database Question and Answer 2022_1
FUNDAMENTALS OF DATABASE 2
Question 1
Give an example of 3 relations illustrating primary keys and foreign keys.
Solution
Some of the basic concepts of primary and foreign keys are (Connolly & Begg, 2015):
A primary key identifies a unique record in a relation
A primary key cannot be null and should be very unique in a certain entry
Foreign keys identify other entries in a relation
In order to refer a record uniquely in another table, it should also be unique in that table
in order to avoid conflicts, a foreign key should hence be a primary key of a referencing
table
An Example of 3 relations
(i)Relation customer
TABLE Customer
{
CustomerID int NOT NULL,
Name varchar (15),
Phone VarChar (10),
PRIMARY KEY (CustomerID)
}
Fundamentals On Database Question and Answer 2022_2
FUNDAMENTALS OF DATABASE 3
(ii)Relation Item
TABLE Item
{
ItemID int NOT NULL,
ItemName VarChar,
ItemPrice int,
PRIMARY KEY (ItemID)
}
(iii)Relation Order
TABLE Order
{
OrderID int NOT NULL,
CustomerID int,
ItemID int,
Quantity int,
Total int,
PRIMARY KEY (OrderID),
Fundamentals On Database Question and Answer 2022_3

End of preview

Want to access all the pages? Upload your documents or become a member.