Database Fundamental (TIS 1101) Tutorial 2
Database Fundamental (TIS 1101) Tutorial 2
Tutorial 2
Entity integrity is the condition in which each row in the table has its own unique
identity.
For example, each student has a student ID. Thus, in a table, the student ID is a
unique identity for each row.
Q2. A relational table is a two-dimensional table that composed of rows and columns.
What are the key characteristics of a relational table?
- Each table row (tuple) represents a single entity occurrence within the entity
set
- Each table column represents an attribute, and each column has a distinct
name
- Each row/column intersection represents a single data value
- All values in a column must conform to the same data format
- Each column has a specific range of values known as the attribute domain
(e.g., gender – Female/Male)
- The order of the rows and columns is immaterial to the DBMS
- Each table must have an attribute or a combination of attributes that uniquely
identifies each row
1. Entity – is a person, place, thing or event about which data are collected
2. Attribute – a characteristic of an entity
3. Relationship – describes the association among entities
4. Constraint – a restriction placed on data (e.g., Grade must be between A, B, C,
D or F)
Q4. What is a foreign key?
Foreign key is the primary key of one table that has been placed into another table
to create a common attribute.
Q5. Briefly explain the THREE different relationships within the relational database
Q6. Define business rules. Why business rules are important? Give an example.
Business rules are important since they are used to define entities, attributes,
relationships and constraints, which form the basis for data modeling.
Table1
Code CourseName Credit
SAK3100 Programming 4
SAK3304 Computer 4
MTK3200 Algebra 4
MGT2102 Business 2
Table2
Code CourseName Credit
MTK3200 Algebra 4
MGT2102 Business 2
ECO4300 Economic 2
CourseName
Programming
Computer
Algebra
A B1
StudID LecID LecID
S1 L1 L2
S1 L2 2B
S1 L3 L2
S1 L4 L4
S2 L1 3B
S2 L2 L1
S3 L2 L2
S4 L2 L4
S4 L4
(a) A divide B1
StudID
S1
S2
S3
S4
(b) A divide B2
StudID
S1
S4
(c) A divide B3
StudID
S1
** Note to tutor: If time permits, can expose student to create simple table such as.
Connect to dbStudent