Академический Документы
Профессиональный Документы
Культура Документы
A s
Computers In Management
J k
A s
A s
1 ABC ****
2 DEF ****
3 GHI ****
4 JKL ****
J k
Hierarchical model A s
A s
A s
A s
• A relational database is a single database spread across multiple tables.
• Three key terms are used extensively in relational database models:
relations, attributes, and domains. A relation is a table with columns
and rows. The named columns of the relation are called attributes, and
the domain is the set of values the attributes are allowed to take.
Relational Model (Continued) J k
• For example, each record in a "Faculty and Their Courses" table might contain
a Faculty ID, Faculty Name, Faculty Hire Date, and Course Code—thus we can
record the details of any faculty member who teaches at least one course, but
we cannot record the details of a newly-hired faculty member who has not yet
been assigned to teach any courses.
Update Anomaly J k
A s
Normalisation A s
A relation is in first normal form if all its attributes are simple. In other
words, none of the attributes of the relation is a relation.
Student-courses (Sid:pk, Sname, Phone, Courses-taken) Where attribute
Sid is the primary key, Sname is student name, Phone is student's phone
number and Courses-taken is a table contains course-id, course-
description, credit hours and grade for each course taken by the student.
More precise definition of table Course-taken is :Course-taken (Course-
id:pk, Course-description, Credit-hours, Grade)
St-100-Course-taken
St-200-Course-taken
Course-id Course-description Credit-hours Grade
IS380 Database Concepts 3 B
IS416 Unix Operating 3 B
System
IS420 Data Net Work 3 C
St-300-Course-taken
Course-id Course-description Credit-hours Grade
IS417 System Analysis 3 A
Insertion anomaly means that that some data can not be inserted in the
database. For example we can not add a new course to the database of
A s
To convert the above structure to first normal form relations, all non-simple
attributes must be removed or converted to simple attribute.
A s
A s
primary key. For the same reason Course-id cannot be the primary key.
However the combination of Sid and Course-id uniquely identifies a row in
Student-courses, Therefore (Sid, Course-id) is the primary key of the
above relation.
The primary key determines every attribute. For example if you know both
Sid and Course-id for any student you will be able to retrieve Sname,
Phone, Course-description, Credit-hours and Grade, because these
attributes are dependent on the primary key.
A s
A first normal form relation is in second normal form if all its non-primary
attributes are fully functionally dependent on the primary key.
To convert Student-courses to second normal relations we have to make
all non-primary attributes to be fully functionally dependent on the primary
key.
To do that we need to project (that is we break it down to two or more
relations) Student-courses table into two or more tables.
To avoid such problems it is important to keep attributes, which are
dependent on each other in the same table, when a relation is projected to
smaller relations.
A s
Winner Date of
Tournament Year Winner
Birth
Indiana Invitational 1998 Al Fredrickson 21 July 1975
Cleveland Open 1999 Bob Albertson 28 September 1968
Des Moines 1999 Al Fredrickson 21 July 1975
Masters
Indiana Invitational 1999 Chip Masterson 14 March 1977
A table whose non-primary key fields are dependent only on the primary
key and therefore have no dependence (relationship to) any other non-
primary key field in the table is consider in third normal form (3NF). And,
additionally the table must first be in 2nd normal form.