If you belive yourself, anything is possible.
--Your friends at LectureNotes

Note for Database Management System - DBMS by Manoj shetty7

  • Database Management System - DBMS
  • Note
  • Computer Science Engineering
  • B.Tech
  • 2 Topics
  • 1 Offline Downloads
  • Uploaded 1 year ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

GITAM School of Technology Department of CSE Chapter-1 Introduction to Database Management System Overview:  Data means known fact that can be recorded and that have implicit meaning.  A database is a collection of related data which are known facts that can be recorded and that have implicit meaning. o For example, consider the names, telephone numbers, and addresses of the people we know. We may have recorded this data in an indexed address book or you may have stored it on a hard drive, using a personal computer and software such as Microsoft Access or Excel. This collection of related data with an implicit meaning is a database.  A database management system (DBMS) is a collection of programs that enables users to create and maintain a database. The DBMS is a general-purpose software system that facilitates the processes of defining, constructing, manipulating, and sharing databases among various users and applications. o Defining a database involves specifying the data types, structures, and constraints of the data to be stored in the database. The database definition or descriptive information is also stored by the DBMS in the form of a database catalog or dictionary, it is called meta-data. o Constructing the database is the process of storing the data on some storage medium that is controlled by the DBMS. o Manipulating a database includes functions such as querying the database to retrieve specific data, updating the database to reflect changes in the miniworld, and generating reports from the data. o Sharing a database allows multiple users and programs to access the database simultaneously.  An application program accesses the database by sending queries or requests for data to the DBMS. A query typically causes some data to be retrieved. A transaction may cause some data to be read and some data to be written into the database.  Other important functions provided by the DBMS include protecting the database and maintaining it over a long period of time. Bhanujyothi H C, Assistant Professor Page 1

Text from page-2

GITAM School of Technology Department of CSE The below figure illustrates the database system. The database and DBMS software together is called as a database system. An example database     Consider a UNIVERSITY database for maintaining information concerning students, courses, and grades in a university environment. The database is organized as five files, each of which stores data records of the same type. To define this database, we must specify the structure of the records of each file by specifying the different types of data elements to be stored in each record. o For example: each STUDENT record includes data to represent the student’s Name, Studentnumber, Class and Major(like CS)such as freshman or ‘1’, sophomore or ‘2’, and so forth), and records and have many relationships among the records. We must also specify a data type for each data element within a record. o For example, we can specify that Name of STUDENT is a string of alphabetic characters, Studentnumber of STUDENT is an integer, and Grade of GRADE_REPORT is a single character from the set {‘A’, ‘B’, ‘C’, ‘D’, ‘F’, ‘I’}. Bhanujyothi H C, Assistant Professor Page 2

Text from page-3

GITAM School of Technology   Department of CSE To construct the UNIVERSITY database, we store data to represent each student, course, section, grade report, and prerequisite as a record in the appropriate file. The records in the various files may be related. For example, the record for Smith in the STUDENT file is related to two records in the GRADE_REPORT file that specify Smith’s grades in two sections. Figure:Adatabase that store student and course information  Database manipulation involves querying and updating. o Examples of queries are as follows: 1. A list of all courses and grades of ‘Smith’ may be retrieved. 2. List the prerequisites of the ‘Database’ course. o Examples of updates include the following: 1. Change the class of ‘Smith’ to sophomore. 2. Create a new section for the ‘Database’ course for this semester. Bhanujyothi H C, Assistant Professor Page 3

Text from page-4

GITAM School of Technology Department of CSE File system v/s DBMS System: File system: Data files are created and processed by programs written by programmers or users of files. File created by different users of the organization often contain redundant data. The application programs depend upon the structural properties of the files. The application programs Interact directly with the operating system. File system v/s DBMS  Data redundancy and inconsistency – Redundancy is the concept of repetition of data i.e. each data may have more than a single copy. The file system cannot control redundancy of data as each user defines and maintains the needed files for a specific application to run. There may be a possibility that two users are maintaining same files data for different applications. Hence changes made by one user does not reflect in files used by second users, which leads to inconsistency of data. Whereas DBMS controls redundancy by maintaining a single repository of data that is defined once and is accessed by many users. As there is no or less redundancy, data remains consistent.  Limited Data Sharing–Data are scattered in various files. Also different files may have different formats and these files may be stored in different folders may be of different departments. So, due to this data isolation, it is difficult to share data among different applications. Whereas in DBMS, data can be shared easily due to centralized system.  Concurrent Access Anomalies– Concurrent access to data means more than one user is accessing the same data at the same time. Anomalies occur when changes made by one user gets lost because of changes made by other user. File system does not provide any procedure to stop anomalies. Whereas DBMS provides a locking system to stop anomalies to occur.  Difficulty in Accessing Data– For every search operation performed on file system, a different application program has to be written. While DBMS provides inbuilt searching operations. User only has to write a small query to retrieve data from database.  Data integrity problem– There may be cases when some constraints need to be applied on the data before inserting it in database. The file system does not provide any procedure to check these constraints automatically. Whereas DBMA maintains data integrity by enforcing user defined constraints on data by itself.  Atomicity Problems -Atomicity means a transaction must be all -or-nothing i.e. the transaction must either fully happen, or not happen at all. It must not complete partially. Example: if A want to transfer 5000rs to B's account. In this case A's Account should be debited and B's account should be credited with the same amount. Let suppose A's account is debited with 5000rs and the transaction fails due to some problem. Now Bhanujyothi H C, Assistant Professor Page 4

Lecture Notes