KEMBAR78
4) A Logical View of Data | PDF | Relational Database | Relational Model
0% found this document useful (0 votes)
2K views3 pages

4) A Logical View of Data

The document discusses the relational model and how it enables a logical view of data through tables. The key points are: - A table is a two-dimensional structure composed of rows and columns that contains a group of related entities. It has advantages like structural and data independence. - Tables can have different types of keys like primary keys, foreign keys, and secondary keys. Primary keys uniquely identify each row while foreign keys match values in other related tables. - Candidate keys are attributes that can qualify as unique keys. The primary key should be chosen to be unique, non-null, and unchanging. Nulls and redundancy have specific meanings and uses in tables. - Data dictionaries provide metadata about
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)
2K views3 pages

4) A Logical View of Data

The document discusses the relational model and how it enables a logical view of data through tables. The key points are: - A table is a two-dimensional structure composed of rows and columns that contains a group of related entities. It has advantages like structural and data independence. - Tables can have different types of keys like primary keys, foreign keys, and secondary keys. Primary keys uniquely identify each row while foreign keys match values in other related tables. - Candidate keys are attributes that can qualify as unique keys. The primary key should be chosen to be unique, non-null, and unchanging. Nulls and redundancy have specific meanings and uses in tables. - Data dictionaries provide metadata about
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/ 3

4)A Logical View of Data

• Relational model

– Enables programmer to view data logically rather than physically

• Table

– Has advantages of structural and data independence

– Resembles a file from conceptual point of view

– Easier to understand than its hierarchical and network database predecessors

Tables and Their Characteristics

• Table: two-dimensional structure composed of rows and columns

• Contains group of related entities = an entity set

– Terms entity set and table are often used interchangeably

– Table also called a relation because the relational model’s creator, Codd, used the term
relation as a synonym for table

– Think of a table as a persistent relation:

– A relation whose contents can be permanently saved for future use


Keys

• Consists of one or more attributes that determine other attributes

• Primary key (PK) is an attribute (or a combination of attributes) that uniquely identifies any given
entity (row)

• Key’s role is based on determination

– If you know the value of attribute A, you can look up (determine) the value of attribute B

• Foreign key (FK)

– An attribute whose values match primary key values in the related table

• Referential integrity

– FK contains a value that refers to an existing valid tuple (row) in another relation

• Secondary key

– Key used strictly for data retrieval purposes

Candidate Key

• A Candidate Key can be any column or a combination of columns that can qualify as unique key
in database. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify
as Primary Key.

How to select Primary Key

• select a key that does not contain NULL

• Select a key that is unique and does not repeat

• Make sure that Primary Key does not keep changing

Keys (continued)

• Nulls:

– No data entry

– Not permitted in primary key

– Should be avoided in other attributes

– Can represent

• An unknown attribute value

• A known, but missing, attribute value

• A “not applicable” condition

– Can create problems when functions such as COUNT, AVERAGE, and SUM are used
– Can create logical problems when relational tables are linked

• Controlled redundancy:

– Makes the relational database work

– Tables within the database share common attributes that enable the tables to be linked
together

– Multiple occurrences of values in a table are not redundant when they are required to
make the relationship work

– Redundancy exists only when there is unnecessary duplication of attribute values

Integrity Rules

The Data Dictionary and System Catalog

• Data dictionary

– Provides detailed accounting of all tables found within the user/designer-created


database

– Contains (at least) all the attribute names and characteristics for each table in the
system

– Contains metadata—data about data

– Sometimes described as “the database designer’s database” because it records the


design decisions about tables and their structures

You might also like