Relational Database. I. Relational Database 1. Introduction 2. Database Models 3. Relational Database 4. Entity-Relationship Models 5. RDB Design Principles.

Slides:



Advertisements
Similar presentations
The Relational Database Model:
Advertisements

Ch1: File Systems and Databases Hachim Haddouti
Accounting Databases Chapter 2 The Crossroads of Accounting & IT
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
Concepts of Database Management Seventh Edition
Implementing an REA Model in a Relational Database
Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-1.
Databases and Database Management Systems
Compe 301 ER - Model. Today DBMS Overview Data Modeling Going from conceptual requirements of a application to a concrete data model E/R Model.
Database Relationships Objective 5.01 Understand database tables used in business.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Relational Database Need to Knows. What is a database? Data - is just a pile of numbers or stats. A business "organises" the data to be meaningful and.
Chapter 6 Physical Database Design. Introduction The purpose of physical database design is to translate the logical description of data into the technical.
1 DATABASE TECHNOLOGIES BUS Abdou Illia, Fall 2007 (Week 3, Tuesday 9/4/2007)
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
ITOM 2308 Introduction to Databases Review Access Database Corporate Case Study ITOM 2308 Class 81.
1 California State University, Fullerton Chapter 7 Information System Data Management.
Chapter 1Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Introduction to Accounting Information Systems
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
Introduction to SQL Steve Perry
STORING ORGANIZATIONAL INFORMATION— DATABASES CIS 429—Chapter 7.
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Concepts and Terminology Introduction to Database.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
1 n 1 n 1 1 n n Schema for part of a business application relational database.
Implementing an REA Model in a Relational Database
Enhanced Guide to Oracle8i
Concepts of Database Management Sixth Edition Chapter 6 Database Design 2: Design Method.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Relational Database. Database Management System (DBMS)
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 7 Storing Organizational Information - Databases.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Implementing an REA Model in a Relational Database
Fanny Widadie, S.P, M.Agr 1 Database Management Systems.
Introduction to Database using Microsoft Access 2013 Part 7 November 19, 2014.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
Chapter 13 Designing Databases Systems Analysis and Design Kendall & Kendall Sixth Edition.
Relational Theory and Design
GIS Data Models GEOG 370 Christine Erlien, Instructor.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
INTRODUCTION lecture1 1. Data base concept Data is a meaningless static value. What does 3421 means? Information is the data you process in a manner that.
Lesson 2: Designing a Database and Creating Tables.
Planning & Creating a Database By Ms. Naira Microsoft Access.
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Lection №4 Development of the Relational Databases.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
IS 320 Notes for April 15, Learning Objectives Understand database concepts. Use normalization to efficiently store data in a database. Use.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” MODULE 5 : Part 1 INTRODUCTION TO DATABASE.
Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-1.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
CSCI-235 Micro-Computers in Science Databases. Database Concepts Data is any unorganized text, graphics, sounds, or videos A database is a collection.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
© 2017 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner.
Databases and DBMSs Todd S. Bacastow January
Databases Chapter 16.
Introduction lecture1.
Introduction to Database Management System
Presentation transcript:

Relational Database

I. Relational Database 1. Introduction 2. Database Models 3. Relational Database 4. Entity-Relationship Models 5. RDB Design Principles

1. Introduction Database Is a collection of related data Is persistent Database Management System Software system to add, delete, search, and modify the data in the DB To provide various ways to view the data in the DB

2. Database Models Flat Database Hierarchical DB Network DB Relational DB

Flat Database Flat Database (Library DB) Redundancy Publisher name is repeated Publisher phone number is repeated Author phone is repeated If publisher address is included, … ? Update Anomalies To modify publisher phone, all need to be modified

Insertion Anomaly A new publisher, with no data about book, author, and other details which are not available, cannot be included. Deletion Anomaly If a book is deleted, its publisher data, or author data, can also be eliminated (e.g., last book in the list)

Solution Break up Flat-file DB into Separe Tables TablesTables (Library DB)

Hierarchical DB Model Agents Agency Database PaymentsEngagements Schedules Entertainers Clients (This and remaining slides on DB Models are adapted from Database Design for Mere Mortals, Michael Hernandez, Addison Wesley, 1999) Back to Ref Ing

Hierarchical DBM Characteristics One table acts as a root of an inverted tree; other tables are branches Each child table may have only one parent table Each parent table may have many child tables To access any data, must start at root table

Hierarchical DBM Advantages & Disadvantages Advantages: Data retrieve is fast, because table structure is explicitly linked Data retrieve is fast, because table structure is explicitly linked Referential integrity is built in Disadvantages: Difficult to store data in child table when no corresponding record exists in parent tables. E.g., a new entertainer cannot be entered in the DB until a specific Agent is assigned Difficult to store data in child table when no corresponding record exists in parent tables. E.g., a new entertainer cannot be entered in the DB until a specific Agent is assigned Difficult to model complex relationships Difficult to add new tables

Referential Integrity Each record in a child table is linked to an existing record in the parent table. E.g., every Payment record is associated with a particular Client.E.g., every Payment record is associated with a particular Client. If a record is deleted in a parent table,all associated record in child tables are also deleted. E.g., If a particular Client record is deleted, all related records in Payments and Engagements are deleted—no orphans.E.g., If a particular Client record is deleted, all related records in Payments and Engagements are deleted—no orphans.

Network Database Model Agents Agency Database Musical StylesEngagementsPayments Clients Entertainers representsmanages performs schedulesmakesplays

Network DBM Characteristics Invented to address problems with the Hierarchical DB Model A child table can have more than one parent table Can go up or down the structure. E.g., to answer “Who was the agent that booked a particular engagement?”, start with Engagements, Clients, then to Agents.

Relational Database Collection of tables e.g., books, authors, publishers, clients Each cell in a table is atomic i.e., no formulas, pointers, but single data item Tables are linked by common values in selected columns i.e., not by pointers Books Table Publishers Table

Basic Terminology Data & Information These are data values Kashimata 25 October This is information Customer’s last Name: Kashimata Age: 25 Birthday: October 31 Savings Account Balance: $25,000

Basic Terminology Null Null, zero, and blank Age = Null age is undefined Age = 0 age is 0 MiddleName = Null middle name is undefined MiddleName = “” person has no middle name MiddleName = “ “ no middle name, takes up 1 byte

Basic Terminology Table, Record, Field

Basic Terminology Table Table (Books Table)(Books Table) Represents an entity (category) of objects with its (relevant) attributes Consists of rows (records) and columns (fields) In the Books table, each record is an instance of the Books category. Each field represents an attribute

Basic Terminology Attributes (fields) To provide specific information about entity To help identify individual entities--e.g., ISBN for books, SSN for employee, Sales_ID for sales. To describe relationship between entity entities in different entity classes For example...

Your Turn. Identify Attributes.. Entity Classes for School Database Students Faculty Staff Buildings Rooms Course Class

Identify Attributes... Entity Classes For a Bank Database Customers Account Employee Transaction

Basic Terminology Keys Superkey Set of attributes to identify a record uniquely in a set--e.g., to distinguish one book from all others. ISBN, ISBN+TITLE, ISBN+TITLE+AUTHOR Key or Candidate Key Minumum superkey. E.g., ISBN Primary Key A Key that is chosen for a particular table

Primary Key Employee Class FirstName LastName SSN PhoneNumber DateOfBirth Candidate Key SSN FirstName +LastName + DateOfBirth ? + DateOfBirth Primary Key SSN

Types of Relationships (Library DB) How are the tables associated with each other, so that information can be extracted from multiple tables? Publishers Authors Books

Types of Relationships 1 to many (most common) A publisher may publish many books, but each book may have only one publisher A publisher may publish many books, but each book may have only one publisher may to many (undesirable) A book may be written by many authors, and an author may write many books. A book may be written by many authors, and an author may write many books. 1 to 1 (not as common) One author has at most one secretary, and each secretary works for only one author One author has at most one secretary, and each secretary works for only one author

One-To-Many Relationship One record in Publishers can be related to many records in Books But, each record in Books can be associated with only one record in Publishers PublishersBooks ∞ 1 PublishersBooks 1 1

Many-to-Many Relationship One record in Authors can be related to many records in Books And, each record in Books can be associated with many records in Authors AuthorsBooks ∞ 1 AuthorsBooks ∞ 1

One-to-One Relationship One record in Authors can be related to only one record in Secretaries And, each record in Secretaries can be associated with only record in Authors AuthorsSecretaries 1 1 Authors 1 1 Secretaries

Example Database Type Library Tables Books Publishers One-to-Many Relationship? Yes Why?

Example Database Type Order Tracking Tables Customers Orders One-to-Many Relationship? Yes Why?

Example Database Type School Scheduling Tables Classes Students One-to-Many Relationship? No (Many-to-Many) Why?

Data Integrity Table-level integrity E.g., no duplicate records (by defining a primary key) Field-level integrity E.g., do all “State” field require 2 characters? Each field contains a single atomic value? (e.g., Author field should not contain 2 authors Relationship-level integrity E.g., no many-to-many relationships Prevent “orphans.” e.g., if a publisher record is deleted, a book record is left without a publisher.