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

Similar documents
Database Management System. Fundamental Database Concepts

UNIT I. Introduction

CS425 Fall 2016 Boris Glavic Chapter 1: Introduction

Chapter 1: Introduction. Chapter 1: Introduction

Chapter 1: Introduction

A database management system (DBMS) is a software package with computer

Chapter 1: Introduction

Chapter 1: Introduction

Unit I. By Prof.Sushila Aghav MIT

Chapter 1: Introduction

Database Management Systems (CPTR 312)

Chapter 1: Introduction

Database Management System 9

Database Technology Introduction. Heiko Paulheim

Introduction Database Concepts

Chapter 11 Database Concepts

DATABASE MANAGEMENT SYSTEMS. UNIT I Introduction to Database Systems

Layers. External Level Conceptual Level Internal Level

Database System Concepts and Architecture

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

The functions performed by a typical DBMS are the following:

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

Solved MCQ on fundamental of DBMS. Set-1

Chapter 1 Chapter-1

CISC 3140 (CIS 20.2) Design & Implementation of Software Application II

Data, Databases, and DBMSs

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

Database System Concepts and Architecture. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

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

An Introduction to Databases and Database Management Systems.

Introduction to Relational Databases. Introduction to Relational Databases cont: Introduction to Relational Databases cont: Relational Data structure

Database System Concepts

COSC 304 Introduction to Database Systems. Database Introduction. Dr. Ramon Lawrence University of British Columbia Okanagan

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

Database System Concepts and Architecture

Bonus Content. Glossary

Database Principle. Zhuo Wang Spring

MIS Database Systems.

BIS Database Management Systems.

Course Logistics & Chapter 1 Introduction

Bottom line: A database is the data stored and a database system is the software that manages the data. COSC Dr.

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

Introduction: Database Concepts Slides by: Ms. Shree Jaswal

Course Introduction & Foundational Concepts

Database Environment. Pearson Education 2009

DATABASE MANAGEMENT SYSTEM COURSE CONTENT

Basant Group of Institution

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

Mahathma Gandhi University

CT13 DATABASE MANAGEMENT SYSTEMS DEC 2015

16/06/56. Databases. Databases. Databases The McGraw-Hill Companies, Inc. All rights reserved.

Databases The McGraw-Hill Companies, Inc. All rights reserved.

Relational Model: History

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

Chapter 1 SQL and Data

CHAPTER 2: DATA MODELS

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

Chapter 3. Database Architecture and the Web

Relational Model. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

DC62 Database management system JUNE 2013

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

Introduction to Databases

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

Chapter 1 Introduction


Database Management System 2

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

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

Introduction To Computers

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

Foreign and Primary Keys in RDM Embedded SQL: Efficiently Implemented Using the Network Model

Databases. Jörg Endrullis. VU University Amsterdam

Relational Database Systems Part 01. Karine Reis Ferreira

Data Base Concepts. Course Guide 2

File Processing Approaches

Database Fundamentals Chapter 1

Review for Exam 1 CS474 (Norton)

CHAPTER 2: DATA MODELS

2. An implementation-ready data model needn't necessarily contain enforceable rules to guarantee the integrity of the data.

UNIT 1 INTRODUCTION TO DBMS 1

Course Introduction & Foundational Concepts

DB Basic Concepts. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

Relation Databases. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift Jaipur Region. Based on CBSE Curriculum Class -11. Neha Tyagi, PGT CS II Shift Jaipur

SQL Interview Questions

Copyright 2004 Pearson Education, Inc.

THE RELATIONAL DATABASE MODEL

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

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

Interview Questions on DBMS and SQL [Compiled by M V Kamal, Associate Professor, CSE Dept]

Chapter 13 XML: Extensible Markup Language

Chapter 4. The Relational Model

The Relational Model

Lesson I. Database Management Systems

Administration Naive DBMS CMPT 454 Topics. John Edgar 2

Databases and Database Management Systems

COMP 3400 Mainframe Administration 1

CS317 File and Database Systems

Database Management System

Lecture2: Database Environment

Introduction to Relational Databases

Transcription:

Basic Concepts :- 1. What is Data? Data is a collection of facts from which conclusion may be drawn. In computer science, data is anything in a form suitable for use with a computer. Data is often distinguished from programs. A program is a set of instructions that detail a task for the computer to perform. In this sense, data is thus everything that is not program code. 2. What is Database? A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. A database is a collection of data, typically describing the activities of one or more related organizations. Database is a structured collection of records or data that is stored in a computer system. Entity/ Table Tuples / Records Attributes / Fields Name Address City PIN Mobile Raj Lakhsminagar Rajkot 360001 9898563214 Deepak Narayannagar Baroda 524413 9847562144 Vijay Kalawad Road Ah.bad 985542 9985774522 Dhaval Punit society Surat 254412 9996654711..... Prepared By :- Ajay A. Ardeshana Page # 1

Table A table is a collection of data arrange in row and column format. A database may contain one or more tables. Entity An Entity the distinguishable objects of real world. E.g.:- Student, Customer, Employee..etc Attributes An attributes are the set of properties processed by an entity. E.g.:- Name, Address, City, Mobile.etc Fields The title of the column that holds a specific type of data is known as field. A table can have maximum 255 fields. Tuples Each record row in a table is tuple. Records The collection of data horizontally for each field is known as record. A record is complete information about an entity. 3. Database Management System (DBMS):- 1. A Database Management System (DBMS), or simply a Database System (DBS) consist of : o A collection of interrelated and persistent data (usually referred to as the database (DB)). o A set of application programs used to access, update and manage that data (which form the data management system (MS)). 2. The goal of a DBMS is to provide an environment that is both convenient and efficient to use in : o Retrieving information from the database. o Storing information into the database. 3. Databases are usually designed to manage large bodies of information. This involves o Definition of structures for information storage (data modeling). o Provision of mechanisms for the manipulation of information (file and systems structure, query processing). o Providing for the safety of information in the database (crash recovery and security). o Concurrency control if the system is shared by users. Prepared By :- Ajay A. Ardeshana Page # 2

4. Advantages of Database Management System:- Database Management System (DBMS) aids in storage, control, manipulation and retrieval of data. This article lists the advantages of database management systems. Database is a software program, used to store, delete, update and retrieve data. A database can be limited to a single desktop computer or can be stored in large server machines, like the IBM Mainframe. There are various database management systems available in the market. Some of them are Sybase, Microsoft SQL Server, Oracle RDBMS, PostgreSQL, MySQL, etc. 1. Warehouse of Information :- The database management systems are warehouses of information, where large amount of data can be stored. The common examples in commercial applications are inventory data, personnel data, etc. It often happens that a common man uses a database management system, without even realizing, that it is being used. The best examples for the Prepared By :- Ajay A. Ardeshana Page # 3

same would be the address book of a cell phone, digital diaries, etc. Both these equipments store data in their internal database. 2. Defining Attributes :- The unique data field in a table is assigned a primary key. The primary key helps in the identification of data. It also checks for duplicates within the same table, thereby reducing data redundancy. There are tables, which have a secondary key in addition to the primary key. The secondary key is also called 'foreign key'. The secondary key refers to the primary key of another table, thus establishing a relationship between the two tables. 3. Systematic Storage :- The data is stored in the form of tables. The table consists of rows and columns. The primary and secondary key helps to eliminate data redundancy, enabling systematic storage of data. 4. Changes to schema :- The table schema can be changed and it is not platform dependent. Therefore, the tables in the system can be edited to add new columns and rows without hampering the applications, which depend on that particular database. 5. No Language Dependence :- The database management systems are not language dependent. Therefore, they can be used with various languages and on various platforms. Prepared By :- Ajay A. Ardeshana Page # 4

6. Table Joins :- The data in two or more tables can be integrated into a single table. This enables to reduce the size of the database and also helps in easy retrieval of data. 7. Multiple Simultaneous Usage :- The database can be used simultaneously by a number of users. Various users can retrieve the same data simultaneously. The data in the database can also be modified, based on the privileges assigned to users. 8. Data Security :- Data is the most important asset. Therefore, there is a need for data security. Database management systems help to keep the data secured. 9. Privileges :- Different privileges can be given to different users. For example, some users can edit the database, but are not allowed to delete the contents of the database. 10. Abstract View of Data and Easy Retrieval :- DBMS enables easy and convenient retrieval of data. A database user can view only the abstract form of data; the complexities of the internal structure of the database are hidden from him. The data fetched is in user friendly format. 11. Data Consistency :- Data consistency ensures a consistent view of data to every user. It includes the accuracy, validity and integrity of related data. The data in the database must satisfy certain consistency constraints, for example, the age of a candidate appearing for an exam should be of number datatype and in the range of 20-25. When the database is updated, these constraints are checked by the database systems. Prepared By :- Ajay A. Ardeshana Page # 5

5. Purpose of DBMS :- In the early days, database applications were built directly on top of file systems Drawbacks of using file systems to store data: 1. Data redundancy and inconsistency - Multiple file formats, duplication of information in different files 2. Difficulty in accessing data - Need to write a new program to carry out each new task 3. Data isolation multiple files and formats 4. 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 5. 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 6. 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 Prepared By :- Ajay A. Ardeshana Page # 6

7. Security problems - Hard to provide user access to some, but not all, data 6. Data Models :- A Collection of tools for describing : Data Data Relationship Add Semantics Data Constraints Relational Model Entity Relationship Model (for Database Design) Object base Data Model (for Object-Oriented) Semistructured Data Model (XML) Other Older Models : Network Model Hierarchical Model 6.1 Relational Data Model :- This Model uses a collection of tables to represent both data and the relationship among those data. Each table has multiple columns and each column has a unique name. It is an example of Record-Base a model. Database is structured in fix-format records of several types. This is the most widely used Data Model Prepared By :- Ajay A. Ardeshana Page # 7

Table Entity Attributes Fields Tuples Records A table is a collection of data arrange in row and column format. A database may contain one or more tables. An Entity the distinguishable objects of real world. E.g.:- Student, Customer, Employee..etc An attributes are the set of properties processed by an entity. E.g.:- Name, Address, City, Mobile.etc The title of the column that holds a specific type of data is known as field. A table can have maximum 255 fields. Each record row in a table is tuple. The collection of data horizontally for each field is known as record. A record is complete information about an entity. Prepared By :- Ajay A. Ardeshana Page # 8

Example :- Prepared By :- Ajay A. Ardeshana Page # 9

6.2 Entity Relationship Model :- It is based on the real world that consists of a collection of Basic Object called Entity. An Entity is a Thing or Object in the real world that distinguishable from other objects. For example a person is an entity and bank account can be considered as an entity. Entities are described in database by a set of Attributes. A Relationship is an association among several entities. Entity Attribute Relation Flow of Relationship A simple E-R Diagram for Customer and Account Relationship :- Prepared By :- Ajay A. Ardeshana Page # 10

6.3 Object Data Model :- It can be seen an extending the (E-R) Model with notations of: Encapsulation Methods (Functions) and Object identity Combines the features of Object-Oriented Data Model and Relational Data Model. 6.4 Network Model :- This model organizes data using two fundamental constructs, called records and sets. Records contain fields, and sets define one-to-many relationships between records: one owner, many members. Prepared By :- Ajay A. Ardeshana Page # 11

Access to the database was not via SQL query strings, but by a specific set of API s, typically for FIND, CREATES, READ, UPDATE and DELETE. Each API would only access a single table (dataset), so it was not possible to implement a JOIN which would return data from several tables. It was not possible to provide a variable WHERE clause. The only selection mechanism available was Read all entries (a full table scans). Read a single entry using a specific primary key. read all entries on a child table which were associated with a selected entry on a parent table Any further filtering had to be done within the application code. It was not possible to provide an ORDER BY clause. Data was presented in the order in which it existed in the database. This mechanism could be tuned by specifying sort criteria to be used when each record was inserted, but this had several disadvantages: Only a single sort sequence could be defined for each path (link to a parent), so all records retrieved on that path would be provided in that sequence. It could make inserts rather slow when attempting to insert into the middle of a large collection, or where a Prepared By :- Ajay A. Ardeshana Page # 12

table had multiple paths each with its own set of sort criteria. 6.5 Hierarchical Model :- In this model data is organized into a tree-like structure, implying a single upward link in each record to describe the nesting, and a sort field to keep the records in a particular order in each same-level list. A hierarchical database consists of the following: 1. It contains nodes connected by branches. 2. The top node is called the root. 3. If multiple nodes appear at the top level, the nodes are called root segments. 4. The parent of node nx is a node directly above nx and connected to nx by a branch. 5. Each node (with the exception of the root) has exactly one parent. 6. The child of node nx is the node directly below nx and connected to nx by a branch. 7. One parent may have many children. By introducing data redundancy, complex network structures can also be represented as hierarchical databases. This redundancy is eliminated in physical implementation by including a 'logical child'. Prepared By :- Ajay A. Ardeshana Page # 13

The logical child contains no data but uses a set of pointers to direct the database management system to the physical child in which the data is actually stored. Associated with a logical child are a physical parent and a logical parent. The logical parent provides an alternative (and possibly more efficient) path to retrieve logical child information. 7. DBMS Architecture :- o Three Levels of Architecture Prepared By :- Ajay A. Ardeshana Page # 14

1. External Level User s view of the database. Consists of a number of different external views of the Database. Describes part of the DB for particular group of users. Provides a powerful and flexible security mechanism by hiding parts of the DB from certain users. The user is not aware of the existence of any attributes that are missing from the view. It permits users to access data in a way that is customize to their needs, so that the same data can be seen by different users in different ways, at the same time. 2. Conceptual Level The logical structure of the entire database as seen by DBA. What data is stored in the database. The relationships among the data. Complete view of the data requirements of the organization, independent of any storage consideration. Represents: entities, attributes, relations constraints on data semantic information on data security, integrity information Supports each external view: any data available to a user must be contained in, or derivable from the conceptual level. Prepared By :- Ajay A. Ardeshana Page # 15

3. Internal Level Physical representation of the DB on the computer. How the data is stored in the database. Physical implementation of the DB to achieve optimal run time performance and storage space utilization. Storage space allocation for data and indexes Record description for storage Record placement Data Compression, encryption o Two-Tier Architecture Client manages main business and data processing logic and user interface. Server manages and controls access to database. Prepared By :- Ajay A. Ardeshana Page # 16

o Three-Tier Architecture Client side presented two problems preventing true scalability: Fat client, requiring considerable resources on client s computer to run effectively. Significant client side administration overhead. By 1995, three layers proposed, each potentially running on a different platform. User interface layer runs on client. Business logic and data processing layer middle tier runs on a server (application server). DBMS stores data required by the middle tier. This tier may be on a separate server (database server). Prepared By :- Ajay A. Ardeshana Page # 17

Advantages: Thin client, requiring less expensive hardware. Application maintenance centralized. Easier to modify or replace one tier without affecting others. Separating business logic from database functions makes it easier to implement load balancing. Maps quite naturally to Web environment. 8. Components of DBMS :- o Physical Components 1. Hardware Can range from a PC to a network of computers. 2. Software Prepared By :- Ajay A. Ardeshana Page # 18

DBMS, operating system, network software (if necessary) and also the application programs. 3. Data Used by the organization and a description of this data called the schema. 4. People Used by the organization and a description of this data called the schema. 5. Procedure Instructions and rules that should be applied to the design and use of the database and DBMS. o Logical Components 1. DDL The Data Definition Language (DDL) is used to create and destroy databases and database objects. These commands will primarily be used by database administrators during the setup and removal phases of a database project. Specific notation for defining the Data schema Example : Create Table Account ( Acc_No Char(10), Balance Integer ) DDL compiler generates a set of tables stored in a data dictionary Data Dictionary contains Metadata (Data about Data) Database Schema Data Storage and Definition Language Specifies the storage structure and access methods used Integrity Constraints Domain Constraints Prepared By :- Ajay A. Ardeshana Page # 19

Referential Integrity Assertion Authorization 2. DML Language for accessing and manipulating the data organized by the appropriate data model DML also known as query language Data Manipulation is: retrieval of information from the database insertion of new information into the database deletion of information in the database modification of information in the database Two Classes of Languages : Procedural : What Data is Required? How to get those Data? Declarative (Nonprocedural): What Data is Required? Without specifying How to get those Data? SQL is the most widely used Query Language. Dr. E.F.Codd s Rules :- The Information rule: All data should be in presented in table form. The Guaranteed Access rule: all data should be accessible without ambiguity. The Systematic Treatment of Null Values rule: a field should be allowed to remain empty. This involves the support of null values. Which is distinct form an empty string or a number with a value of zero. Prepared By :- Ajay A. Ardeshana Page # 20

The Dynamic Online Catalog Based on the Relational Model rule: a relational database must provide to access to its structure through the same tools that are used to access the data. The Comprehensive Data Sublanguage rule: the database must support one clearly defined language that include data definition language, data manipulation, data integrity and database transaction control. The View Updating rule: All views of the data which are theoretically updatable must be updatable in practice by the DBMS. The High-level Insert, Update, and Delete rule: The capability of handling a base relation or a derived relation as a single operand applies not only to the retrieval of data but also to the insertion, update, and deletion of data. The Physical Data Independence rule: Application programs and terminal activities remain logically unimpaired whenever any changes are made in either storage representations or access methods. The Logical Data Independence rule: how data is viewed should not be changed when the logical structure of the database changed. This rule is particularly difficult to satisfy. The Integrity Independence rule: Integrity constraints must be definable in the RDBMS. The Distribution Independence rule: An RDBMS has distribution independence. Distribution independence implies that users should not have to be aware of whether a database is distributed. The Nonsubversion rule: If the database has any means of handling a single record at a time, that low-level language must not be able to subvert or avoid the integrity rules which are expressed in a higher-level language that handles multiple records at a time. Prepared By :- Ajay A. Ardeshana Page # 21

Difference Between DBMS V/s. RDBMS :- DBMS RDBMS Data handle as a File oriented system Data handle as a in form of table DBMS does not support the client Most of the RDBMS support the client server Architecture server architecture DBMS does not support distributed RDBMS support distributed database databases There is no security of data There are multiple level of security DBMS may satisfy less than 7 rule of RDMS satisfy more than 7 rule of Dr. Dr. E. F. Codd E. F. Codd Field Record File -: Naming Conversion :- Columns, Attributes Row, Tuple, Entity Table, relation, Entity class Prepared By :- Ajay A. Ardeshana Page # 22