Posts

Showing posts from July, 2021

Entity - Relationship model

Image
The E – R data model employs three notations:  Entity sets,  Relationship sets, and  Attributes. 1.  Entity sets An entity is a thing or object in real world that is different from other objects. For example, each employee in a company is an entity. An entity has a set of properties, and unique value for some properties. For example, the employee may have employee_id property whose value uniquely identifies the employee. Thus, 0201 value for employee_id would uniquely identify the employee in a company. An entity set is a set of entities of the same type that may share same properties, or attributes. For example, the set of all persons who are employees at a company can be defined as the entity set employee. Entity sets do not need to be disjoint. For example, a person may be an employee entity, a customer entity, both or neither. An entity is represented by set of attributes . Attributes are properties possessed by each member of the entity set. Each entity may

Application Architecture in DBMS

Image
  Database applications are usually divided into two or three parts. In a two – tier architecture , the client machine uses query language statement and invokes database system functionally at the server machine. For interaction between the client and the server, application program interface like JDBC and ODBC are used. In a three – tier architecture , the client machine acts as a front end and do not directly call database. Instead, it communicates through forms interface with an application server, and the application server communicates with the database to access data. Figure – 1: Two – tier and three – tier architecture

Database System Structure

The functional components of the database system can be divided into two components: the Storage manager and the Query processor.  1.   Storage Manager A storage manager is a program which provides interface between low – level data, the application programs and queries submitted to the system. It also interacts with the file manager. The storage manager translates various DML statements into low – level file – system commands. It is also responsible for storing, retrieving, and updating the data stored in the database. The components of storage manager include:  Authorization and integrity manager : checks the authority of the users to access the data and tests for the satisfaction of integrity constraints.  Transaction manager : ensures consistency of database despite system failures, and concurrent transaction execution without conflict.  File manager : manages space allocation on disk storage and data structures used to represent the information stored on disk.  Buffer manager :

Database Users and Administrators

People who work with database can be categorized into two: Database Users and Database Administrators. Database Users and User Interfaces There are four types of the database users, classified by the way they interact with the system. Different types of interfaces are designed for different users. Naïve Users : are inexperienced users who interact with the system by using one of the previously written application programs. For example, if user wants to transfer ₹1000 from account A to account B . This program asks user for the amount to be transferred, from the account from which amount is transferred, and account to which it has to be transferred.  Application Programmers : are computer professionals who write the application programs. Rapid Application Development (RAD) tools are used to generate forms and reports without writing a program. The fourth – generation languages, combine imperative control structures with statements of the data manipulation language.  Sophist

Database Languages

Two types of languages are there:  1.   Data – Definition Language (DDL)  2.  Data – Manipulation Language (DML) 1. Data – Definition Language (DDL)  A Data – Definition Language specifies the database schema by set of definitions.  For example, create table customer (cust_name char (20), cust_number integer , cust_address char (50), cust_city char (20), cust_pincode integer ) On executing the above DDL statement, the customer table is created and also updates special set of tables called the data dictionary or data directory . A data dictionary contains metadata , which is data about data. The example of the metadata is the schema of the table. Before modifying or reading actual data, the database system consults the data dictionary.   The implementation details of the database schema, which are hidden from the users, are defined by the data storage and definition language statements. 2. Data – Manipulation Language (DML)  The Data – Manipulation Language expresses datab

Data Models in DBMS

Image
Data model is a collection of conceptual tools for describing data, relationships of data, data semantics, and consistency constraints. There are two models to describe the design of the database at the logical level.  The entity – relationship model The entity – relationship (ER) data model consists of a collection of basic objects, called entities , and of relationships among these objects. Entities are described by set of attributes in the database. For example, the attributes employee_name and employee_salary may describe particular information in a company, of the employee entity set. An extra attribute employee_id is used to uniquely identify the employees.  A relationship is an association among several entities. The overall logical schema of the database can be represented graphically by an E – R diagram . It consists of following components: ·        Rectangles , to represent entity sets ·        Ellipses , to represent attributes ·        Diamonds , to represe

View of Data in DBMS

Image
The major goal of a database system is to provide user the abstract view of data, that is, the system hides certain details of how the data is stored and accessed.  1.     Data Abstraction:   To simply the user interaction with the system, the developers hide the system complexity through several levels of abstraction: Physical level: This is the lowest level of abstraction. It hides from the user how the data are actually stored. It also describes the complex low level data structure in detail. Logical level: This is next higher level of abstraction. It describes what data are stored in database and what relationship exists among these data. It thus describes the database in simple structure.  View level: This is the highest level of abstraction. The system may provide many views of the same database. The view level describes only a part of the entire database to simplify the interaction with the user. Figure 1: The three levels of data abstraction For example, in P