110 likes | 244 Views
The University of Akron Dept of Business Technology Computer Information Systems. The Relational Model: Concepts. 2440: 180 Database Concepts Instructor: Enoch E. Damson. The Relational Model. E. F. Codd of IBM originated the relational model approach in the 1970s
E N D
The University of AkronDept of Business TechnologyComputer Information Systems The Relational Model: Concepts 2440: 180Database Concepts Instructor: Enoch E. Damson
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
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
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
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
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
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
View (Subschema) • Subset of a schema • Benefits of views include: • Making databases simpler • Securing information The Relational Model: Concepts
Other Relational Model Terminologies… • Normalization – disallowing repeated groups in a table • Normalized relation – has no repeating groups • Unnormalized relation – allows repeated groups • 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 • 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
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
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