Database Management Systems,

Similar documents
Advance Database Management System

Database Management Systems,

Database Management Systems

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

MIT Database Management Systems Lesson 03: Entity Relationship Diagrams

A Flat file database. Problems with a flat file database (data redundancy)

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E)

Conceptual Data Models for Database Design

The Relational Model

Sample Question Paper

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Chapter 1 SQL and Data

The Relational Model. 3/1/2010 Database Management Systems, Roya Choupani 1

Referential integrity

CONCEPTUAL DESIGN: ER TO RELATIONAL TO SQL

ER to Relational Model. Professor Jessica Lin

B.C.A DATA BASE MANAGEMENT SYSTEM MODULE SPECIFICATION SHEET. Course Outline

Lecture3: Data Modeling Using the Entity-Relationship Model.

COMP Instructor: Dimitris Papadias WWW page:

Database Management Systems MIT Introduction By S. Sabraz Nawaz

Objectives of logical design... Transforming the ERD diagram into relations. Relational database components. Mapping a composite attribute


The Relational Model (ii)

Data about data is database Select correct option: True False Partially True None of the Above

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601

TEACHING & ASSESSMENT PLAN

Represent entities and relations with diagrams

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

Designing a Database Schema

Revised Guidelines for B.A. Programme Semester II Paper: Database Management System (Meeting held on 15 th Jan 2015)

LECTURE 3: ENTITY-RELATIONSHIP MODELING

Logical Database Design. ICT285 Databases: Topic 06

To build students capabilities on data modeling

Chapter 8 Persistence and Database Design

CS430 Final March 14, 2005

Unit I. By Prof.Sushila Aghav MIT

LAB 3 Notes. Codd proposed the relational model in 70 Main advantage of Relational Model : Simple representation (relationstables(row,

Relational Database Systems Part 01. Karine Reis Ferreira

DBMS. Relational Model. Module Title?

Database Systems CSE Comprehensive Exam Spring 2005

Database Management Systems. Chapter 3 Part 2

Debapriyo Majumdar DBMS Fall 2016 Indian Statistical Institute Kolkata

SYSTEM CODE COURSE NAME DESCRIPTION SEM

VIEW OTHER QUESTION PAPERS

CSE 880:Database Systems. ER Model and Relation Schemas

DATABASE DEVELOPMENT (H4)

Database Design and the E-R Model (7.4, )

Relational Databases BORROWED WITH MINOR ADAPTATION FROM PROF. CHRISTOS FALOUTSOS, CMU /615

The Relational Model 2. Week 3

Relational model and basic SQL

Translating an ER Diagram to a Relational Schema

Introduction to Databases

SQL DDL. CS3 Database Systems Weeks 4-5 SQL DDL Database design. Key Constraints. Inclusion Constraints

Database Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process:

The Entity/Relationship (E/R) Model & DB Design. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018

P.G.D.C.M. (Semester I) Examination, : ELEMENTS OF INFORMATION TECHNOLOGY AND OFFICE AUTOMATION (2008 Pattern)

The Relational Model. Roadmap. Relational Database: Definitions. Why Study the Relational Model? Relational database: a set of relations

The Relational Model. Chapter 3

UNIVERSITY OF BOLTON WESTERN INTERNATIONAL COLLEGE FZE BSC (HONS) COMPUTING SEMESTER ONE EXAMINATION 2015/2016 DATABASE THEORY AND PRACTICE

ER modeling. Lecture 4

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

DATABASE MANAGEMENT SYSTEMS

Total No. of Questions : 6] [Total No. of Printed Pages : 2 [3689]-101. P. G. D. C. M. (Semester - I) Examination

E-R Diagram. Bagian I Entity Concept

CSCB20. Introduction to Database and Web Application Programming. Anna Bretscher Winter 2017

2004 John Mylopoulos. The Entity-Relationship Model John Mylopoulos. The Entity-Relationship Model John Mylopoulos

Database Management Systems,

Database Technology Introduction. Heiko Paulheim

Data analysis and design Unit number: 23 Level: 5 Credit value: 15 Guided learning hours: 60 Unit reference number: H/601/1991.

1. Data Model, Categories, Schemas and Instances. Outline

Outline. Databases and DBMS s. Recent Database Applications. Earlier Database Applications. CMPSCI445: Information Systems.

Database Systems ER Model. A.R. Hurson 323 CS Building

Designing a Database Schema

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

Chapter 8 Persistence and Database Design

CS425 Fall 2016 Boris Glavic Chapter 1: Introduction

Data Modeling Using the Entity- Relationship Model Design & Analysis of Database Systems

Chapter 2 ENTITY RELATIONSHIP MODEL

Computer Science Applications to Cultural Heritage. Relational Databases

Relational Databases Overview

CSCC43H: Introduction to Databases

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling

Relational Database Systems I. Introduction

Do not turn over until you are told to do so by the invigilator. Module Contact: Dr. Beatriz de la Iglesia (CMP)

To understand the concept of candidate and primary keys and their application in table creation.

SECTION 1 DBMS LAB 1.0 INTRODUCTION 1.1 OBJECTIVES 1.2 INTRODUCTION TO MS-ACCESS. Structure Page No.

Database Management System

THE COPPERBELT UNIVERSITY

Task: Design an ER diagram for that problem. Specify key attributes of each entity type.

KINGDOM OF SAUDI ARABIA-JAZAN UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION SYSTEMS 221 INFS 3 DATABASE SYSTEMS-1 REVIEW QUESTIONS

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science

Conceptual Data Modeling and the Entity- Relationship Model. Department of Computer Science Northern Illinois University September 2014

Announcements. PS 3 is out (see the usual place on the course web) Be sure to read my notes carefully Also read. Take a break around 10:15am

CS313D: ADVANCED PROGRAMMING LANGUAGE

Chapter 13 XML: Extensible Markup Language

Normalization in DBMS

Course Title: Introduction to Database Management System Course Code: CSIT116 Course Level: UG Course Credits:04 L T P/ S SW/F W

The Relational Model

Transcription:

Database Management Systems Database Design (2) 1

Topics Data Base Design Logical Design (Review) Physical Design Entity Relationship (ER) Model to Relational Model Entity Relationship Attributes Normalization First normal form Second normal form Boyce-Codd normal form 2

Database Design Database design is the process of producing a detailed data model of a database. Database design includes: Determining data to be stored Determining main entities and their attributes Determining relationships between entities Designing a suitable model to store them 3

Logical and Physical Design Logical design is about gathering requirements and converting those requirements into a model. Physical design is the process of converting the logical model into database tables. 4

Converting E-R Model into Relational Model Each entity in an E-R model is converted to a table in relational model. The attributes of the entity become fields of the table Primary key is given by the identifiers of the entity 5

Sample E-R Model 6

Example CREATE Table Employee ( Code Integer PRIMARY KEY, Surname Char(30), Salary Integer, Age Integer ) 7

One-to-One Relationships One-to-one relationships are defined as attributes. e.g. Book ISBN : Each book has only one ISBN and each ISBN represents only one book. ISBN should be an attribute for book. For restricting access to sensitive data, some attributes can be stored in a second table. User and Password have a one-to-one relationship. Password should be an attribute for the user but we generally create a new table as <UsrID,Password> 8

One-to-Many Relationships (1) One-to-many relationships are defined as foreign keys. e.g. An employee is a member of one department A department has many members In employee table define attribute dept to show the department of each employee. dept is a foreign key referring to Department. 9

One-to-Many Relationships (2) If relation has attributes then we have to define it as a table. e.g. The relationship Membership between Employee and Department has start date attribute. The relationship which is defined as a table can store the history of a relationship. The primary keys of both entities and the attributes of the relationship are added to the table 10

Example Create Table Membership ( EmpCode Number references Employee(code), DeptName char(20) references department(name), startdate date, position char(30), PRIMAR KEY ( EmpCode, DeptName, startdate) ) 11

Many-to-Many Relationships All many to many relationships are defined as tables. e.g. Student Course A student takes many courses and a course is taken by many students The primary key of both entities are added to the table <StudentID, CourseCode, Year-Semester, Grade> 12

Recursive Relationships Recursive relationships are defined as a foreign key attribute. e.g. Human < ID, Name, Surname, Birth Date, Gender, Father > Father is a foreign key to table Human (recursive) 13

Ternary Relationships Ternary relationships are defined as a table. The primary key of three tables are included in the table e.g. A client borrows a book from a library entities are: Client, Book, Library Borrow < BookID, ClientID, LibID, Date,..> 14

Composite Attributes Composite attributes are defined as a table The primary key of the composite attribute table is added to the table using it as foreign key. e.g. Address<Street, HouseNumber, PostCode> PostCode is primary key Person <Surname, Age, Sex, PostCode > PostCode is foreign key 15

Normalization Normalization is a method for designing databases. Normalization starts with a pile of data items then puts them in a single table. Next it breaks the table into more tables. Normalization is performed in several stages (normal forms) 16

First Normal Form After gathering data, they are stored in a table. The table is said to be in first normal form if it is flat. e.g. A customer in a banking system performs many transactions in a given date. 17

Converting to First Normal Form 18

Summary Database design is the process of modeling data in an information system. E-R model is converted into relational tables in physical design. Entities and many-to-many relationships, and one-to-many relationships with attribute in E-R model are converted to tables. Normalization is used a database design method in logical and physical design. 19

Questions? 20

Term Projects Create a list of data items that will be stored in your project. For example, in library project, you may ask the library. Items need not be put in any order. Find and list all entities. Find the attributes of entities (the attributes are data items that you already found) Define restrictions for each attribute (e.g. Number of digits in student ID, range of values for Age attribute, ) 21

Term Projects Define relationships between entities and their types (Explain how you found the type of the relationships) Create Entity-Relationship (ER) model of your database. Create necessary tables for your database. Show in which normal forms your tables are. 22

Term Projects Design necessary queries based on the requirements of the project Write necessary SQL commands to create tables and queries Write a report for your project (put all steps explained above) Implement your project using a DBMS (Oracle, MS-SQL, MySQL, MS-Access, ) 23

Term Projects Evaluation Gathering data items (10) Defining entities, the attributes of the entities, the restrictions on the attributes (15) Relationships (5) ER model (5) Normalization (10) Queries (15) Implementation (15) Report (10) Presentation (15) (is necessary) 24