0% found this document useful (0 votes)
17 views

2 Tutorial Relational Model

The document discusses relational model concepts like super keys, candidate keys, primary keys and alternate keys using an example table. It also explains relational integrity, entity integrity and null values with examples. Finally, it lists properties of a relation like distinct relation names, single value per cell, attribute names, domain of attribute values, distinct tuples and arbitrary arrangement of attributes and tuples.

Uploaded by

chanpreet
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)
17 views

2 Tutorial Relational Model

The document discusses relational model concepts like super keys, candidate keys, primary keys and alternate keys using an example table. It also explains relational integrity, entity integrity and null values with examples. Finally, it lists properties of a relation like distinct relation names, single value per cell, attribute names, domain of attribute values, distinct tuples and arbitrary arrangement of attributes and tuples.

Uploaded by

chanpreet
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

Tutorial 2

Relational Model

1. Depending on the following table found the following:

Relation
A B C D
a1 b1 c1 d1
a1 b2 c2 d1
a1 b1 c2 d2

i. Super keys
{A}, {B}, {C}, {D}, {A,B}, {A,C},{A,D}, {B,C}, {B,D}, {C,D}, {A,B,C},
{A,B,D}, {A,C,D}, {B,C,D}, {A,B,C,D}

ii. Candidate Keys


{B,C}, {B,D}, {C,D}

iii. Primary Key


{B,C}

iv. Alternate Keys


{B,D}, {C,D}

2. Explain the following terms using a proper example:

i. Referential Integrity.
This is where all the foreign key may have a null entry or either it matches the
primary key. This is only allowed based on certain rules as it shall not be a
part of the primary table and the entry must match the value of the primary
key which is related. This maintains the correspondence between rows of the
child and parent table. Example of a referential integrity is as below
- Customer (CustID, CustName)

CT042-3-1-IDB Page 1 of 2
- Order (OrderID, CustID, OrderDate)

As you can see between the database there is one connection that links both
of them which is the CustID.

ii. Entity Integrity.


All the primary key have a unique entry and there shall no be any null value.
This is to ensure that all the foreign keys can properly reference the primary
key value for the linkage purpose. Example no one would have a duplicated
passport number. Thus all the passport number column will have values
which is different from one another and it wouldn’t be null.

iii. Null.
Null is where a data isn’t assigned any value yet. It can be represented by a
null. Null doesn’t mean 0 it just means no value yet. A null isn’t allowed to
be inserted inside a primary key. Example of null usage is when you haven’t
get the person’s contact number. Thus that cell can be represented by a null.

3. List the properties of a relation.


 In a relation all the relation name is distinct from the other relation name in the
scheme. Example Branch, Staff and etc. Don’t repeat the same name that is in the
relational schema

 Each cell has only one value. You can’t insert multiple value inside one cell.
Which means only can have one contact number

 Each attribute has one name such as custNo,custName, id and etc. Duplication of
name is not allowed.

 The value of an attribute are from the same domain such as Id can only be from
000-999. Value less or more than the range is not accepted

 each tuple are distinct from one another. This is to avoid any duplication of row

 The attributes and tuple can be arranged in any way. There isn’t any order for that
needs to be followed

CT042-3-1-IDB Page 2 of 2

You might also like