Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.

Slides:



Advertisements
Similar presentations
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
Advertisements

Chapter 3 : Relational Model
The Relational Database Model
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Modeling the Data: Conceptual and Logical Data Modeling
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Concepts of Database Management Sixth Edition
Chapter 3 An Introduction to Relational Databases.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
1 Lecture 28 Introduction to Databases II - Database Design, SQL and JDBC Overview  Objectives of this Lecture  Logical Database Models  ER Model, Hierarchical.
Chapter 5 The Relational Database Model: Introduction
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
BIS310: Week 7 BIS310: Structured Analysis and Design Data Modeling and Database Design.
Database Architecture The Relational Database Model.
The Relational Database Model
1 Relational model concepts Key constraints Referential integrity constraint Steen Jensen, autumn 2013.
Database Design Concepts
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
CS370 Spring 2007 CS 370 Database Systems Lecture 7 The Relational model.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Module Title? DBMS E-R Model to Relational Model.
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
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
RAJIKA TANDON DATABASES CSE 781 – Database Management Systems Instructor: Dr. A. Goel.
Concepts and Terminology Introduction to Database.
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
Page 1 Topic 4 Relational Databases CPS510 Database Systems Abdolreza Abhari School of Computer Science Ryerson University.
DBSQL 3-1 Copyright © Genetic Computer School 2009 Chapter 3 Relational Database Model.
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.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An = {(x1, x2, x3, …, xn): xi  Ai} R  A1  A2.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
 2001 Prentice Hall Business Publishing, Accounting Information Systems, 8/E, Bodnar/Hopwood A field may be a single character or number, or it.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.
Fanny Widadie, S.P, M.Agr 1 Database Management Systems.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
IE 423 – Design of Decision Support Systems Data modeling and database development.
IFS310: Module 6 3/1/2007 Data Modeling and Entity-Relationship Diagrams.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Relational Theory and Design
WXGE 6101 DATABASE CONCEPTS & IMPLEMENTATIONS. Lesson Overview The Relational Model Terminology of relational model. Properties of database relations.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
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 13.3: Databases Invitation to Computer Science, Java Version, Second Edition.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Database Systems Logical Data Modelling Tutor:Ian Perry Tel: Web:
Howard Paul. Sequential Access Index Files and Data File Random Access.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Microsoft Access 2010 Chapter 11 Database Design.
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. A database is a collection of information organized to provide efficient retrieval. The collected information.
Chapter 4 The Relational Model Pearson Education © 2009.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
By ILTAF MEHDI (MCS, MCSE, CCNA) 1 Remember: Examination is a chance not ability. 6/12/2016.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
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.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Databases Chapter 16.
Database Concepts.
Data Base System Lecture 6: Relational Model
Design tools and techniques for a relational database system
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Chapter 3 The Relational Model
Presentation transcript:

Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total Sessional Terminal Exam Final Evaluation By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 1 Remember:

Chapter NoChapter NamePage No 1. Database Foundation OR An Overview of Database Management System (DBMS) 2.Semantic Modeling OR Entity Relationship Model (ERD) 3.An introduction to Relational Database 4.Normalization 5.Relational Algebra 6.An Introduction to Structured Query Language (SQL) By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 2 Course Contents

COURSE INSTRUCTOR: ILTAF MEHDI By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 3 Chapter No: 03

 Def:“A data model is a representation of data about entities, events, activities and their relationship”.  A data model represents an organization itself.  The purpose of data model two-fold: First “to represent data” and second “to be understandable”.  If a data model accurately and completely represent required data and is understandable then it can be used in some application. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 4

There are basically three types of data model: 1) Hierarchical Data Model 2) Network Data model 3) Relational Data model By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 5

1) Relational Data Model:  It also called Relational Database Model.  The Relational Data Model is the most recent and best of the three database models.  It was developed by C.F Codd in  This model represents database as a set of normalized relations.  “In Relational Model data are represented in the form of tables with rows and columns”. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 6

Deptt-NoDeptt-NameDeptt- Location D100ITWest D101ManagementEast D102EnglishSouth By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 7 Emp-NoEmp- Name Emp- Phone # Deptt-No E10Mehdi336D100 E11Danish448D101 E12Nasir500D102 DEPARTMENTEMPLOYEE Relational Database Model Notice that there is no physical data structure representing relationship between two tables (relations). Instead relationships are represented logically by the values that are stored within table’s columns. For example: In above figure, the Department-Number (Deptt-No) for each Employee is stored in Employee table.

The above tables have the following properties: 1. Each column contained values about some attribute. 2. Each column has distinct name. 3. Each row of a table must be unique, means, that no two rows have the identical data. 4. Each row in the relation is called TUPLE. 5. Each column in the relation is called DOMAIN. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 8

6. Record:  “The combination of more than one fields about a single entity is called record of that entity”. For example:  The record of STUDENT may have fields Roll-No, Name, Father Name, Gender, Address, Program and Marks. Then this combination of fields is called the record of a particular STUDENT. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 9 Roll-NoNameF-NameGenderAddressProgramMarks 100AbdullahZainMaleKabulBCS40 101SpogmayIqbalFemaleKabulBCS47 1 st RECORD 2 nd RECORD FIELDS STUDENT FILE

7. File or Data File:  “The collection of more than one related records is called a file or data file”.  All the records of the should be of the same type.  In the above File, two logical records about STUDENT are shown. 8. Degree of file:  “The total number of the columns in a file is called Degree of a file”. 9. Cardinality:  The total number of rows or records in a file is called cardinality. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 10

By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 11 Roll-NoNameF-NameGenderAddressProgramMarks 100AbdullahZainMaleKabulBCS40 101SpogmayIqbalFemaleKabulBCS47 Two Records SEVEN FIELDS Degree of File: 07 Cardinality: 02 STUDENT Relation Properties of Relation

The Relational Data Model has several advantages but some of them are given below: 1) Implementation Independence:  R.D.M logically represents all relationship implicitly and completely. 2) Terminology:  The R.D.M has developed with its own set of terminology. 3) Logical Key Pointer:  The R.D.M uses primary and secondary keys to represent relationship between two relations. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 12

 Def: “a key is a data item which is used to identify a record or relation”. OR  An attribute through which we can access an entity within entity class”. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 13

There are different types of keys which are given below: 1. Super Key 2. Candidate Key 3. Primary Key 4. Atomic Key 5. Concatenated Key 6. Compound Key 7. Secondary Key 8. Foreign Key By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 14

1) Super Key: “An attribute or combination of attributes that can uniquely identify an entity is called super key”. For Example: consider the STUDENT relation; STUDENT (st-no, st-name, st-age, st-gender etc)  A super key may contain some extra attributes that are not necessary to uniquely identify an entity. i.e. { st-no, st-name, st-age }  In-fact a super key can be: { Primary-key + Non-key attribute } By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 15

2) Candidate Key:  “An attribute or combination of attributes that uniquely identifies each instances of an entity is called Candidate Key”.  For Example: consider the EMPLOYEE relation;  EMPLOYEE (NIC-No, Name, Address etc)  Here NIC-No and Name is a super key that contain extra attributes that is not necessary for unique identification. So it is not a candidate key. But NIC-No is a Candidate Key.  An entity may be uniquely identified by more than one candidate keys. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 16

3) Primary Key:  Def: “A primary key is a key that have been selected as an identifier for an entity type”.  It is also called identifier. For example: Consider the EMPLOYEE relation; EMPLOYEE (Emp-No, Emp-Name, Emp-Address)  If we select Emp-No as an identifier then it is Primary Key. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 17

4) Atomic Key:  Def: “A Primary Key is called atomic key or simple key when it consists of a single attribute to identify a record or relation”.  For Example: Consider the STUDENT relation; STUDENT (St-ID, St-Name, St-F/Name,St-Address)  St-ID is atomic key for the STUDENT relation By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 18

5) Concatenated Key:  Def: “The combination of two or more keys to uniquely identify a record is called Concatenated Key”. For Example: Consider the STUDENT relation; STUDENT (class-no, name, address, class)  “We have student file of Computer Science Department that contain information about Previous and Final students”. In this case class-no can’t uniquely identify a student because there may be duplication of students for class i.e. Previous and Final. So both class-no and class can be used as Primary Key in this case. Such a key is called Concatenated Key. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 19

6) Compound Key:  Def: “A Compound Key is a Primary Key that consists of more than one attribute and every attribute in the key is Primary key in some other relation”.  For Example: Consider the relation; ORDER-LINE (order-no, product-no, quantity, date)  So the primary key consists of order-no and product-no. But order-no is primary key in ORDER relation and product-no is primary key in PRODUCT relation. So it is a Compound Key. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 20

7) Secondary Key:  “A secondary key is a data item that does not uniquely identify a record but identifies a number of records in a set that share some common property ”. For Example: Name, Address, Age etc are the examples of Secondary Key.  Now consider the Query: So based on secondary key “Age” this query will select all students whose age is 20. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 21 Select * from student where Age=‘20’ ;

8) Foreign Key:  Def: “An attribute that appear as non-key in one relation but primary key in another relation is called Foreign Key”.  For Example: Consider the relations; DEPARTMENT (Deptt-No, Deptt-Name, Location) TEACHER (T-No, T-Name, Deptt-No )  Here Deptt-No is a foreign key because it act as primary key in DEPARTMENT and as non-key attribute in TEACHER relation. By ILTAF MEHDI (MCS, MCSE, CCNA) An introduction to Relational Database 22