Week 11: Database Management System

Slides:



Advertisements
Similar presentations
Chapter Information Systems Database Management.
Advertisements

Chapter Information Systems Database Management.
Chapter 12 File Processing and Data Management Concepts
Relational Databases Chapter 4.
Chapter 12 Information Systems Chapter Goals Define the role of general information systems Explain how spreadsheets are organized Create spreadsheets.
Chapter Information Systems Database Management.
Organizing Data & Information
Your name here The lecture notes are based on using Microsoft Access interactively as part of the lecture.
Chapter 12 Information Systems Nell Dale John Lewis.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Chapter 12 Information Systems. 2 Chapter Goals Define the role of general information systems Explain how spreadsheets are organized Create spreadsheets.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Chapter 12 Information Systems. Spreadsheets Databases 12-2.
Chapter 12 Information Systems. 2 Managing Information Information system Software that helps the user organize and analyze data Electronic spreadsheets.
Chapter 12 Information Systems. 2 Chapter Goals Define the role of general information systems Explain how spreadsheets are organized Create spreadsheets.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
Chapter 2 CIS Sungchul Hong
Introduction to Accounting Information Systems
Dr. John P. Abraham, University of Texas Pan American Information Technology Database Dr. John P. Abraham.
Information Systems: Databases Define the role of general information systems Describe the elements of a database management system (DBMS) Describe the.
Concepts and Terminology Introduction to Database.
CODD’s 12 RULES OF RELATIONAL DATABASE
Chapter 12 Information Systems. 2 Managing Information Information system Software that helps the user organize and analyze data Electronic spreadsheets.
Chapter 12 Information Systems. 2 Chapter Goals Define the role of general information systems Explain how spreadsheets are organized Create spreadsheets.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1.file. 2.database. 3.entity. 4.record. 5.attribute. When working with a database, a group of related fields comprises a(n)…
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
CS 1308 Computer Literacy and the Internet
Dr. John P. Abraham, University of Texas Pan American Information Technology Database Dr. John P. Abraham.
Chapter 9 Database Systems Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Chapter 9 Database Systems © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 13.3: Databases Invitation to Computer Science, Java Version, Second Edition.
Management Information Systems by Prof. Park Kyung-Hye Chapter 7 (8th Week) Databases and Data Warehouses 07.
Databases and Database User ch1 Define Database? A database is a collection of related data.1 By data, we mean known facts that can be recorded and that.
Fundamental of Database Systems
Fundamentals of DBMS Notes-1.
Information System & Database Design
CIS 336 AID Your Dreams Our Mission/cis336aid.com
Oracle & SQL Introduction
Databases Chapter 16.
Information Systems Today: Managing in the Digital World
Chapter 9 Database Systems
Fundamentals of Information Systems, Sixth Edition
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Chapter 12 Information Systems.
Information Systems Database Management
Chapter 4 Relational Databases
Database Management System
Database Management  .
Databases and Information Management
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment.
Database.
Databases.
Database Management Concepts
Data Model.
Databases and Information Management
Accounting Information Systems 9th Edition
DATABASES WHAT IS A DATABASE?
Chapter 9: Database Systems
DATABASE TECHNOLOGIES
DATABASE Purpose of database
Chapter 2 Database Environment Pearson Education © 2009.
Geographic Information Systems
Presentation transcript:

Week 11: Database Management System READING: Chapter 12.3

Database Management System EECS 1520 -- Computer Use: Fundamentals Database Management System Database: A structured set of data Database Management System (DBMS): A combination of software and data, including: Physical database: A collection of files that contain the data Database engine: software that supports access to and modification of the database contents Database schema: a specification of the logical structure of the data stored in the database 2

Database Management System EECS 1520 -- Computer Use: Fundamentals Database Management System Specialized database languages allow the user to: specify the structure of data add, modify, and delete data; query the database to retrieve specific stored data 3

Database Management System EECS 1520 -- Computer Use: Fundamentals Database Management System 4

Database Management System EECS 1520 -- Computer Use: Fundamentals Database Management System A schema is a description of the entire database structure used by the database software to maintain the database A subschema is a description of only that part of the database that is particular to a user’s needs 5

Database Management System EECS 1520 -- Computer Use: Fundamentals Database Management System A layered approach hides the complexities of database implementation: User sees data in terms of the applications The application sees data in terms of the database model The “DBMS” sees data as it is organized 6

Database Management System EECS 1520 -- Computer Use: Fundamentals Database Management System Advantages of the layered approach include : Simplification of the design process Better control of access Data independence Applications can be written in terms of simple, conceptual views of the data – the database model 7

EECS 1520 -- Computer Use: Fundamentals Database Models A database model is a conceptual view of how to organize and manipulate data The most popular one is the Relational Model 8

EECS 1520 -- Computer Use: Fundamentals Relational Model In a “Relational DBMS”, the data items, and the relationships among them, are organized into rectangular tables: As with spreadsheets, these tables consist of rows and columns. Each table is called a relation The rows are called tuples or records The columns are called attributes 9

EECS 1520 -- Computer Use: Fundamentals Database 10

EECS 1520 -- Computer Use: Fundamentals Database Table We can express the schema for this database table as follows: Movie (MovieId: key, Title, Genre, Rating) 11

EECS 1520 -- Computer Use: Fundamentals Database Table A partial CUSTOMER table: 12

Database Table We can express the schema for this database table as: EECS 1520 -- Computer Use: Fundamentals Database Table We can express the schema for this database table as: Customer (CustomerId: key, Name, Address, CreditCardNumber) 13

EECS 1520 -- Computer Use: Fundamentals Relationships A table can represent a collection of relationships between objects. The “RENTS” table relates Customers to the Movies they have rented by their respective Ids. 14

Database Table We can express the schema for a relationship: EECS 1520 -- Computer Use: Fundamentals Database Table We can express the schema for a relationship: Note: the absence of a key field Rents (CustomerId, MovieId, DateRented, DateDue) 15

Relational Operations EECS 1520 -- Computer Use: Fundamentals Relational Operations There are 3 fundamental operations that can be used to manipulate the tables in a database: SELECT Extracts rows (tuples) from a table (relation) PROJECT Extracts columns (attributes) from a table (relation) JOIN Combines 2 tables (relations) into 1 16

Relational Operations EECS 1520 -- Computer Use: Fundamentals Relational Operations We can express these operations with a simple syntax. This operation creates a new relation (named NEW) by extracting all rows from the MOVIE table that have a RATING of PG. NEW ← SELECT from MOVIE where RATING = “PG” 17

Relational Operations EECS 1520 -- Computer Use: Fundamentals Relational Operations 18

EECS 1520 -- Computer Use: Fundamentals SELECT MovieId Title Genre Rating 102 Back to the Future comedy adventure PG 104 Field of Dreams fantasy drama The NEW relation. 19

Relational Operations EECS 1520 -- Computer Use: Fundamentals Relational Operations The same syntax can be used for the other operations. This operation creates a new relation (named PGmovies) that extracts 2 attributes from the NEW relation. PGmovies ← PROJECT MovieId, Title from NEW 20

EECS 1520 -- Computer Use: Fundamentals PROJECT MovieId Title 102 Back to the Future 104 Field of Dreams The PGmovies relation. 21

Relational Operations EECS 1520 -- Computer Use: Fundamentals Relational Operations A JOIN creates a new relation by combining 2 relations according to some criterion. TEMP1 ← JOIN CUSTOMER and RENTS where CUSTOMER.CustomerId = RENTS.CustomerId CUSTOMER RENTS 22

EECS 1520 -- Computer Use: Fundamentals JOIN CustomerId Name Address CreditCardNumber MovieId DateRented DateDue 101 Dennis Cook 789 Main 993726762357 102 08/11/2010 15/11/2010 104 04/11/2010 14/11/2010 Doug Nickle 456 Second 632783087764 09/11/2010 11/11/2010 103 Randy Wolf 12 Elm 854072657547 07/11/2010 10/11/2010 05/11/2010 Amy Stevens Yellow Brick Road 184585788722 107 105 Susan Klaton 654 Lois Lane 537212603203 1033 13/11/2010 Chris Stein 1010 Abbey Road 862175961142 7442 06/11/2010 TEMP1 23

Relational Operations EECS 1520 -- Computer Use: Fundamentals Relational Operations The PROJECT operation can be used to remove the attributes we don’t want… RENTALS ← PROJECT Name, Address, MovieId from TEMP1 24

Relational Operations EECS 1520 -- Computer Use: Fundamentals Relational Operations The RENTALS relation. Name Address MovieId Dennis Cook 789 Main 102 104 Doug Nickle 456 Second 101 Randy Wolf 12 Elm Amy Stevens Yellow Brick Road 107 Susan Klaton 654 Lois Lane 1033 Chris Stein 1010 Abbey Road 7442 25

Relational Operations EECS 1520 -- Computer Use: Fundamentals Relational Operations Now, JOINing RENTALS to PGmovies… …creates a table of customers who have rented PG movies. PGrenters ← JOIN RENTALS and PGmovies where RENTALS.MovieId = PGmovies.MovieId Name Address MovieId Title Dennis Cook 789 Main 102 Back to the Future 104 Field of Dreams Randy Wolf 12 Elm 26

Structured Query Language EECS 1520 -- Computer Use: Fundamentals Structured Query Language Structured Query Language (SQL) A comprehensive database language for managing relational databases. 27

EECS 1520 -- Computer Use: Fundamentals Queries in SQL select attribute-list from table-list where condition select Title from MOVIE where Rating = 'PG‘ select Name, Address from CUSTOMER select * from MOVIE where Genre like '%action%‘ select * from MOVIE where Rating = 'R' order by Title 28

Modifying Database Content EECS 1520 -- Computer Use: Fundamentals Modifying Database Content Insert into CUSTOMER values (9876, ‘John Smith’, ‘602 Greenbriar Court’, ‘2938 3212 3402 0299’) Update MOVIE set Genre = ‘thriller drama’ where title = ‘Unbreakable’ Delete from MOVIE where Rating = ‘R’ 29

EECS 1520 -- Computer Use: Fundamentals Database Design Entity-relationship (ER) modeling A popular technique for designing relational databases. ER Diagram Chief tool used for ER modeling. Captures the important record types, attributes, and relationships in a graphical form. 30

EECS 1520 -- Computer Use: Fundamentals Database Design These designations show the cardinality constraint of the relationship: 31