Databases.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

14 Databases Foundations of Computer Science ã Cengage Learning.
The Hierarchical Model
C6 Databases.
Database Systems: Design, Implementation, and Management Tenth Edition
Introduction to Databases
Databases. Database Information is not useful if not organized In database, data are organized in a way that people find meaningful and useful. Database.
Geographic Information Systems
Chapter 4: Database Management. Databases Before the Use of Computers Data kept in books, ledgers, card files, folders, and file cabinets Long response.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
©Brooks/Cole, 2003 Chapter 14 Databases. ©Brooks/Cole, 2003 Understand a DBMS and define its components. Understand the architecture of a DBMS and its.
Database System Concepts and Architecture
5.1 © 2007 by Prentice Hall 5 Chapter Foundations of Business Intelligence: Databases and Information Management.
STORING ORGANIZATIONAL INFORMATION— DATABASES CIS 429—Chapter 7.
Introduction to Database Systems
14. Databases. DATABASEMANAGEMENTSYSTEMDATABASEMANAGEMENTSYSTEM 14.1.
CHAPTER 8: MANAGING DATA RESOURCES. File Organization Terms Field: group of characters that represent something Record: group of related fields File:
1.file. 2.database. 3.entity. 4.record. 5.attribute. When working with a database, a group of related fields comprises a(n)…
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
CS 1308 Computer Literacy and the Internet
Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Chapter 9 Databases Objectives Understand a DBMS and define its components. Understand the architecture of a DBMS and its levels. Distinguish between.
Data Resource Management Lecture 8. Traditional File Processing Data are organized, stored, and processed in independent files of data records In traditional.
Geographic Information Systems GIS Data Databases.
Fundamental of Database Systems
- The most common types of data models.
國立臺北科技大學 課程:資料庫系統 Chapter 2 Database Environment.
Database Systems: Design, Implementation, and Management Tenth Edition
REV 00 Chapter 2 Database Environment DDC DATABASE SYSTEM.
Roles in the Database Environment
REV 00 Chapter 2 Database Environment DDC DATABASE SYSTEM.
Datab ase Systems Week 1 by Zohaib Jan.
Chapter 2 Database Environment.
An Introduction to database system
Chapter 9 Database Systems
Database Management System
Databases and Database Management Systems Chapter 9
Introduction to Information Technology
Chapter 12 Information Systems.
Information Systems Database Management
Chapter 4 Relational Databases
Geographic Information Systems
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Databases and Information Management
Database Concepts.
Chapter 2 Database Environment.
Introduction to Database Management System
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment.
Data Base System Lecture : Database Environment
MANAGING DATA RESOURCES
Week 11: Database Management System
Database.
File Systems and Databases
DATABASE SYSTEM UNIT I.
MANAGING DATA RESOURCES
Data Model.
Databases and Information Management
Database management concepts
DATABASES WHAT IS A DATABASE?
Chapter 2 Database Environment Pearson Education © 2014.
Chapter 2 Database Environment Pearson Education © 2009.
DATABASE Purpose of database
Chapter 2 Database Environment Pearson Education © 2009.
Course Instructor: Supriya Gupta Asstt. Prof
Geographic Information Systems
Presentation transcript:

Databases

OBJECTIVES After reading this chapter, the reader should be able to: Understand a DBMS and define its components. Understand the architecture of a DBMS and its levels. Distinguish between different database models. Understand the concept of relational database operations on a relation. Use Structured Query Language (SQL) to define simple relations.

14.1 DATABASE MANAGEMENT SYSTEM

DBMS Database – a collection of data that is logically coherent. DBMS – Database Management System defines, creates, and maintains a database. Allows users controlled access to data in the database. A combination of 5 components: Hardware Software Data Users Procedures

DBMS components Figure 14-1 Hardware – the physical computer system that allows physical access to data. Software – the actual program that allows users to access, maintain, and update physical data. Data – stored physically on the storage devices Users – End users - Normal user and DBA (Database Administrator) Application programs Procedures – a set of rules that should be clearly defined and followed by the users.

14.2 ARCHITECTURE

Database architecture Figure 14-2

Architecture Internal level – Conceptual level – External level – Determines where data are actually stored on the storage device. Low-level access method Conceptual level – Defines the logical view of the data The main functions of DBMS are in this level. External level – Interacts directly with the user. Change the data coming from the conceptual level to a format and view that are familiar to the users.

14.3 DATABASE MODELS

Database models A database model 3 models defines the logical design of data. Describes the relationships between different parts of data. 3 models Hierarchical model Network model Relational model

Hierarchical model Data are organized as an upside down tree. Figure 14-3 Data are organized as an upside down tree. Each entity has only one parent but can have several children.

Network model The entities are organized in a graph. Figure 14-4 The entities are organized in a graph. Some entities can be accessed through several paths.

Relational model Figure 14-5 Data are organized in two-dimensional tables called relations. The tables are related to each other. The most popular model.

14.4 RELATIONAL MODEL

Relational model RDBMS (Relational Database Management System) external view The data are represented as a set of relations. A relation is a two-dimensional table. This doesn’t mean that data are stored as tables; the physical storage of the data is independent of the way the data are logically organized.

Relation Figure 14-6 Name – each relation in a relational database should have a name that is unique among other relations. Attribute – each column in a relation. The degree of the relation – the total number of attributes for a relation. Tuple – each row in a relation. The cardinality of the relation – the total number of rows in a relation.

14.5 OPERATIONS ON RELATIONS

Operations on relations In a relational database, we can define several operations to create new relations out of the existing ones. Basic operations: Insert Delete Update Select Project Join Union Intersection Difference

Insert operation An unary operation. Figure 14-7 An unary operation. Insert a new tuple into the relation.

Delete operation An unary operation. Figure 14-8 An unary operation. Delete a tuple defined by a criterion from the relation.

Update operation An unary operation. Figure 14-9 An unary operation. Changes the value of some attributes of a tuple.

Select operation An unary operation. Figure 14-10 An unary operation. It is applied to one single relation and creates another relation. The tuples in the resulting relation are a subset of the tuples in the original relation. Use some criteria to select

Project operation An unary operation. Figure 14-11 An unary operation. It is applied to one single relation and creates another relation. The attributes in the resulting relation are a subset of the attributes in the original relation.

Join operation A binary operation. Figure 14-12 A binary operation. Combines two relations based on common attributes.

Union operation A binary operation. Figure 14-13 A binary operation. Creates a new relation in which each tuple is either in the first relation, in the second, or in both. The two relations must have the same attributes.

Intersection operation Figure 14-14 A binary operation. Creates a new relation in which each tuple is a member in both relations. The two relations must have the same attributes.

Difference operation A binary operation. Figure 14-15 A binary operation. Creates a new relation in which each tuple is in the first relation but not the second. The two relations must have the same attributes.

14.6 STRUCTURED QUERY LANGUAGE

SQL (Structured Query Language) Standardized by ANSI and ISO for use on relational databases. It is a declarative (not procedural) language, which means that the users declare what they want without having to write a step-by-step procedure. First implemented by Oracle in 1979. SQL allows you to combine the following statements to extract more complex information from database.

Insert insert into RELATION-NAME values ( … , … , … ) insert into COURSES values ( “CIS52”,”TCP/IP”, 6 )

Delete delete from RELATION-NAME where criteria delete from COURSES where No=“CIS19”

Update update COURSES set Unit=6 where No=“CIS51” update RELATION-NAME set attribute1=value1, attribute2=value2, … where criteria update COURSES set Unit=6 where No=“CIS51”

Select select * from RELATION-NAME where criteria select * from COURSES where Unit=5

Project select attribute-list from RELATION-NAME select No, Unit from COURSES

Join select attribute-list from RELATION1,RELATION2 where criteria select No,Course-Name,Unit,Professor from COURSES,TAUGHT-BY where COURSES.No=TAUGHT-BY.No

Union select * from RELATION1 union select * from RELATION2 select * from CIS15-Roster union select * from CIS52-Roster

Intersection select * from RELATION1 intersection select * from RELATION2 select * from CIS15-Roster intersection select * from CIS52-Roster

Difference select * from RELATION1 minus select * from RELATION2 select * from CIS15-Roster minus select * from CIS52-Roster

14.7 OTHER DATABASE MODELS

Distributed databases It is not a new model. It is based on relational model. The data are stored on several computers that communicate through the Internet or some private WAN. Data are either fragmented, with each fragment stored at one site, or data are replicated at each site. Fragmented distributed databases Replicated distributed databases

Object-Oriented databases Some application like to see data as a structure such as a record made of fields. Tries to keep the adv. of the relational model and allows applications to access structured data. In an OODB, objects and their relations are defined. In addition, each object can have attributes that can be expressed as fields.