data hierarchy & keys (database management system)

Post on 13-Feb-2017

295 Views

Category:

Education

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Organization of DataDATABASE MANAGEMENT SYSTEM

Data Hierarchy• Data is organized in a hierarchy that begins with the

smallest to the largest unit of data, as it progresses up the hierarchy.

Database

File

Record

Field

Byte

Bit

Data Hierarchy• Bit (Either 0 or 1, Smallest unit of data)• Byte (Combination of 8 bits, Each byte makes 1

letter)• Field (Combination of bytes, Category)• Record (Combination of fields, Related to one

person, employee, student, member or organization)• File (Combination of records, Related to different

persons, employees, students, members or organizations)• Database (Combination of files, Largest unit of data)

Key (Database)• A value that is uniquely identified each record in a table.Examples• Roll No.• Student’s Name• Father’s Name• Course • Session• Date of Admission Etc.

Types of Key• Candidate key is a column, or set of columns, in a table that can

uniquely identify any database record without referring to any other data. • Primary key (Each table may have one or more candidate keys, but

one candidate key is special, and it is called the primary key)• Alternative key is a key associated with one or more columns

whose values uniquely identify every row in the table, but which is not the primary key.• Super key is a combination of columns that uniquely identifies any

row. May be 2 or 3 or more, as according (Direct proportional) to data.• Foreign Key is a column (or columns) that references a column

(most often the primary key) of another table. The purpose of the foreign key is to ensure referential integrity of the data.

Candidate keys

Primary key Alternati

ve keys

Super keys

Foreign keys

Foreign keys

top related