UNIT I. Introduction

Similar documents
Chapter 1: Introduction

Chapter 1: Introduction. Chapter 1: Introduction

Chapter 1: Introduction

Chapter 1: Introduction

Database Management System. Fundamental Database Concepts

Chapter 1: Introduction

Database Management Systems (CPTR 312)

Upon completion of this Unit, the students will be introduced to the following

CS425 Fall 2016 Boris Glavic Chapter 1: Introduction

D.Hemavathi & R.Venkatalakshmi, Assistant Professor, SRM University, Kattankulathur

Chapter 1 Introduction

Database System Concepts

Database Technology Introduction. Heiko Paulheim

Database Principle. Zhuo Wang Spring

Introduction Database Concepts

Introduction to DBMS

Course Logistics & Chapter 1 Introduction

Chapter 1 Chapter-1

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1

Unit I. By Prof.Sushila Aghav MIT

Chapter 1: Introduction

Quick Facts about the course. CS 2550 / Spring 2006 Principles of Database Systems. Administrative. What is a Database Management System?

DATABASE MANAGEMENT SYSTEMS. UNIT I Introduction to Database Systems

Introduction: Database Concepts Slides by: Ms. Shree Jaswal

COMP Instructor: Dimitris Papadias WWW page:

DATABASE MANAGEMENT SYSTEM COURSE CONTENT

CS34800 Information Systems. Course Overview Prof. Walid Aref January 8, 2018

CSE 132A. Database Systems Principles

CMSC 424 Database design Lecture 2: Design, Modeling, Entity-Relationship. Book: Chap. 1 and 6. Mihai Pop

Mahathma Gandhi University

Information Systems and Software Systems Engineering (12CFU)


Basant Group of Institution

Overview of Data Management

Data Modeling using ER Model

SYLLABUS (R15A0509) DATABASE MANAGEMENT SYSTEMS

CMPT 354 Database Systems I. Spring 2012 Instructor: Hassan Khosravi

Can you name one application that does not need any data? Can you name one application that does not need organized data?

CAS CS 460/660 Introduction to Database Systems. Fall

Databases and Database Systems

Databases. Jörg Endrullis. VU University Amsterdam

Unit1: Introduction. Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See for conditions on re-use

What is Data? ANSI definition: Volatile vs. persistent data. Data. Our concern is primarily with persistent data

What is Data? Volatile vs. persistent data Our concern is primarily with persistent data

Overview of Data Management

CSCI1270 Introduction to Database Systems

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

Course Introduction & Foundational Concepts

Introduction to Databases

Introduction CHAPTER. 1.1 Database-System Applications

U1. Data Base Management System (DBMS) Unit -1. MCA 203, Data Base Management System

Lecture 1 Database Systems: An Introduction

Copyright 2004 Pearson Education, Inc.

Database System Concepts and Architecture

An Introduction to Databases and Database Management Systems.

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 1-1

Databases and Database Management Systems

DBMS (FYCS) Unit - 1. A database management system stores data in such a way that it becomes easier to retrieve, manipulate, and produce information.

Introduction: Databases and. Database Users

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

UNIT 1 INTRODUCTION TO DBMS 1

Example: specific person, company, event, plant

Database Systems: Learning Outcomes. Examples of Database Application. Introduction

John Edgar 2

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

Database Management System

Fundamentals of Design, Implementation, and Management Tenth Edition

Database Management System 9

Chapter 6: Entity-Relationship Model

Introduction: Databases and Database Users. Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1

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

SYED AMMAL ENGINEERING COLLEGE

Database System Concepts and Architecture

CT13 DATABASE MANAGEMENT SYSTEMS DEC 2015

Help student appreciate the DBMS scope of function

Introduction C H A P T E R1. Exercises

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Slide 2-1

Chapter 6: Entity-Relationship Model

1.8 Database and data modelling

Rapid Application Development

Chapter 6: Entity-Relationship Model

; Spring 2008 Prof. Sang-goo Lee (14:30pm: Mon & Wed: Room ) ADVANCED DATABASES

Relational Database Systems Part 01. Karine Reis Ferreira

VALLIAMMAI ENGINEERING COLLEGE

Fundamentals of Database Systems (INSY2061)

4/28/2014. File-based Systems. Arose because: Result

Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Lecture 02. Fall 2017 Borough of Manhattan Community College

Introduction to Database Concepts. Department of Computer Science Northern Illinois University January 2018

Rajiv GandhiCollegeof Engineering& Technology, Kirumampakkam.Page 1 of 10

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

Database Management System 4

Database Systems. Sven Helmer. Database Systems p. 1/567

Chapter 11 Database Concepts

1 Overview of Database Management

Course Introduction & Foundational Concepts

LECTURE1: PRINCIPLES OF DATABASES

Databases: Why? Databases: What? Databases: How? DATABASE DESIGN I - 1DL300

Database Systems Concepts *

Transcription:

UNIT I Introduction Objective To know the need for database system. To study about various data models. To understand the architecture of database system. To introduce Relational database system. Introduction A database-management system (DBMS) is a collection of interrelated data and a set of programs to access those data. The collection of data, usually referred to as the database, contains information relevant to an enterprise. The primary goal of a DBMS is to provide a way to store and retrieve database information that is both convenient and efficient. Database systems are designed to manage large bodies of information. Management of data involves both defining structures for storage of information and providing mechanisms for the manipulation of information. In addition, the database system must ensure the safety of the information stored, despite system crashes or attempts at unauthorized access. If data are to be shared among several users, the system must avoid possible anomalous results. Because information is so important in most organizations, computer scientists have developed a large body of concepts and techniques for managing data.

History of Database Systems 1950s and early 1960s: Data processing using magnetic tapes for storage o Tapes provide only sequential access Punched cards for input Late 1960s and 1970s: Hard disks allow direct access to data Network and hierarchical data models in widespread use Ted Codd defines the relational data model o Would win the ACM Turing Award for this work o IBM Research begins System R prototype o UC Berkeley begins Ingres prototype High-performance (for the era) transaction processing 1980s: Research relational prototypes evolve into commercial systems SQL becomes industrial standard Parallel and distributed database systems Object-oriented database systems 1990s: Large decision support and data-mining applications Large multi-terabyte data warehouses Emergence of Web commerce 2000s: XML and XQuery standards

Automated database administration Database Applications DBMS contains information about a particular enterprise Collection of interrelated data Set of programs to access the data An environment that is both convenient and efficient to use Database Applications: Banking: all transactions Airlines: reservations, schedules Universities: registration, grades Sales: customers, products, purchases Online retailers: order tracking, customized recommendations Manufacturing: production, inventory, orders, supply chain Human resources: employee records, salaries, tax deductions Databases touch all aspects of our lives 1.0 Purpose of Database Systems In the early days, database applications were built directly on top of file systems Drawbacks of using file systems to store data: Data redundancy and inconsistency

Multiple file formats, duplication of information in different files Difficulty in accessing data Need to write a new program to carry out each new task Data isolation multiple files and formats Integrity problems Integrity constraints (e.g. account balance > 0) become buried in program code rather than being stated explicitly Hard to add new constraints or change existing ones. Atomicity of updates Failures may leave database in an inconsistent state with partial updates carried out Example: Transfer of funds from one account to another should either complete or not happen at all Concurrent access by multiple users Concurrent accessed needed for performance Uncontrolled concurrent accesses can lead to inconsistencies Example: Two people reading a balance and updating it at the same time Security problems Hard to provide user access to some, but not all, data Database systems offer solutions to all the above problems 1.1 View of Data

A major purpose of a database system is to provide users with an abstract view of data. ie. The system hides certain details of how the data are stored and maintained. 1.1.0 Data Abstraction In order to retrieve data efficiently, designers use complex structures to represent data in the database. To simplify users interaction with the system, developers hide the complexity from the users through several levels of abstraction: Physical Level: Logical Level: The lowest level of abstraction describes how the data are actually stored. This level describes complex low level data structures in detail. This level describes what data are stored in the database, and what relationships exist among those data. type customer= record customer_id: string; customer_name: string; customer_street: string; customer_city: integer; end View Level: Highest level of abstraction describes only View a part Level of the database. A way to hide: (a) View details 1 of data types View and 2(b) information....... (such as View an n employee s salary) for security purposes. Logical Level Physical Level

of Abstraction Fig 1.1 The Three Levels 1.1.1 Instances and Schemas Similar to types and variables in programming languages Schema the logical structure of the database Example: The database consists of information about a set of customers and accounts and the relationship between them) Analogous to type information of a variable in a program Physical schema: database design at the physical level Logical schema: database design at the logical level Subschemas Schemas at the view level that describes different views of the database. Instance the actual content of the database at a particular point in time Analogous to the value of a variable Physical Data Independence the ability to modify the physical schema without changing the logical schema Applications depend on the logical schema In general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others

1.1.2 Data Models A collection of tools for describing Data Data relationships Data semantics Data constraints Provides a way to describe the design of a database at the physical, logical and view level. There are a number of different data models: Relational model Entity-Relationship data model (mainly for database design) Object-based data models (Object-oriented and Objectrelational) Semistructured data model (XML) Other older models: 1.2 Database Languages Network model Hierarchical model A database system provides a data definition language to specify the database schema and a data manipulation language to express database queries and updates. Data definition and data manipulation languages form parts of a single database language such as SQL. 1.2.0 Data-Manipulation Language (DML) Language that enables the users to access or manipulate data as organized by the appropriate data model. Types of access are Retrieval of information stored in the database. Insertion of new information into the database Deletion of information from the database Modification of information stored in the database. There are basically two types:

Procedural DMLs o User specifies what data is required and how to get those data Declarative DMLs(or NonProcedural DMLs) o User specifies what data is required without specifying how to get those data Query is a statement requesting the retrieval of information. Query Language Portion of DML that involves information retrieval. There are a number of database query languages in use. SQL is the most widely used query language. 1.2.1 Data Definition Language (DDL) Specification notation for defining the database schema Example: create table account(account-number char(10), balance integer) DDL compiler generates a set of tables stored in a data dictionary Data dictionary contains metadata (i.e., data about data) Database schema Integrity constraints o Domain constraints Declaring an attribute to be of a particular domain acts as a constraint on the values it take. o Referential integrity (references constraint in SQL)

A value that appears in one relation for a given set of attributes also appears for a certain set of attributes in another relation. When a referential integrity constraint is violated, the action that caused the violation is rejected. o Assertions is any condition that the database must always satisfy. Domain & Integrity constraints are special forms of assertions. Example: Every loan has at least one customer who maintains an account with a minimum balance of $1000. Authorization Types of access permitted for the users on various data values in the database. Read Authorization (allows Reading of data) Insert Authorization(allows Insertion of new data) Update Authorization (allows Modification of data) Delete Authorization (allows deletion of data) Data storage and definition language Specifies the storage structure and access methods used 1.3 Database System Architecture 1.3.0 Overall System Structure: Database systems are partitioned into modules for different functions. Some functions (e.g. file systems) may be provided by the operating system. Components include: File manager manages allocation of disk space and data structures used to represent information on disk. Database manager: The interface between low-level data and application programs and queries.

Query processor translates statements in a query language into low-level instructions the database manager understands. (May also attempt to find an equivalent but more efficient form.) DML precompiler converts DML statements embedded in an application program to normal procedure calls in a host language. The precompiler interacts with the query processor. DDL compiler converts DDL statements to a set of tables containing metadata stored in a data dictionary. In addition, several data structures are required for physical system implementation: Data files: store the database itself. Data dictionary: stores information about the structure of the database. It is used heavily. Great emphasis should be placed on developing a good design and efficient implementation of the dictionary. Indices: provide fast access to data items holding particular values.

Fig 1.2 Database System Structure 1.3.2 Database Architecture The architecture of database systems is greatly influenced by the underlying computer system on which the database is running. Database systems can be Centralized Client-server Parallel (multi-processor) Distributed

Database applications are usually partitioned into two or three parts as in Fig. 1.3 Fig 1.3 Two-tier and Three-tier Architectures. Two-tier Architecture The application is partitioned into a component that resides at the client machine, which invokes database system functionality at the server machine through query language statements. Application program interface standards like JDBC and ODBC are used for interaction between the client and the server. Three-tier Architecture The client machine acts merely as a front end and does not contain any direct database calls. Instead, the client end communicates with an application server, usually through a forms interface. The application server in turn communicates with a database system to access the data. Are more appropriate for large applications and for applications that run on the World Wide Web.

1.4 Database Users and Administrators A Primary goal of a database system is to retrieve information from and store new information in the database. People who work with a database can be categorized as Database Users Database Administrators Database User Users are differentiated by the way they expect to interact with the system Application programmers interact with system through DML calls Sophisticated users form requests in a database query language Specialized users write specialized database applications that do not fit into the traditional data processing framework Naive users invoke one of the permanent application programs that have been written previously Examples, people accessing database over the web, bank tellers, clerical staff Database Administrator(DBA) Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprise s information resources and needs. Database administrator's duties include: Schema definition Storage structure and access method definition Schema and physical organization modification

Granting user authority to access the database Specifying integrity constraints Acting as liaison with users Monitoring performance and responding to changes in requirements 1.5 Entity Relationship Model The entity-relationship (E-R) data model is based on a perception of a real world that consists of a collection of basic objects, called entities, and of relationships among these objects. An entity is a thing or object in the real world that is distinguishable from other objects. - For example, each person is an entity, and bank accounts can be considered as entities. Entities are described in a database by a set of attributes. - For example, the attributes account-number and balance may describe one particular account in a bank, and they form attributes of the account entity set. Similarly, attributes customer-name, customer-street address and customercity may describe a customer entity. An extra attribute customer-id is used to uniquely identify customers (since it may be possible to have two customers with the same name, street address, and city). A unique customer identifier must be assigned to each customer. A relationship is an association among several entities. - For example, a depositor relationship associates a customer with each account that she has. The set of all entities of the same type and the set of all relationships of the same type are termed an entity set and relationship set, respectively.

The overall logical structure (schema) of a database can be expressed graphically by an E-R diagram, which is built up from the following components: Rectangles, which represent entity sets Ellipses, which represent attributes Diamonds, which represent relationships among entity sets Lines, which link attributes to entity sets and entity sets to relationships Each component is labeled with the entity or relationship that it represents. As an illustration, consider part of a database banking system consisting of customers and of the accounts that these customers have. Figure 1.4 shows the corresponding E-R diagram. The E-R diagram indicates that there are two entity sets, customer and account, with attributes as outlined earlier. The diagram also shows a relationship depositor between customer and account. The entity-relationship model is widely used in database design.

Fig 1.4 A Sample ER diagram 1.6 Introduction to Relational Databases The relational model uses a collection of tables to represent both data and the relationships among those data. Each table has multiple columns, and each column has a unique name. Figure 1.5 presents a sample relational database comprising three tables: The first table, the customer table, shows, for example, that the customer identified by customer-id 192-83-7465 is named Johnson and lives at 12 Alma St. in Palo Alto. The second table, account, shows, for example, that account A- 101 has a balance of $500, and A-201 has a balance of $900. The third table shows which accounts belong to which customers. For example, account number A-101 belongs to the customer whose customer-id is 192-83-7465, namely Johnson, and customers 192-83-7465 (Johnson) and 019-28-3746 (Smith) share account number A-201 (they may share a business venture).

Fig 1.5 A Sample Relational database The relational data model is the most widely used data model a vast majority of current database systems are based on the relational model. Summary

A database-management system (DBMS) consists of a collection of interrelated data and a collection of programs to access that data. The data describe one particular enterprise. The primary goal of a DBMS is to provide an environment that is both convenient and efficient for people to use in retrieving and storing information. Database systems are ubiquitous today, and most people interact, either directly or indirectly, with databases many times every day. Database systems are designed to store large bodies of information. The management of data involves both the definition of structures for the storage of information and the provision of mechanisms for the manipulation of information. In addition, the database system must provide for the safety of the information stored, in the face of system crashes or attempts at unauthorized access. If data are to be shared among several users, the system must avoid possible anomalous results. A major purpose of a database system is to provide users with an abstract view of the data. That is, the system hides certain details of how the data are stored and maintained. Underlying the structure of a database is the data model: a collection of conceptual tools for describing data, data relationships, data semantics, and data constraints. The entity-relationship (E-R) data model is a widely used data model, and it provides a convenient graphical representation to view data, relationships and constraints. The relational data model is widely used to store data in databases. Other data models are the object-oriented model, the object relational model, and semistructured data models. The overall design of the database is called the database schema. A database schema is specified by a set of definitions that are expressed using a data definition language (DDL). A data-manipulation language (DML) is a language that enables users to access or manipulate data. Nonprocedural DMLs, which

require a user to specify only what data are needed, without specifying exactly how to get those data, are widely used today. Database users can be categorized into several classes, and each class of users usually uses a different type of interface to the database. A database system has several subsystems. The transaction manager subsystem is responsible for ensuring that the database remains in a consistent (correct) state despite system failures. The transaction manager also ensures that concurrent transaction executions proceed without conflicting. The query processor subsystem compiles and executes DDL and DML statements. The storage manager subsystem provides the interface between the low level data stored in the database and the application programs and queries submitted to the system. Database applications are typically broken up into a front-end part that runs at client machines and a part that runs at the back end. In two-tier architectures, the front-end directly communicates with a database running at the back end. In three-tier architectures, the back end part is itself broken up into an application server and a database server. Key Terms Database management system (DBMS) Database systems applications File systems Data inconsistency Consistency constraints Data views Data abstraction Database instance Schema Database schema Physical schema Logical schema Physical data independence Data models Entity-relationship model Relational data model Object-oriented data model

Object-relational data model Database languages Data definition language Data manipulation language Query language Data dictionary Metadata Application program Database administrator (DBA) Transactions Objective Questions 1. The ability to modify a scheme definition in one level without affecting a scheme definition in a higher level is called. a. Data dependence b. Data independence c. Database schema d. Data directory 2. Which users interact with the system without writing programs? a. Sophisticated b. Naive c. Application d. Specialized 3. The Entity-Relationship data model is an example of implementation data models a. True b. False 4. A language you can use to define tables, schemas, attribute domains and constraints is called. a. DDL b. DML c. SDL d. VDL 5. Which is used to specify database retrievals and updates? a. DDL b. DML c. SDL d. VDL 6. A collection of concepts for describing data is a. Data model b. Relation c. Instance d. Meta-data 7. What is a database?

a. An integrated collection of data organized to meet the needs of one or more users b. A place where no unnecessarily duplicated or redundant data c. A separate physical implementation from the logical structure of data d. All of the above 8. Which of the following is NOT an advantage of using databases? a. Controlled redundancy b. Access control c. lower cost d. Multiple userinterfaces 9. In ER diagram, entity set is represented by a. Triangle b. Rectangle c. Ellipse d. Double ellipse 10. Relational schema consists of list of attributes and their domain (a)true (b) False 11. The database manipulation language is a language that allows a. modification of the conceptual schema b. specification of updates and retrievals c. modification of the external schema d. the database structure to be modified Review Questions:: Part - A 1. What is DBMS? 2. Define database? 3. Give the application of DBMS? 4. What are the disadvantages of file processing system? 5. What are advantages of DBMS? 6. Define atomicity? 7. Define data abstraction? 8. Define data dictionary? 9. What is physical & logical data independence? 10. What are the different levels of data abstraction?

11. What is metadata? 12. Define instance and schema? 13. Define data model? 14. Define entity, attribute, and relationship? 15. Give the types of data model? 16. What is mapping cardinality? 17. Define DDL &DML? 18. What is query language and what are its types? 19. Difference between procedural & nonprocedural SQL? 20. What are the responsibilities of DBA? Part B 1. Outline the ANSI-SPARC 3-level DBMS architecture. Distinguish clearly between the levels 2. What are the advantages of DBMS over conventional file systems? 3. Briefly explain the 3 levels of data abstraction and the interrelationship among these levels 4. What are the responsibilities of a database manager and a database administrator? Explain the problems that would arise if the responsibility were not met 5. What is the difference between database schema and a database state? 6. " A major purpose of a database system is to provide users with an abstract view of the data." Do you agree? Why? 7. What is the difference between logical and physical views of data stored in a database? What are the reasons for making such distinctions? 8. What are the characteristics of Relational Model? 9. What are the characteristics and disadvantages of Network Model? 10. What are the characteristics and disadvantages of Hierarchical Model? 11. What are the characteristics of Object Model?