Transforming ER to Relational Schema

Size: px
Start display at page:

Download "Transforming ER to Relational Schema"

Transcription

1 Transforming ER to Relational Schema Transformation of ER Diagrams to Relational Schema ER Diagrams Entities (Strong, Weak) Relationships Attributes (Multivalued, Derived,..) Generalization Relational Schema Relations Attributes (Atomic) 1. Removing multivalued/composite attributes 2. Removing generalization 3. Removing weak entities 4. Transforming entities 5. Transforming relationships

2 Relations for the Staff View of DreamHome Remove Multi-Valued/Composite Attributes

3 Remove Generalization Hierarchies Owner ownerno {PK} address telno type fname lname bname btype contactname PrivateOwner ownerno {PK} address telno fname lname BusinessOwner ownerno {PK} address telno bname btype contactname Transforming Entities Create a relation that includes all simple attributes of that entity. For composite attributes, include only constituent simple attributes. Staff (staffno, fname, lname, position, sex, DOB) Primary Key (staffno)

4 Many-to-Many Binary Relationship Many-to-One Binary Relationship

5 Relations for the Staff View of DreamHome Normalization Make a relation schema normal: A single relation stores a single type of information. Data redundancy leads Insertion Anomaly Deletion Anomaly Update Anomaly as well as storage waste

6 Functional Dependency Normalization (1NF to BCNF) 2NF PropertyInspection (propertyno, idate, itime, comments, staffno, sname, carreg) Property (propertyno, paddress) 3NF Staff (staffno, sname) PropertyInspect (propertyno, idate, itime, comments, staffno, carreg) BCNF: For A B, A is a superkey or A B BCNF StaffCar (idate, staffno, carreg) Inspection (propertyno, idate, itime, comment, staffno)

7 Relationship Between Normal Forms UNF 1NF: Atomic attribute values 2NF: 1NF & No partial dependency 3NF: 2NF & No transitive dependency BCNF: 1NF and only superkey dependency Objectives of SQL Ideally, database language should allow user to: create the database and relation structures; perform insertion, modification, deletion of data from relations; perform simple and complex queries. SQL consists of two major components: A DDL for defining database structure. A DML for retrieving and updating data. Until SQL3, SQL did not contain flow of control commands. Cf. Flow of control: sequence, branch, loop, (function call)

8 Standard English Words in SQL 1) CREATE TABLE Staff(staffNo VARCHAR(5), lname VARCHAR(15), salary DECIMAL(7,2)); 2) INSERT INTO Staff VALUES ( SG16, Brown, 8300); 3) SELECT staffno, lname, salary FROM Staff WHERE salary > 10000; Used by application developers, DBAs, management, and even end users. ISO SQL standards vs. Vendor-specific features ISO SQL Data Types

9 More on Data Types Exact Numeric: NUMERIC, DECIMAL, INTEGER, SMALLINT Fixed point numbers: Precision and Scale [ ][ ][ ].[ ][ ] : NUMERIC (5,2) Approximate Numeric Floating point numbers: Fraction and Exponent Characters and Bits 2 8 = 256 : A byte can represent 256 distinct symbols (signals) ASCII needs only 128 symbols => MSB for control How to handle Asian alphabets such as Korean Two byte code: [Byte-1][Byte-2] Common Error in Floating Point Number Comparison #include <stdio.h> main() { float a, b, c; a = 1.345f; b = 1.123f; c = a + b; if (c == 2.468) printf( Equal.\n"); else printf( Not equal! The value of c is %13.10f,or %f",c,c); } Execution Not equal! The value of c is or

10 IEEE 754 for Floating Point Numbers Single-Precision Sign: 1 bit, Exponent: 8 bits (with bias), Fraction: 23 bits Example: Negative Sign bit = (10) = (2) = x 2 6 Fraction = with following zero s up to 23 bits Exponent: 6 127(2 8 /2 1) + 6 = 133 = (2) S Exp Fraction Data Definition Main SQL DDL statements are: CREATE SCHEMA CREATE/ALTER TABLE CREATE VIEW DROP SCHEMA DROP TABLE DROP VIEW Many DBMSs also provide: CREATE INDEX DROP INDEX

11 CREATE SCHEMA / TABLE CREATE SCHEMA Name DROP SCHEMA Name CREATE TABLE PropertyForRent ( propertyno varchar(5) NOT NULL, rooms smallint NOT NULL, DEFAULT 4, rent decimal(6,2) NOT NULL, DEFAULT 600, ownerno varchar(5) NOT NULL, staffno varchar(5), branchno varchar(5) NOT NULL, PRIMARY KEY (propertyno), FOREIGN KEY (staffno) REFERENCES Staff ) Integrity Constraints Entity Integrity Primary key of a table must contain a unique, non-null value for each record. PRIMARY KEY (propertyno) Can only have one PRIMARY KEY clause per table. Can still ensure uniqueness for alternate keys using UNIQUE: UNIQUE(telNo) Referential Integrity if FK contains a value, it must refer to an existing row in its parent table. FOREIGN KEY(branchNo) REFERENCES Branch FOREIGN KEY (staffno) REFERENCES Staff ON DELETE SET NULL FOREIGN KEY (ownerno) REFERENCES Owner ON UPDATE CASCADE Enterprise Constraints CREATE ASSERTION StaffNotHandlingTooMuch CHECK (NOT EXISTS (SELECT staffno FROM PropertyForRent GROUP BY staffno HAVING COUNT(*) > 100))

12 ALTER/DROP TABLE ALTER TABLE Client ADD prefnorooms PRooms; DROP TABLE TableName [RESTRICT CASCADE] DROP TABLE PropertyForRent; Removes named table and all rows within it. With RESTRICT, if any other objects depend for their existence on continued existence of this table, SQL does not allow it. With CASCADE, SQL drops all dependent objects (and objects dependent on these objects). CREATE VIEW Create view so that manager at branch B003 can only see details for staff who work in his or her office. CREATE VIEW Manager3Staff AS SELECT * FROM Staff WHERE branchno = B003 ; Create view of staff details at branch B003 excluding salaries. CREATE VIEW Staff3 AS SELECT staffno, fname, lname, position, sex FROM Staff WHERE branchno = B003 ;

13 CREATE INDEX CREATE INDEX myindex on Staff(Name); Staff Transactions Concurrency Control Normal Banking Your Account = 50,000: Balance (DB) = 50,000 Read it at Branch A: Balance (Teller A) = 50,000 Draw 30,000: Balance (Teller A) = 20,000 Write it back: Balance (DB) = 20,000 Abnormal Banking Your Account = 50,000 Read it at Branch A: Balance (DB) = 50,000 Draw 30,000: Balance (Teller A) = 20,000 Read it at Branch B: Balance (Teller B) = 50,000 (Oops!!) Draw 40,000: Balance (Teller B) = 10,000 Write it back at A: Balance (DB) = 20,000 Write it back at B: Balance (DB) = 10,000 In Your Pocket = 70,000 while Balance is still 10,000

14 Transactions Transactions Atomicity Consistency Isolation Durability SQL defines transaction model based on COMMIT and ROLLBACK. Transaction is logical unit of work with one or more SQL statements guaranteed to be atomic with respect to recovery. An SQL transaction automatically begins with a transaction-initiating SQL statement (e.g., SELECT, INSERT). Changes made by transaction are not visible to other concurrently executing transactions until transaction completes. Access Control Give Manager full privileges to Staff table. GRANT ALL PRIVILEGES ON Staff TO Manager WITH GRANT OPTION; Give users Personnel and Director SELECT and UPDATE on column salary of Staff. GRANT SELECT, UPDATE (salary) ON Staff TO Personnel, Director; Give all users SELECT on Branch table. GRANT SELECT ON Branch TO PUBLIC; Revoke privilege SELECT on Branch table from all users. REVOKE SELECT ON Branch FROM PUBLIC; Revoke all privileges given to Director on Staff table. REVOKE ALL PRIVILEGES ON Staff FROM Director;

15 Summary Transforming ER Diagrams into Relational Schema Normalization SQL Concepts Data Types Schema/Table/View Creation Transactions and Access Control

DB Creation with SQL DDL

DB Creation with SQL DDL DB Creation with SQL DDL Outline SQL Concepts Data Types Schema/Table/View Creation Transactions and Access Control Objectives of SQL Ideally, database language should allow user to: create the database

More information

Standard Query Language. SQL: Data Definition Transparencies

Standard Query Language. SQL: Data Definition Transparencies Standard Query Language SQL: Data Definition Transparencies Chapter 6 - Objectives Data types supported by SQL standard. Purpose of integrity enhancement feature of SQL. How to define integrity constraints

More information

Lecture 07. Spring 2018 Borough of Manhattan Community College

Lecture 07. Spring 2018 Borough of Manhattan Community College Lecture 07 Spring 2018 Borough of Manhattan Community College 1 SQL Identifiers SQL identifiers are used to identify objects in the database, such as table names, view names, and columns. The ISO standard

More information

Lecture 5 Data Definition Language (DDL)

Lecture 5 Data Definition Language (DDL) ITM-661 ระบบฐานข อม ล (Database system) Walailak - 2013 Lecture 5 Data Definition Language (DDL) Walailak University T. Connolly, and C. Begg, Database Systems: A Practical Approach to Design, Implementation,

More information

Lecture 6 Structured Query Language (SQL)

Lecture 6 Structured Query Language (SQL) ITM661 Database Systems Lecture 6 Structured Query Language (SQL) (Data Definition) T. Connolly, and C. Begg, Database Systems: A Practical Approach to Design, Implementation, and Management, 5th edition,

More information

Example 1 - Create Horizontal View. Example 2 - Create Vertical View. Views. Views

Example 1 - Create Horizontal View. Example 2 - Create Vertical View. Views. Views Views Views RECALLS: View Dynamic result of one or more relational operations operating on the base relations to produce another relation. o Virtual relation that does not actually exist in the database

More information

3ISY402 DATABASE SYSTEMS

3ISY402 DATABASE SYSTEMS 3ISY402 DATABASE SYSTEMS - SQL: Data Definition 1 Leena Gulabivala Material from essential text: T CONNOLLY & C BEGG. Database Systems A Practical Approach to Design, Implementation and Management, 4th

More information

STRUCTURED QUERY LANGUAGE (SQL)

STRUCTURED QUERY LANGUAGE (SQL) STRUCTURED QUERY LANGUAGE (SQL) EGCO321 DATABASE SYSTEMS KANAT POOLSAWASD DEPARTMENT OF COMPUTER ENGINEERING MAHIDOL UNIVERSITY SQL TIMELINE SCOPE OF SQL THE ISO SQL DATA TYPES SQL identifiers are used

More information

Chapter 3. The Relational database design

Chapter 3. The Relational database design Chapter 3 The Relational database design Chapter 3 - Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations and relations in the relational

More information

Lecture 03. Fall 2017 Borough of Manhattan Community College

Lecture 03. Fall 2017 Borough of Manhattan Community College Lecture 03 Fall 2017 Borough of Manhattan Community College 1 2 Outline 1 Brief History of the Relational Model 2 Terminology 3 Integrity Constraints 4 Views 3 History of the Relational Model The Relational

More information

Lecture 03. Spring 2018 Borough of Manhattan Community College

Lecture 03. Spring 2018 Borough of Manhattan Community College Lecture 03 Spring 2018 Borough of Manhattan Community College 1 2 Outline 1. Brief History of the Relational Model 2. Terminology 3. Integrity Constraints 4. Views 3 History of the Relational Model The

More information

Conceptual Database Design

Conceptual Database Design Conceptual Database Design Fall 2009 Yunmook Nah Department of Electronics and Computer Engineering Dankook University Conceptual Database Design Methodology Chapter 15, Connolly & Begg Steps to Build

More information

DBMS Chapter Three IS304. Database Normalization-Comp.

DBMS Chapter Three IS304. Database Normalization-Comp. Database Normalization-Comp. Contents 4. Boyce Codd Normal Form (BCNF) 5. Fourth Normal Form (4NF) 6. Fifth Normal Form (5NF) 7. Sixth Normal Form (6NF) 1 4. Boyce Codd Normal Form (BCNF) In the first

More information

Database Technologies. Madalina CROITORU IUT Montpellier

Database Technologies. Madalina CROITORU IUT Montpellier Database Technologies Madalina CROITORU croitoru@lirmm.fr IUT Montpellier Part 5 NORMAL FORMS AND NORMALISATION Database design In the database design one can follow a bottom up approach or a top down

More information

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

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601 Techno India Batanagar Computer Science and Engineering Model Questions Subject Name: Database Management System Subject Code: CS 601 Multiple Choice Type Questions 1. Data structure or the data stored

More information

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

Data about data is database Select correct option: True False Partially True None of the Above Within a table, each primary key value. is a minimal super key is always the first field in each table must be numeric must be unique Foreign Key is A field in a table that matches a key field in another

More information

Chapter 6. SQL Data Manipulation

Chapter 6. SQL Data Manipulation Chapter 6 SQL Data Manipulation Pearson Education 2014 Chapter 6 - Objectives Purpose and importance of SQL. How to retrieve data from database using SELECT and: Use compound WHERE conditions. Sort query

More information

Physical Database Design

Physical Database Design Physical Database Design January 2007 Yunmook Nah Department of Electronics and Computer Engineering Dankook University Physical Database Design Methodology - for Relational Databases - Chapter 17 Connolly

More information

CMP-3440 Database Systems

CMP-3440 Database Systems CMP-3440 Database Systems Relational DB Languages SQL Lecture 06 zain 1 Purpose and Importance Database Language: To create the database and relation structures. To perform various operations. To handle

More information

2.8.1 Practicals Question Bank Algebra Unit-I 1. Show that {1, 2, 3} under multiplication modulo 4 is not a group but that {1, 2, 3, 4} under multiplication modulo 5 is a group. 2. Let G be a group with

More information

CMP-3440 Database Systems

CMP-3440 Database Systems CMP-3440 Database Systems Logical Design Lecture 03 zain 1 Database Design Process Application 1 Conceptual requirements Application 1 External Model Application 2 Application 3 Application 4 External

More information

Relational Database Systems Part 01. Karine Reis Ferreira

Relational Database Systems Part 01. Karine Reis Ferreira Relational Database Systems Part 01 Karine Reis Ferreira karine@dpi.inpe.br Aula da disciplina Computação Aplicada I (CAP 241) 2016 Database System Database: is a collection of related data. represents

More information

LECTURE 6: GUIDELINES FOR GOOD RELATIONAL DESIGN MAPPING ERD TO RELATIONS

LECTURE 6: GUIDELINES FOR GOOD RELATIONAL DESIGN MAPPING ERD TO RELATIONS LECTURE 6: GUIDELINES FOR GOOD RELATIONAL DESIGN MAPPING ERD TO RELATIONS Ref. Chapter 16 Logical Database Design Methodology for the Relational Model 1 Objectives 2 How to derive a set of relations from

More information

OBJECTIVES. How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization.

OBJECTIVES. How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization. 7.5 逻辑数据库设计 OBJECTIVES How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization. 2 OBJECTIVES How to validate a logical data model

More information

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

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data. Managing Data Data storage tool must provide the following features: Data definition (data structuring) Data entry (to add new data) Data editing (to change existing data) Querying (a means of extracting

More information

Lecture 10. Spring 2018 Borough of Manhattan Community College

Lecture 10. Spring 2018 Borough of Manhattan Community College Lecture 10 Spring 2018 Borough of Manhattan Community College 1 Chapter Objectives In this lecture you will learn: The limitations of the basic concepts of the Entity-Relationship (ER) model and the requirements

More information

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered

More information

Multiple-Choice. 1. Which of the following is equivalent to a table? (3 pts.) a. record b. relation c. relationship d. constraint e.

Multiple-Choice. 1. Which of the following is equivalent to a table? (3 pts.) a. record b. relation c. relationship d. constraint e. Database Design, CSCI 340, Spring 2016 2 nd Exam, April 1 Multiple-Choice 1. Which of the following is equivalent to a table? (3 pts.) a. record b. relation c. relationship d. constraint e. schema 2. Which

More information

II B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions.

II B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions. Dr.G.R.Damodaran College of Science (Autonomous, affiliated to the Bharathiar University, recognized by the UGC)Re-accredited at the 'A' Grade Level by the NAAC and ISO 9001:2008 Certified CRISL rated

More information

Review -Chapter 4. Review -Chapter 5

Review -Chapter 4. Review -Chapter 5 Review -Chapter 4 Entity relationship (ER) model Steps for building a formal ERD Uses ER diagrams to represent conceptual database as viewed by the end user Three main components Entities Relationships

More information

SQL Interview Questions

SQL Interview Questions SQL Interview Questions SQL stands for Structured Query Language. It is used as a programming language for querying Relational Database Management Systems. In this tutorial, we shall go through the basic

More information

Chapter 17. Methodology Logical Database Design for the Relational Model

Chapter 17. Methodology Logical Database Design for the Relational Model Chapter 17 Methodology Logical Database Design for the Relational Model Chapter 17 - Objectives How to derive a set of relations from a conceptual data model. How to validate these relations using the

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems Lecture 4 Intro to SQL (Chapter 6 - DML, Chapter 7 - DDL) September 17, 2018 Sam Siewert Backup to PRClab1.erau.edu If PRClab1.erau.edu is down or slow Use SE Workstation

More information

Relational Data Model ( 관계형데이터모델 )

Relational Data Model ( 관계형데이터모델 ) Relational Data Model ( 관계형데이터모델 ) Outline Terminology of Relational Model Mathematical Relations and Database Tables Candidate, Primary, and Foreign Keys Terminology in the Relational Model Relation:

More information

MTA Database Administrator Fundamentals Course

MTA Database Administrator Fundamentals Course MTA Database Administrator Fundamentals Course Session 1 Section A: Database Tables Tables Representing Data with Tables SQL Server Management Studio Section B: Database Relationships Flat File Databases

More information

Normalisation. Normalisation. Normalisation

Normalisation. Normalisation. Normalisation Normalisation Normalisation Main objective in developing a logical data model for relational database systems is to create an accurate and efficient representation of the data, its relationships, and constraints

More information

8) A top-to-bottom relationship among the items in a database is established by a

8) A top-to-bottom relationship among the items in a database is established by a MULTIPLE CHOICE QUESTIONS IN DBMS (unit-1 to unit-4) 1) ER model is used in phase a) conceptual database b) schema refinement c) physical refinement d) applications and security 2) The ER model is relevant

More information

Lab # 4. Data Definition Language (DDL)

Lab # 4. Data Definition Language (DDL) Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Lab # 4 Data Definition Language (DDL) Eng. Haneen El-Masry November, 2014 2 Objective To be familiar with

More information

CPS510 Database System Design Primitive SYSTEM STRUCTURE

CPS510 Database System Design Primitive SYSTEM STRUCTURE CPS510 Database System Design Primitive SYSTEM STRUCTURE Naïve Users Application Programmers Sophisticated Users Database Administrator DBA Users Application Interfaces Application Programs Query Data

More information

Data Storage and Query Answering. Data Storage and Disk Structure (4)

Data Storage and Query Answering. Data Storage and Disk Structure (4) Data Storage and Query Answering Data Storage and Disk Structure (4) Introduction We have introduced secondary storage devices, in particular disks. Disks use blocks as basic units of transfer and storage.

More information

DATABASES SQL INFOTEK SOLUTIONS TEAM

DATABASES SQL INFOTEK SOLUTIONS TEAM DATABASES SQL INFOTEK SOLUTIONS TEAM TRAINING@INFOTEK-SOLUTIONS.COM Databases 1. Introduction in databases 2. Relational databases (SQL databases) 3. Database management system (DBMS) 4. Database design

More information

- Database: Shared collection of logically related data and a description of it, designed to meet the information needs of an organization.

- Database: Shared collection of logically related data and a description of it, designed to meet the information needs of an organization. أساسيات قواعد بيانات 220) DataBase fundamentals (IS Lecture 1: Ch1 -Principles of DataBases- File-Based Systems: Collection of application programs that perform services for the end users. (e.g: reports).

More information

Solved MCQ on fundamental of DBMS. Set-1

Solved MCQ on fundamental of DBMS. Set-1 Solved MCQ on fundamental of DBMS Set-1 1) Which of the following is not a characteristic of a relational database model? A. Table B. Tree like structure C. Complex logical relationship D. Records 2) Field

More information

Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment

Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment Introductory concepts of DBMS 1. Explain detailed 3-level architecture

More information

The Relational Model

The Relational Model The Relational Model What is the Relational Model Relations Domain Constraints SQL Integrity Constraints Translating an ER diagram to the Relational Model and SQL Views A relational database consists

More information

Chapter 4. The Relational Model

Chapter 4. The Relational Model Chapter 4 The Relational Model Chapter 4 - Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations and relations in the relational model.

More information

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210 SQL: Concepts Todd Bacastow IST 210: Organization of Data 2/17/2004 1 Design questions How many entities are there? What are the major entities? What are the attributes of each entity? Is there a unique

More information

Entity Relationship Modeling

Entity Relationship Modeling Chapter 12 Entity Relationship Modeling Chapter Objectives In this chapter you will learn: How to use Entity Relationship (ER) modeling in database design. The basic concepts associated with the ER model:

More information

DATABASE MANAGEMENT SYSTEMS. UNIT I Introduction to Database Systems

DATABASE MANAGEMENT SYSTEMS. UNIT I Introduction to Database Systems DATABASE MANAGEMENT SYSTEMS UNIT I Introduction to Database Systems Terminology Data = known facts that can be recorded Database (DB) = logically coherent collection of related data with some inherent

More information

Assignment Session : July-March

Assignment Session : July-March Faculty Name Class/Section Subject Name Assignment Session : July-March 2018-19 MR.RAMESHWAR BASEDIA B.Com II Year RDBMS Assignment THEORY ASSIGNMENT II (A) Objective Question 1. Software that defines

More information

The Structured Query Language Get Started

The Structured Query Language Get Started The Structured Query Language Get Started Himadri Barman 0. Prerequisites: A database is an organized collection of related data that can easily be retrieved and used. By data, we mean known facts that

More information

Elements of the E-R Model

Elements of the E-R Model Chapter 3: The Entity Relationship Model Agenda Basic Concepts of the E-R model (Entities, Attributes, Relationships) Basic Notations of the E-R model ER Model 1 Elements of the E-R Model E-R model was

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems Lecture 3 Relational Calculus and Algebra Part-2 September 10, 2017 Sam Siewert RDBMS Fundamental Theory http://dilbert.com/strips/comic/2008-05-07/ Relational Algebra and

More information

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement Chapter 4 Basic SQL Basic SQL SQL language Considered one of the major reasons for the commercial success of relational databases SQL Structured Query Language Statements for data definitions, queries,

More information

The Relational Model. Outline. Why Study the Relational Model? Faloutsos SCS object-relational model

The Relational Model. Outline. Why Study the Relational Model? Faloutsos SCS object-relational model The Relational Model CMU SCS 15-415 C. Faloutsos Lecture #3 R & G, Chap. 3 Outline Introduction Integrity constraints (IC) Enforcing IC Querying Relational Data ER to tables Intro to Views Destroying/altering

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems http://dilbert.com/strips/comic/2010-08-24/ Lecture 8 Introduction to Normalization October 17, 2017 Sam Siewert Exam #1 Questions? Reminders Working on Grading Ex #3 -

More information

COSC344 Database Theory and Applications. Lecture 5 SQL - Data Definition Language. COSC344 Lecture 5 1

COSC344 Database Theory and Applications. Lecture 5 SQL - Data Definition Language. COSC344 Lecture 5 1 COSC344 Database Theory and Applications Lecture 5 SQL - Data Definition Language COSC344 Lecture 5 1 Overview Last Lecture Relational algebra This Lecture Relational algebra (continued) SQL - DDL CREATE

More information

1. (a) Briefly explain the Database Design process. (b) Define these terms: Entity, Entity set, Attribute, Key. [7+8] FIRSTRANKER

1. (a) Briefly explain the Database Design process. (b) Define these terms: Entity, Entity set, Attribute, Key. [7+8] FIRSTRANKER Code No: R09220502 R09 Set No. 2 1. (a) Briefly explain the Database Design process. (b) Define these terms: Entity, Entity set, Attribute, Key. [7+8] 2. Explain schema refinement in Database Design? [15]

More information

D.K.M COLLEGE FOR WOMEN(AUTONOMOUS),VELLORE DATABASE MANAGEMENT SYSTEM QUESTION BANK

D.K.M COLLEGE FOR WOMEN(AUTONOMOUS),VELLORE DATABASE MANAGEMENT SYSTEM QUESTION BANK D.K.M COLLEGE FOR WOMEN(AUTONOMOUS),VELLORE DATABASE MANAGEMENT SYSTEM QUESTION BANK UNIT I SECTION-A 2 MARKS 1. What is meant by DBMs? 2. Who is a DBA? 3. What is a data model?list its types. 4. Define

More information

Lecture4: Guidelines for good relational design Mapping ERD to Relation. Ref. Chapter3

Lecture4: Guidelines for good relational design Mapping ERD to Relation. Ref. Chapter3 College of Computer and Information Sciences - Information Systems Dept. Lecture4: Guidelines for good relational design Mapping ERD to Relation. Ref. Chapter3 Prepared by L. Nouf Almujally & Aisha AlArfaj

More information

namib I A U n IVERS I TY

namib I A U n IVERS I TY namib I A U n IVERS I TY OF SCIEnCE AnD TECH n 0 LOGY FACULTY OF COMPUTING AND INFORMATICS DEPARTMENT OF COMPUTER SCIENCE QUALIFICATION: BACHELOR OF COMPUTER SCIENCE QUALIFICATION CODE: 07BACS LEVEL: 5

More information

DATABASE MANAGEMENT SYSTEM

DATABASE MANAGEMENT SYSTEM DATABASE MANAGEMENT SYSTEM For COMPUTER SCIENCE DATABASE MANAGEMENT. SYSTEM SYLLABUS ER model. Relational model: relational algebra, tuple calculus, SQL. Integrity constraints, normal forms. File organization,

More information

Lecture 01. Fall 2018 Borough of Manhattan Community College

Lecture 01. Fall 2018 Borough of Manhattan Community College Lecture 01 Fall 2018 Borough of Manhattan Community College 1 2 Introduction A database (DB) is a collection of related data. A database management system (DBMS) is the software that manages and controls

More information

ADVANCED DATABASES ; Spring 2015 Prof. Sang-goo Lee (11:00pm: Mon & Wed: Room ) Advanced DB Copyright by S.-g.

ADVANCED DATABASES ; Spring 2015 Prof. Sang-goo Lee (11:00pm: Mon & Wed: Room ) Advanced DB Copyright by S.-g. 4541.564; Spring 2015 Prof. Sang-goo Lee (11:00pm: Mon & Wed: Room 301-203) ADVANCED DATABASES Copyright by S.-g. Lee Review - 1 General Info. Text Book Database System Concepts, 6 th Ed., Silberschatz,

More information

RELATIONAL DATA MODEL

RELATIONAL DATA MODEL RELATIONAL DATA MODEL EGCO321 DATABASE SYSTEMS KANAT POOLSAWASD DEPARTMENT OF COMPUTER ENGINEERING MAHIDOL UNIVERSITY RELATIONAL DATA STRUCTURE (1) Relation: A relation is a table with columns and rows.

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems Lecture 3 Relational Model & Languages Part-1 September 7, 2018 Sam Siewert More Embedded Systems Summer - Analog, Digital, Firmware, Software Reasons to Consider Catch

More information

RDBMS-Day3. SQL Basic DDL statements DML statements Aggregate functions

RDBMS-Day3. SQL Basic DDL statements DML statements Aggregate functions RDBMS-Day3 SQL Basic DDL statements DML statements Aggregate functions SQL SQL is used to make a request to retrieve data from a Database. The DBMS processes the SQL request, retrieves the requested data

More information

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010 CS403- Database Management Systems Solved MCQS From Midterm Papers April 29,2012 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 CS403- Database Management Systems MIDTERM EXAMINATION - Spring

More information

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1 SQL Fundamentals Chapter 3 Class 03: SQL Fundamentals 1 Class 03: SQL Fundamentals 2 SQL SQL (Structured Query Language): A language that is used in relational databases to build and query tables. Earlier

More information

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

Data analysis and design Unit number: 23 Level: 5 Credit value: 15 Guided learning hours: 60 Unit reference number: H/601/1991. Unit title: Data analysis and design Unit number: 23 Level: 5 Credit value: 15 Guided learning hours: 60 Unit reference number: H/601/1991 UNIT AIM AND PURPOSE The aim of this unit is to equip learners

More information

Database Normalization

Database Normalization Database Normalization Todd Bacastow IST 210 1 Overview Introduction The Normal Forms Relationships and Referential Integrity Real World Exercise 2 Keys in the relational model Superkey A set of one or

More information

COSC Assignment 2

COSC Assignment 2 COSC 344 Overview In this assignment, you will turn your miniworld into a set of Oracle tables, normalize your design, and populate your database. Due date for assignment 2 Friday, 25 August 2017 at 4

More information

Chapter 1 SQL and Data

Chapter 1 SQL and Data Chapter 1 SQL and Data What is SQL? Structured Query Language An industry-standard language used to access & manipulate data stored in a relational database E. F. Codd, 1970 s IBM 2 What is Oracle? A relational

More information

DATABASE MANAGEMENT SYSTEMS

DATABASE MANAGEMENT SYSTEMS www..com Code No: N0321/R07 Set No. 1 1. a) What is a Superkey? With an example, describe the difference between a candidate key and the primary key for a given relation? b) With an example, briefly describe

More information

Translation of ER-diagram into Relational Schema. Dr. Sunnie S. Chung CIS430/530

Translation of ER-diagram into Relational Schema. Dr. Sunnie S. Chung CIS430/530 Translation of ER-diagram into Relational Schema Dr. Sunnie S. Chung CIS430/530 Learning Objectives Define each of the following database terms Relation Primary key Foreign key Referential integrity Field

More information

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 9 Normalizing Database Designs

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 9 Normalizing Database Designs Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 9 Normalizing Database Designs NORMALIZATION What is normalization? Normalization is a procedure that is

More information

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I CS2255 DATABASE MANAGEMENT SYSTEMS CLASS: II YEAR CSE SEM:04 STAFF INCHARGE: Mr S.GANESH,AP/CSE QUESTION BANK UNIT I 2 MARKS List the purpose of Database System (or) List the drawback of normal File Processing

More information

CSCC43H: Introduction to Databases. Lecture 4

CSCC43H: Introduction to Databases. Lecture 4 CSCC43H: Introduction to Databases Lecture 4 Wael Aboulsaadat Acknowledgment: these slides are partially based on Prof. Garcia-Molina & Prof. Ullman slides accompanying the course s textbook. CSCC43: Introduction

More information

INTRODUCTION TO DATABASE

INTRODUCTION TO DATABASE 1 INTRODUCTION TO DATABASE DATA: Data is a collection of raw facts and figures and is represented in alphabets, digits and special characters format. It is not significant to a business. Data are atomic

More information

EXAMINATION FOR THE BSC (HONS) IN INFORMATION SYSTEMS; YEAR 2

EXAMINATION FOR THE BSC (HONS) IN INFORMATION SYSTEMS; YEAR 2 FACULTY OF SCIENCE AND TECHNOLOGY EXAMINATION FOR THE BSC (HONS) IN INFORMATION SYSTEMS; YEAR 2 ACADEMIC SESSION; 2013 SEMESTER 4 SEG2102: DATABASE MANAGEMENT SYSTEMS FINAL JULY 2013 EXAM CYCLE TIME: 2

More information

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

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science 1 Distributed Database Systems Basic concepts and Definitions Data Collection of facts and figures concerning an object

More information

COMP102: Introduction to Databases, 5 & 6

COMP102: Introduction to Databases, 5 & 6 COMP102: Introduction to Databases, 5 & 6 Dr Muhammad Sulaiman Khan Department of Computer Science University of Liverpool U.K. 8/11 February, 2011 Introduction: SQL, part 2 Specific topics for today:

More information

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

The Relational Model. Roadmap. Relational Database: Definitions. Why Study the Relational Model? Relational database: a set of relations The Relational Model CMU SCS 15-415/615 C. Faloutsos A. Pavlo Lecture #3 R & G, Chap. 3 Roadmap Introduction Integrity constraints (IC) Enforcing IC Querying Relational Data ER to tables Intro to Views

More information

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg Database Systems A Practical Approach to Design, Implementation, and Management For these Global Editions, the editorial team at Pearson has collaborated with educators across the world to address a wide

More information

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38 Student Info StudentID: Center: ExamDate: MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: 1356458 Time: 60 min Marks: 38 BC080402322 OPKST 5/28/2010 12:00:00 AM

More information

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

Relational Databases BORROWED WITH MINOR ADAPTATION FROM PROF. CHRISTOS FALOUTSOS, CMU /615 Relational Databases BORROWED WITH MINOR ADAPTATION FROM PROF. CHRISTOS FALOUTSOS, CMU 15-415/615 Roadmap 3 Introduction Integrity constraints (IC) Enforcing IC Querying Relational Data ER to tables Intro

More information

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Relational Data Model and Relational Constraints Part 1 A simplified diagram to illustrate the main

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems http://dilbert.com/strips/comic/1995-10-11/ Lecture 5 More SQL and Intro to Stored Procedures September 24, 2017 Sam Siewert SQL Theory and Standards Completion of SQL in

More information

Relational Data Structure and Concepts. Structured Query Language (Part 1) The Entity Integrity Rules. Relational Data Structure and Concepts

Relational Data Structure and Concepts. Structured Query Language (Part 1) The Entity Integrity Rules. Relational Data Structure and Concepts Relational Data Structure and Concepts Structured Query Language (Part 1) Two-dimensional tables whose attributes values are atomic. At every row-and-column position within the table, there always exists

More information

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called Q.1 Short Questions Marks 1. Considering functional dependency, one in which removal from some attributes must affect dependency is called 01 A. full functional dependency B. partial dependency C. prime

More information

Lecture 09. Spring 2018 Borough of Manhattan Community College

Lecture 09. Spring 2018 Borough of Manhattan Community College Lecture 09 Spring 2018 Borough of Manhattan Community College 1 Entity Relationship Modeling The Entity Relationship (ER) is a nontechnical communication model that describes the nature of the data and

More information

CS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C

CS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C CS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C 0 0 3 2 LIST OF EXPERIMENTS: 1. Creation of a database and writing SQL queries to retrieve information from the database. 2. Performing Insertion,

More information

Copyright 2004 Pearson Education, Inc.

Copyright 2004 Pearson Education, Inc. Chapter 2 Database System Concepts and Architecture Data Models Data Model: A set of concepts to describe the structure of a database, and certain constraints that the database should obey. Data Model

More information

Database design process

Database design process Database technology Lecture 2: Relational databases and SQL Jose M. Peña jose.m.pena@liu.se Database design process 1 Relational model concepts... Attributes... EMPLOYEE FNAME M LNAME SSN BDATE ADDRESS

More information

Today Learning outcomes LO2

Today Learning outcomes LO2 2015 2016 Phil Smith Today Learning outcomes LO2 On successful completion of this unit you will: 1. Be able to design and implement relational database systems. 2. Requirements. 3. User Interface. I am

More information

ADVANCED QUERY AND VIEWS

ADVANCED QUERY AND VIEWS ADVANCED QUERY AND VIEWS EGCO321 DATABASE SYSTEMS KANAT POOLSAWASD DEPARTMENT OF COMPUTER ENGINEERING MAHIDOL UNIVERSITY TYPE OF SUBQUERIES There are two main types of subqueries - nested and correlated.

More information

Normalization. { Ronak Panchal }

Normalization. { Ronak Panchal } Normalization { Ronak Panchal } Chapter Objectives The purpose of normailization Data redundancy and Update Anomalies Functional Dependencies The Process of Normalization First Normal Form (1NF) Second

More information

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam Question No: 1 ( Marks: 1 ) - Please choose one Which of the following is NOT a feature of Context DFD?

More information

Course Outline Faculty of Computing and Information Technology

Course Outline Faculty of Computing and Information Technology Course Outline Faculty of Computing and Information Technology Title Code Instructor Name Credit Hours Prerequisite Prerequisite Skill/Knowledge/Understanding Category Course Goals Statement of Course

More information

Logical Database Design. ICT285 Databases: Topic 06

Logical Database Design. ICT285 Databases: Topic 06 Logical Database Design ICT285 Databases: Topic 06 1. What is Logical Database Design? Why bother? Bad logical database design results in bad physical database design, and generally results in poor database

More information