RAJIKA TANDON DATABASES CSE 781 – Database Management Systems Instructor: Dr. A. Goel.

Slides:



Advertisements
Similar presentations
The Relational Model Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Advertisements

Relational Database Design UNIT II 1. 2 Advantages of Using Database Systems Centralized control of a firm’s data Redundancy can be reduced (avoid keeping.
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Relational Model (CB Chapter 4) CPSC 356 Database Ellen Walker Hiram College.
Relational Databases Chapter 4.
IS605/606: Information Systems Instructor: Dr. Boris Jukic
The Relational Model System Development Life Cycle Normalisation
Monash University Week 7 Data Modelling Relational Database Theory IMS1907 Database Systems.
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Oakland University School of Business Administration
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
Data Management Design
The Relational Database Model:
1 Minggu 2, Pertemuan 3 The Relational Model Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
The Relational Database Model. 2 Objectives How relational database model takes a logical view of data Understand how the relational model’s basic components.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
1 Pertemuan 04 MODEL RELASIONAL Matakuliah: >/ > Tahun: > Versi: >
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.
Relational Database Management System A type of database in which records are stored in relational form is called relational database management system.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Database Architecture The Relational Database Model.
The Relational Database Model
CSC271 Database Systems Lecture # 6. Summary: Previous Lecture  Relational model terminology  Mathematical relations  Database relations  Properties.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 4 The Relational Model Pearson Education © 2014.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Relational Model Session 6 Course Name: Database System Year : 2012.
Chapter 4 The Relational Model.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
Content Resource- Elamsari and Navathe, Fundamentals of Database Management systems.
Chapter 3 The Relational Model. 2 Chapter 3 - Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between.
10/17/2012ISC471/HCI571 Isabelle Bichindaritz 1 Technologies Databases.
Relational Databases Database Driven Applications Retrieving Data Changing Data Analysing Data What is a DBMS An application that holds the data manages.
Copyright © Curt Hill The Relational Model of Database Basic organization and terms.
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 The Relational Model. 2 Why Study the Relational Model? v Most widely used model. – Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. v “Legacy.
Relational Database. Database Management System (DBMS)
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
IS 325 Notes for Wednesday August 28, Data is the Core of the Enterprise.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
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.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
12/2/2015CPSC , CPSC , Lecture 41 Relational 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.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
SQL constrains and keys. SORTED RESULTS Sort the results by a specified criterion SELECT columns FROM tables WHERE predicates ORDER BY column ASC/DESC;
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
Logical Database Design and Relation Data Model Muhammad Nasir
Chapter 4 The Relational Model Pearson Education © 2009.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Translation of ER-diagram into Relational Schema
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
The Relational Model Transparencies
Database solutions Chosen aspects of the relational model Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Database Design: Relational Model
Chapter 4 The Relational Model Pearson Education © 2009.
INSTRUCTOR: MRS T.G. ZHOU
Presentation transcript:

RAJIKA TANDON DATABASES CSE 781 – Database Management Systems Instructor: Dr. A. Goel

WHY DATABASE ? TRADITIONAL METHOD: In the traditional approach, information is stored in flat files which are maintained by the file system of OS. Application programs go through the file system to access these flat files.

WITH DATABASE DBMS acts as a layer of abstraction on top of the File system. You might have observed that, for interacting with the file system, we were using high level language functions for example, the ‘c++’ file handling functions. For interacting with the DBMS we would be using a Query language called SQL.

ADVANTAGES OF A DBMS  Data independence  Reduction in data redundancy  Better security  Better flexibility  Effective data sharing  Enforces integrity constraints  Enables backup and recovery Users and application programs need not know exactly where or how the data is stored in order to access it. Proper database design can reduce or eliminate data redundancy and confusion. Support for unforeseen (ad hoc) information requests are better supported - better flexibility. Data can be more effectively shared between users and/or application programs. Data can be stored for long term analysis (data warehousing).

DATA MODEL A conceptual tool used to describe  Data  Data relationships  Data semantics  Consistency constraints

RELATIONAL MODEL  Data is viewed as existing in two dimensional tables known as relations  A relation (table) consists of unique attributes (columns) and tuples (rows)  Tuples are unique  Sometimes the value to be inserted into a particular cell may be unknown, or it may have no value. This is represented by a NULL  Null is not the same as zero, blank or an empty string  Relational Database: Any database whose logical organization is based on relational data model.  RDBMS: A DBMS that manages the relational database.  Note: Though logically data is viewed as existing in the form of two dimensional tables, actually, the data is stored under the file system only. The RDBMS provides an abstraction on top of the file system and gives an illusion that data resides in the form of tables.

KEYS Candidate key An attribute, or group of attributes, that is sufficient to distinguish every tuple in the relation from every other one. A candidate key is all those set of attributes which can uniquely identify a row. However, any subset of these set of attributes would not identify a row uniquely. Primary Key The candidate key that is chosen to perform the identification task is called the primary key. Every tuple must have, by definition, a unique value for its primary key. A primary key which is a combination of more than one attribute is called a composite primary key.

KEYS Alternate Key The candidate key that is chosen to perform the identification task is called the primary key and the remaining candidate keys are known as alternate keys. No of Alternate Keys = No of Candidate Keys - 1 Super Key Any superset of a candidate Key is a super key. An attribute, or group of attributes, that is sufficient to distinguish every tuple in the relation from every other one. For example, a Customer Id,Customer Name (together) can uniquely distinguish each tuple of the relation from the other ones. Thus it satisfies the property of uniqueness. Also Customer Id can alone distinguish each tuple of the relation from the others. Thus it too, satisfies the property of uniqueness. Each candidate key is a super key.

KEYS Foreign Key A set of attribute (s) whose values are required to match values of a Candidate key in the same or another table. A foreign key is a “copy” of a primary key that has been exported from one relation into another to represent the existence of a relationship between them. DEPT EMP (Parent /Master/Referenced Table)(Child /Referencing Table) Foreign key values do not (usually) have to be unique. Foreign keys can also be null. DeptNoDeptName DN1EECS DN2LLL EmpNoEmpNameEmpDeptNo 4001ESibertDN1 4002GBulmanDN2 4003PaulNull 4004AGoelDN1

KEYS More About Foreign Key  Foreign key values do not (usually) have to be unique.  Foreign keys can also be null.  A Foreign Key is a set of attributes of a table, whose values are required to match values of some Candidate Key in the same or another table.  The constraint that values of a given Foreign Key must match the values of the corresponding Candidate Key is known as Referential constraint.  A table which has a Foreign Key referring to its own Candidate Key is known as Self-Referencing table.

KEYS Example of a self-referencing table Employee Table E# PK EName DateofJoining SkillSet Spouse FK Consider employees who are also a couple The primary key field itself will become foreign key in the same table Employee( E#, EName,…Spouse)

KEYS Non-Key Attributes The attributes other than the Candidate Key attributes in a table/relation are called Non-Key attributes. These attributes do not participate in the Candidate key.

EXERCISE Given a relation R(A,B,C,D) and the following attribute(s) can uniquely identify the records of relation R. 1) A 2) A,D 3) C,D Identify the following in relation R ? Candidate Key(s) Primary Key Alternate Key Key attribute(s) Non-key attribute(s)

THANK YOU !!