Implementation of the Relational Model There is no substitute for the comfort supplied by the utterly taken-for-granted relationship. Iris Murdoch.

Slides:



Advertisements
Similar presentations
Implementation of the Relational Model
Advertisements

Chapter 10: Designing Databases
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
Relational Algebra, Join and QBE Yong Choi School of Business CSUB, Bakersfield.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 1/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Foundations of Relational Implementation n Defining Relational Data n Relational Data Manipulation n Relational Algebra.
The Relational Database Model
ETEC 100 Information Technology
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
Database Management: Getting Data Together Chapter 14.
The Relational Database Model
The Relational Database Model:
Introduction to Databases Transparencies
Fundamentals, Design, and Implementation, 9/e Chapter 1 Introduction to Database Processing.
The Relational Database Model. 2 Objectives How relational database model takes a logical view of data Understand how the relational model’s basic components.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Transforming Data Models into Database Designs
IST Databases and DBMSs Todd S. Bacastow January 2005.
3 The Relational Model MIS 304 Winter Class Objectives That the relational database model takes a logical view of data That the relational model’s.
Database Lecture # 1 By Ubaid Ullah.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
Copyright © 2003 by Prentice Hall Module 4 Database Management Systems 1.What is a database? Data hierarchy and data organization Field, record, file,
Module Title? DBMS Introduction to Database Management System.
Database and Data Warehouse Module B: Designing and Building a Relational Database Chapter 3.
CS609 Introduction. Databases Current state? Future?
Database Technical Session By: Prof. Adarsh Patel.
STORING ORGANIZATIONAL INFORMATION— DATABASES CIS 429—Chapter 7.
1 Introduction to Database Systems. 2 Database and Database System / A database is a shared collection of logically related data designed to meet the.
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
DBSQL 3-1 Copyright © Genetic Computer School 2009 Chapter 3 Relational Database Model.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
The Relational Database Model
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
1 Database Concepts 2 Definition of a Database An organized Collection Of related records.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
CHAPTER 3 DATABASES AND DATA WAREHOUSES. 2 OPENING CASE STUDY Chrysler Spins a Competitive Advantage with Supply Chain Management Software Chapter 2 –
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Creating and Maintaining Geographic Databases. Outline Definitions Characteristics of DBMS Types of database Relational model SQL Spatial databases.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 3 The Relational Database Model.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 3 The Relational Database Model.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Lecture 10 Creating and Maintaining Geographic Databases Longley et al., Ch. 10, through section 10.4.
3 1 Database Systems The Relational Database Model.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Chapter 3: Relational Databases
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Logical Database Design and Relation Data Model Muhammad Nasir
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Week 2 Lecture The Relational Database Model Samuel ConnSamuel Conn, Faculty Suggestions for using the Lecture Slides.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Databases and DBMSs Todd S. Bacastow January
Logical Database Design and the Rational Model
The Relational Database Model
Lecture 2 The Relational Model
Introduction to Database Management System
Chapter 1 Introduction to Database Processing
Database Systems: Design, Implementation, and Management
Presentation transcript:

Implementation of the Relational Model There is no substitute for the comfort supplied by the utterly taken-for-granted relationship. Iris Murdoch

Class Outline  What are the required features of a DBMS?  What are the features of a relational database management system (RDBMS)?  What is entity integrity and referential integrity?  To what extent are entity integrity and referential integrity supported by MS Access?  What are the eight algebraic functions supported by a fully relational DBMS? Give examples of each.

Functions of a DBMS  Data storage and integrity management - creates complex structures to store data, forms, etc. and enforces data relationships  Management of data dictionary - updates as database structure is modified  Data transformation - presents data as user requests  Backup and Recovery - ensures data safety in case of damage  Multi-user access and Security - allows concurrent use of database; disallows access to components as determined by the user  Database Access Languages - supports non-procedural (user specifies what must be done, not how) query language  Application Programming Interfaces - supports procedural languages (e.g., MS Access uses Visual Basic) for programmers  Communication Interfaces - modern DBMSs provide access to the database using internet browsers (e.g., Netscape)

Relational Database Management Systems  Relational database architecture  Codd, E.F. (1970). A relational model for large shared data banks. CACM, 13(6),  based on relational algebra and calculus  first relational prototype - early 1970s - IBM’s System R  Relational databases required considerable computing resources (memory, processing speed)  not feasible until mid- 1980s when price-performance ratio dropped  low end (Access, Paradox, dBase, FoxPro, Clipper, R:Base)  high end (DB2, Oracle, Sybase, MS SQL Server, Informix, INGRES commercial)

The Relational Model...consists of relations, which are made up of attributes. A relation is a set of columns (attributes) with values for each attribute such that:  Each column (attribute) value must be a single value only.  All values for a given column (attribute) must be of the same type.  Each column (attribute) name must be unique.  The order of columns is insignificant.  No two rows (tuples) in a relation can be identical.  The order of the rows (tuples) is insignificant.

Steps to Relational Implementation 1.Define the database structure to the DBMS  for server and mainframe databases, use Data Definition Language (DDL) in a text file that describes columns of tables, defines indexes, constraints and security restrictions  many PC databases provide a graphical interface to define the database tables  in both cases, the Database Definition Subsystem of the DBMS creates the indexes and metadata 2.Allocation of Media Space  usually unnecessary for PC databases, but performance issues must be considered for server/mainframe dbs 3. Creating the Database Data  import pre-existing data or enter data either through DML (Data Manipulation Language) or forms of the application

Relational Data Manipulation  Four strategies for relational data manipulation:  relational algebra - difficult to use because it is procedural - users must specify not only what they want but how to get it  relational calculus - difficult to learn due to theoretical nature, not used in commercial database processing  transform-oriented languages - non-procedural languages (e.g., SQUARE, SQL, SEQUEL)  graphical interface to Data Manipulation Language (DML)  query-by-example and query-by-form (behind each is a corresponding SQL query) - supported by many PC RDBMS (Lotus’ Approach, MS Access,Wall Data’s Cyberprise DBApp)  application program interface - written in programming languages such as COBOL, Pascal, Perl, C++

Relational DBMS Defined  Logical database model (rather than physical) that represents all data as if they are stored in separate two-dimensional but related tables  Each table consists of single-value data elements describing a common theme among which is one (or more) elements that uniquely describe each record in the table (i.e. no two rows are identical)  Tables are related as long as two tables share a common data element  Information in these tables can be combined on an as-needed basis (flexibility) to get answers to queries and generate complex reports

Requirements of a RDBMS 1.Enforces Integrity rules (a) Entity Integrity - every row must have a unique identifier (primary key) which cannot include null entries (b)Referential Integrity - foreign key must have either a null entry or an entry that matches the primary key value in a table to which it is related primary keyforeign key Parent Table - Table on the one side of a one-to- many relationship. Child Table - Table on the many side of a one-to-many relationship.

Entity Integrity  Elements of a primary key:  It must uniquely identify each record in the table  It must contain unique values  It cannot be null  It cannot be a multi-part field  It should contain the minimum number of fields necessary to define uniqueness  It is not optional whole or in part  It must directly identify the value of each field in the table  Its value can only be modified in rare or extreme cases concatenated primary key

Referential Integrity  Referential integrity is a mechanism that enforces the ties between data in separate tables and prevents them from being broken  Referential integrity minimizes the undesirable likelihood of the existence of a record in the child table for which there is no corresponding record in the parent table - referred to as an orphan (or dangling) record  Prior to setting referential integrity, ensure that  the field used to tie two tables together (the link field) must be a primary key field in the parent table and a foreign key in the child table  the link fields have an identical data type  the two tables are in the same database container

Referential Integrity in MS Access  A value cannot be entered in the foreign key field of the related table if that value doesn't exist in the primary key of the parent table.  A record cannot be deleted from a parent table if matching records exist in a related table.  A primary key value in the parent table cannot be changed, if that record has related records. Determined by MS Access on the basis of primary key settings.

Referential Integrity Options in MS Access Cascade Update Special override of the referential integrity mechanism in order to be able to edit the primary key in the one table; MS Access will automatically make the same change to the foreign key in the child table so the relationship is maintained. Cascade Delete Special override of the referential integrity mechanism to facilitate deleting records in the parent table even when there are related records in the child table. All related records in the child table will automatically be deleted so that there will be no orphan records. Do not use these options unless you realize the full implications of making the selection.

Relationship Integrity is a way of minimizing data errors MS Access On-line Help

Requirements of a RDBMS 2.Supports many of the relational algebraic functions - a collection of operations on relations, resulting in relations Specific relational operators:  select  project  divide  join Set theory operators:  union  intersect  difference  product

Algebraic function: 1. Union Combination of data without repeating common rows; must have equivalent columns as to number and domains (“union compatible”). Provide information on all employees regardless of their position: note that Anne appears only once even though she’s in both tables

Algebraic function: 2. Intersection Identification of rows that are common to two relations; must have equivalent columns as to number and domains. Provide information on employees who have both a salesperson and manager role:

Algebraic Function: 3. Difference Identification of rows that are in one relation and not in another; must have equivalent columns as to number and domains. Provide information on employees who have a salesperson role but do not have a managerial role:

Algebraic Function: 4. Product Adjoining (concatenating) each row in the first relation to each row in the second relation; must have different column names No obvious query; conceptually important because it is used as a building block (Cartesian product) for the join operator.

Algebraic Function: 5. Select Provide information on employees whose salary is at least $2000 Creation of a relation by identifying only rows that satisfy specific conditions Provide information on employees who are based in Tokyo:

Algebraic Function: 6. Project Creates a relation by deleting columns from an existing relation Provide a list of employee names (not all information): Provide names of employees whose office is in Tokyo: Can “nest” (combine) operators (e.g., select, project)

Algebraic Function: 7. Divide Creating a new relation by selecting the rows in one relation that match every row in another relation Who has sold every product?

Algebraic Function: 8. Join Connection of data across relations: natural join (rows are joined when common columns have equal values); outer join (all rows from both tables even if there is no matching column value) and theta join (not covered) Provide the Supplier Name for each product Provide all products and all suppliers, joining where possible