Assignment 2 SH
Assignment 2 SH
STUDENT
Select:-
Update:-
1. Update STUDENT as set name=’Smith’
2. Update SECTION as set instructor =’Stone’ and semester=’fall’
Data Redundancy:-
Data redundancy is a data organization issue that allows the unnecessary duplication of
data within your Microsoft Access database. A change or modification, to redundant data,
requires that you make changes to multiple fields of a database. While this is the expected
behaviour for flat file database designs and spreadsheets, it defeats the purpose of
relational database designs.
Essentially, the introduction of redundancy is a function of the size of the redundant column
and the frequency with which the column is updated. The ideal candidates for redundant
duplication are table columns that meet the following criteria:
The introduction of redundancy will eliminate the need to repeatedly join two tables
together.
The data column is small.
The data column is static and rarely updated.
• Flexibility: Because programs and data are independent, programs do not have
to be modified when types of unrelated data are added to or deleted from the
database, or when physical storage changes.
• Lower user training costs: Users often find it easier to learn such systems and
training costs may be reduced. Also, the total time taken to process requests may be
shorter, which would increase user productivity.
Table 1 (STUDENT):-
1. Primary key of this table is Student Number.
2. Name, Class , Major combined can be a candidate key.
Table 2 (COURSE):-
1. Primary key is Course_number.
2. Course_name , credit_ hours, department combined can be a candidate key.
Table 3 (SECTION):-
1. Section_identifier is a primary key.
2. Course_number is a foreign key table 2.
Table 4 (GRADE_REPORT):-
1. Student_number, section_identifier , Grade combined can be primary key.
2. Student_number, Section_identifier are foreign keys from table4 and table 3
respectively.
Table 5 (PREREQUISITE):-
1. Course_number and Prerequisite_number combined can be a Primary key.
2. Course_number is a foreign key from table 2.
Entity integrity:-
The entity integrity constraint states that no primary key value can be null. This is because
the primary key value is used to identify individual tuples in a relation. Having null value for
the primary key implies that we cannot identify some tuples. This also specifies that there
may not be any duplicate entries in primary key column.
Example:-
In every above table field of PK is unique and cannot be null.
Referential Integrity:-
The referential integrity constraint is specified between two relation and is used to maintain
the consistency among tuples in the two relations. Informally, the referential integrity
constraint states that a tuple in one relation that refers to another relation must refer to an
existing tuple in that relation.
Example:-
Every FK defined in question 4, must be the Primary key of the referred table but
foreign key can be partially null.