* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download The Relational Model: Concepts - gozips.uakron.edu
Survey
Document related concepts
Transcript
The University of Akron Dept of Business Technology Computer Information Systems 2440: 180 Database Concepts Instructor: Enoch E. Damson The Relational Model: Concepts The Relational Model E. F. Codd of IBM originated the relational model approach in the 1970s Has been the predominant method for data storage The central data description construct is a table (called “relation” by Dr. Codd) The Relational Model: Concepts 2 Advantages of the Relational Model Logical and physical characteristics of a database are separated Model is simple and easy to understand Powerful operators to enable complex operations to be executed with simple commands Design of Database is simple The Relational Model: Concepts 3 Relational Databases Collection of relations (tables or entities) Records (rows or tuples) contain data about entities Attributes (columns or fields) contain data about properties of the entities Relationships are common columns in two or more tables Order of rows and columns is unimportant Repeating groups are not permitted Entries with repeating groups are unnormalized The Relational Model: Concepts 4 Relation Two dimensional table in which: Entries are single-valued Each column (field or attribute) has a distinct name All values in a column represent the same attribute Order of columns is immaterial Each row (record or tuple) is distinct Order of rows is immaterial The Relational Model: Concepts 5 Schema Database structure representation Description of a database (in terms of a data model) Relational model schema for a relation specifies: Name of the relation Name of each field (attribute or column) Type of each field The Relational Model: Concepts 6 Schema Representation Write the name of the table followed by a list of all columns (and column types) within parentheses E.g., Students (sid: char, name: char, login: char, age: integer, gpa: numeric) Underline unique key (primary key) Each table should appear on its own line Use the notation, tablename.columnname, with duplicate column names within a database Using this combination qualifies column names The Relational Model: Concepts 7 View (Subschema) Subset of a schema Benefits of views include: Making databases simpler Securing information The Relational Model: Concepts 8 Other Relational Model Terminologies… Normalization – disallowing repeated groups in a table Query – an approach that helps obtain information from a database Data Definition Languages (DDLs) - approaches to data definition E.g. Structured Query Language (SQL) Data Manipulation Languages (DMLs) - approaches to data manipulation Normalized relation – has no repeating groups Unnormalized relation – allows repeated groups E.g. Query-by-Example (QBE), Relational Algebra, SQL and Relational Calculus Structured Query Language (SQL) – the language that defines and manipulates relational databases Entity-Relationship Diagram (ERD) - diagram that visually represents database structure The Relational Model: Concepts 9 Other Relational Model Terminologies Integrity Constraint – rules applied to a DBMS to perform specific functions on a database There are several types of key constraints: Primary key Composite key Candidate keys Surrogate key (synthetic key) Foreign key The Relational Model: Concepts 10 Types of Key Constraints Primary key – the column (or collection of columns) that uniquely identifies a given row in a table Composite key – a primary key with two or more fields Candidate keys – other unique keys in a table that are capable (or candidates) of being used as the primary key Surrogate key (synthetic key) – system-generated primary key usually hidden from users Foreign key – the field in one relation required to match the primary key of another relation to specify relationships between the relations and to ensure referential integrity constraints The Relational Model: Concepts 11