11 3 / 12 CHAPTER Databases MIS105 Week-9/ Lec02 Irfan Ahmed Ilyas.

Slides:



Advertisements
Similar presentations
Table Relationships RDBM. Prof. Leighton2 Establishing Table Relationships RDBMS allow us to establish relationships among tables Have a primary key in.
Advertisements

SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Monash University Week 7 Data Modelling Relational Database Theory IMS1907 Database Systems.
The Database Approach u Emphasizes the integration of data across the organization.
SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
BA271 Week 7 Lecture Building the database Dave Sullivan.
Introduction to Databases CIS 5.2. Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
11 3 / 12 CHAPTER Databases MIS105 Lec14 Irfan Ahmed Ilyas.
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
Concepts of Database Management Sixth Edition
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
5 Chapter 5 Structured Query Language (SQL1) Revision.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Computer Science & Engineering 2111 Introduction to Database Management Systems Relationships and Database Creation 1 CSE 2111 Introduction to Database.
Define Table Relationships—1 of 3 One of the most powerful features of a relational database management system, such as Access, is its ability to define.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Database Lecture # 1 By Ubaid Ullah.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
Database Management System Lecture 6 The Relational Database Model – Keys, Integrity Rules.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
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.
IE 423 – Design of Decision Support Systems Database development – Relationships and Queries.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
Exploring Microsoft Access Chapter 6 Many-to-Many Relationships: A More Complex System.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Microsoft Access 2013 ®® Tutorial 9 Using Action Queries and Advanced Table Relationships.
3 / 12 Databases MIS105 Lec13 Irfan Ahmed Ilyas CHAPTER Prepared By:
Maintaining a Database Access Project 3. 2 What is Database Maintenance ?  Maintaining a database means modifying the data to keep it up-to-date. This.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Microsoft Access 2010 Chapter 3 Maintaining a Database.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
3 / 12 CHAPTER Databases MIS105 Week-10/ Lec02 Irfan Ahmed Ilyas.
Lesson 2: Designing a Database and Creating Tables.
1 CHƯƠNG 4 Creating Relational Databases Understanding Table Relationships Example: This database tracks customers and their orders in two separate.
Exploring Office Grauer and Barber 1 One-to-Many Relationships: Subforms and Multiple-Table Queries(Wk7)
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Session 1 Module 1: Introduction to Data Integrity
9-1 © Prentice Hall, 2007 Topic 9: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
Exploring Microsoft Access Chapter 5 One-to-Many Relationships: Subforms and Multiple Table Queries.
Database Relationships Objective 5.01 Understand database tables used in business.
11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Database Planning Database Design Normalization.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
CSCI-235 Micro-Computers in Science Databases. Database Concepts Data is any unorganized text, graphics, sounds, or videos A database is a collection.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
CIS 155 Table Relationship
Databases and Information Management
Databases and Information Management
Presentation transcript:

11 3 / 12 CHAPTER Databases MIS105 Week-9/ Lec02 Irfan Ahmed Ilyas

11 02/3/2002Prepared By: Irfan Ilyas2 Lecture Objectives Data Integrity Constraints FOR Accurate Data Entry –Single Table Integrity Constraints –Referential Integrity Constraints Significance of Table Relationships –Controlling Referential Integrity –Building Queries Referential Integrity Maintenance Approaches –One-to-One Relationship Maintenance –One-to-Many Relationship Maintenance

11 02/3/2002Prepared By: Irfan Ilyas3 Types of Data Integrity Constraints Single Table Constraints [ Entity Integrity ] Data type constraints –Field can only accept numbers or characters. –DBMS Implementation: Specifying field data type/ size. Primary key constraints –No two records have the same value in the primary key field. –No primary key value in any record should be left blank (empty). –DBMS Implementation: Specifying table’s primary key. Field value constraints –The value must be satisfying some criteria. –For example, salary can not be less than $100 etc. –DBMS Implementation: Specifying field validation rule.

11 02/3/2002Prepared By: Irfan Ilyas4 …. Data Integrity Constraints Related Table Constraints [ Referential Integrity ] –Specifies that a record in one table must be related to the records in other tables, thus exhibiting a particular relationship between the two tables –For example, In a University database STUDENT, COURSE, DEPARTMENT, DORM Each record in STUDENT is related with the records in COURSE, DORM and DEPARTMENT The details of this relationship can be understood by the surrounding (university) environment.

11 02/3/2002Prepared By: Irfan Ilyas5 Relationship Types Types of Relationships (in real life situations) –One to one (1:1) relationship A record –in the source file must have zero or only one record in the related file. –in the related file must have only one record in the source file. –DBMS Implementation: Establishing Relationship –One to many (1:M) relationship A record –in the source file must have zero or one or many records in the related file. –in the related file must have only one record in the source file. –DBMS Implementation: Establishing Relationship DORM STUDENTDEPARTMENT STUDENT

11 02/3/2002Prepared By: Irfan Ilyas6 … Relationship Types Many to many (M:M) relationship –A record –in the source file must have zero or one or many records in the related file. –in the related file must have zero or one or many records in the source file. –DBMS Implementation: »The M:M relationship is decomposed into two 1:M relationships »A third table is used as an intermediate place (many table) for data records, linked with both one-tables STUDENT COURSESTUDENT GRADE COURSE

11 02/3/2002Prepared By: Irfan Ilyas7 Relationship Significance Significance of defining Relationships –Implementation of Integrity constraints Any attempt of entering invalid data values will be checked/ rejected automatically by the DBMS. However, it can not check all possible constraints. –For example, a grade letter A entered wrongly as C cannot be checked but entered as X (invalid entry for grades) can be rejected. –More efficient/ accurate data retrieval for Queries For example, student grade list query needs data records from three tables: STUDENT, GRADE, COURSE Established relationships will make the retrieval efficient and accurate.

11 02/3/2002Prepared By: Irfan Ilyas8 Requirements for Establishing A Relationship Field Repetition –A field (primary key) from one-table is repeated in many-table as a foreign key. –The fields should be the same in data type and size. –The names of the fields could be different in each table.

11 02/3/2002Prepared By: Irfan Ilyas9 …Requirements for Establishing A Relationship

11 02/3/2002Prepared By: Irfan Ilyas10 Referential Integrity Maintenance Requirement (1:1 Relationships) –Each record in source-table should have zero or one records in related-table. –Each record in related-table must have a corresponding record in source-table. 1:1 Example: DORM STUDENT

11 02/3/2002Prepared By: Irfan Ilyas11 …Referential Integrity Maintenance (1:1) Related Table Changes –Deletion requests in related-table are always acceptable. –Modification requests in many-table are accepted when foreign key is not touched. rejected when a value is used in the foreign key (linked field) which doesn’t exist in one-table.

11 02/3/2002Prepared By: Irfan Ilyas12 …Referential Integrity Maintenance Source Table Changes –Deletion requests For a record which has no related record in the related table - Accepted For a record which has related record in the related table –Approach#1: Rejected –Approach#2: Accepted, with the related record deleted automatically. –Modification requests Primary key value is not touched – accepted. Primary key value is changed. –For a record which doesn’t have a related record in the destn table - Accepted –For a record which has a related record in the destn table »Approach#1: Rejected »Approach#2: Accepted, with the related record updated automatically.

11 02/3/2002Prepared By: Irfan Ilyas13 …Referential Integrity Maintenance Requirement (1:M Relationships) –Each record in one-table should have zero or many records in many-table. –Each record in many-table must have a corresponding record in one-table. 1:M Example: DEPT STUDENT

11 02/3/2002Prepared By: Irfan Ilyas14 … Referential Integrity Maintenance Many-table changes. –Deletion requests in many-table are always acceptable. –Modification requests in many-table are accepted when foreign key is not touched. rejected when a value is used in the foreign key (linked field) which doesn’t exist in one-table.

11 02/3/2002Prepared By: Irfan Ilyas15 … Referential Integrity Maintenance One-table changes. –Deletion requests For a record which has no related record in the many table -Accepted For a record which has related record in the many table –Approach#1: Rejected –Approach#2: Accepted, with all related records deleted automatically. –Modification requests Primary key value is not touched – accepted. Primary key value is changed. –For a record which has no related record in the many table -Accepted –For a record which has related record in the many table »Approach#1: Rejected »Approach#2: Accepted, with all related records deleted automatically.

11 02/3/2002Prepared By: Irfan Ilyas16