Database Management System: Unit I: Relational Databases

Views of Data

Relational Databases - Database Management System

Database is a collection of interrelated data and set of programs that allow users to access or modify the data.

Views of Data

AU: May-16, Marks 16

• Database is a collection of interrelated data and set of programs that allow users to access or modify the data.

Abstract view of the system is a view in which the system hides certain details of how the data are stored and maintained.

• The main purpose of database systems is to provide users with abstract view of the data.

The view of the system helps the user to retrieve data efficiently.

For simplifying the user interaction with the system there are several levels of abstraction - these levels are - Physical level, logical level and view level.

Data Abstraction

Data abstraction: Data abstraction means retrieving only required amount of information /of the system and hiding background details.

There are several levels of abstraction that simplify the user interactions with the system. These are

1) Physical level:

This is the lowest level.

This level describes how actually the data are stored.

This level describes complex low level data structures.

2) Logical level:

This is the next higher level, which describes the what data are stored in database.

This level also describes the relationship among the data.

The logical level thus describes then entire database in terms of small number of relatively simple structures.

The database administrators use logical level of abstraction for deciding what information to keep in database.

3) View level:

This is highest level of abstraction that describes only part of the entire database.

The view level can provide the access to only part of the database.

This level helps in simplifying the interaction with the system.

The system can provide multiple views of the same system.

Clerk at the reservation system, can see only part of the database and can access the required information of the passenger.

Fig. 1.3.1 shows the relationship among the three levels of abstraction.

For example: Consider following record

Type employee = record

empID:numeric(10)

empname:char(20)

dept_no:numeric (10)

salary:numeric(8,2)

end

This code defines a new record employee with four fields. Each field is associated with field name and its type. There are several other records such as

department with fields dept_no, dept_name, building

customer with fields cust_id,cust_name

At the physical level, the record - customer, employee, department can be Vibe described as block of consecutive storage locations. Many database systems hide lowest level storage details from database programmer.

The type definition of the records is decided at the logical level. The programmer work of the record at this level, similarly database administrators also work at this level of abstraction.

There is specific view of the record is allowed at the view level. For instance - - customer can view the name of the employee, or id of the employee but cannot access employee's salary.

Instances and Schemas

Schema: The overall design of the database is called schema

For example - In a program we do variable declaration and assignment of values to the variable. The variable declaration is called schema and the value assigned to the variable is called instance. The schema for the student record can be

Instances: When information is inserted or deleted from the database then the database gets changed. The collection of information at particular moment is called instances. For example - following is an instance of student database

Types of Schema: The database has several schema based on the levels of abstraction.

(1) Physical Schema: The physical schema is a database design described at the physical level of abstraction.

(2) Logical Schema: The logical schema is a database design at the logical level of abstraction.

(3) Subschema:A database may have several views at the view level which are called subschemas.

Database Languages

There are two types of languages supported by database systems. These are

(1) DDL

Data Definition Language (DDL) is a specialized language used to specify a database schema by a set of definitions.

•  It is a language which is used for creating and modifying the structures of tables, views, indexes and so on.

DDL is also used to specify additional properties of data.

Some of the common commands used in DDL are - CREATE, ALTER, DROP.) The main use of CREATE command is to build a new table. Using ALTER command, the users can add up some additional column and drop existing columns. Using DROP command, the user can delete table or view.

(2) DML

•  DML stands for Data Manipulation Language.

This language enables users to access or manipulate data as organized by appropriate data model.

The 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 database.

There are two types of DML -

Procedural DML - Require a user to specify what data are needed and how to get those data.

Declarative DML - Require a user to specify what data are needed without of au aw specifying how to get those data.

Query is a statement used for requesting the retrieval of information. This retrieval of information using some specific language is called query language.


Review Question

1. Briefly explain about views of data.   AU: May-16, Marks 16

Database Management System: Unit I: Relational Databases : Tag: : Relational Databases - Database Management System - Views of Data