You are on page 1of 23

FOUNDATION

A Database Management System(DBMS) is a collection of interrelated data and a set of programs to access those data. The collection of data is known as the database, contains information relevant to an enterprise.
A DBMS is a set of software programs that controls the organization, storage, management, and retrieval of data in a database. DBMSs are categorized according to their data structures or types. The DBMS accepts requests for data from an application program and instructs the operating system to transfer the appropriate data.

File processing is the process of creating, storing and accessing content of files. File processing can be used in opening saved files for read only purpose. It can be used to save a new file or displace the existing one. Through file processing you can make new files and save the existing files. You can also modify files through this process. Compressing files, folders, and programs decreases their size and reduces the amount of space they use on your volumes or removable storage devices.

Disadvantages of File processing System: 1. Data Redundancy and inconsistency- This means the repetition of same data in different files. E.g.: If we keep the attribute Custname in both the filesCustomer Details and Purchase files, then if there is a spelling mistake in one of the files then the same name in another file will be taken as a different record. So to reduce the confusion we can reduce the repetition of attributes and can keep only CustID as a reference for both the files instead of repeating the Custname. Repetition may also lead to higher storage and access cost.

2. Difficulty in accessing data- It does not allow to access data according to the requirement. Appropriate application programs may not be there to find out some data with specific conditions. 3.Data Isolation: As data is stored in different files with different extensions, extracting data from these files is difficult. 4.Integrity Problems- When we need to give some constraints to restrict some data retrieval it becomes difficult if the data required is stored in different files.

5.Atomicity problems- The transactions should be atomic i.e. This mainly occurs during system failure. E.g. If a system fails while a data transfer is happening from File A to File B then it may happen that that the data is removed from File A but was not transferred to File B due to system failure. Then this atomicity comes to picture, i.e. either a transaction should happen in full or it should not happen. 6. Concurrent access anomalies- It is difficult to stop simultaneous access to a particular data , which may lead to improper data storage.

7. Security Problem- It is difficult to keep restriction on access of different users to different files. The restriction is not possible as files are added to the file processing system in ad-hoc manner . DATA ABSTRACTION- the process of hiding all but the relevant data about an object in order to reduce complexity and increase efficiency. There are 3 levels in Data Abstraction: 1. Physical level : how the data is stored physically and where it is stored in database. 2. Logical level : what information or data is stored in the database (like what is the data type or what is format of data).

3.View level : end users work on view level. They can view only the required data after filtering. Instances and SchemasThe collection of information stored in the database at a particular moment is called an Instance of the database. The overall design of the database is called the database Schema(No of records + Type of data + No of attributes).It is changed infrequently, if at all. Schemas are of 3 types according to the 3 level of abstraction.

1. Physical Schema- Describes the database design at the physical level. 2. Logical Schema- Describes the design at the logical level. 3. Sub schemas- Describes different views of database at view level. DATA MODELS Underlying the structure of a database is the Data Model. It provides the design of a database at the physical , logical and view level.

1. Relational Model- This model uses a collection of tables to represent data and the relationship among those data. It is an example of record based model as database is structured in fixed format. Each column represents a fixed type of data. 2. The Entity Relationship Model- It deals with entities and relationship. Entities are real life objects and the relationship among these objects are shown. 3. Object Based Data Model- It is an extension of the ER model with encapsulation, functions and object identity.

DATABASE LANGUAGES-

Database language is mainly divided into datadefinition language(DDL) and datamanipulation language(DML). DDL specifies the database schema. DML is a language that enables users to access or manipulate data .

Types of Data Manipulation Language1. Procedural DMLs- requires a user to specify what data are needed and how to get those data. CREATE PROCEDURE proc2 AS DECLARE @middle_init char(1) SET @middle_init = NULL SELECT au_id, middle_initial = @middle_init FROM authors GO

2. Declarative DMLs- require a user to specify what data are needed without specifying how to get those data. Select * from Customer where customer.age>40 Declarative DMLs are easy to use and here we use query to retrieve data . The portion of a DML that involves information retrieval is called query language.

Data-Definition Language The storage structure and access methods used by the database system by a set of statements in a special type of DDL called a Data Storage and Definition language. The data values stored in the database must satisfy certain consistency constraints like: 1. Domain Constraints- Declaring an attribute for a particular domain (e.g.: integer type, character type, data/time type etc.)acts as a constraint on the particular value it takes. 2. Referential Integrity- It checks that a value that appears in one attribute should also appear for the other attribute in another table which has relation.

For Example : 2 files Customer file and Purchase file have a relation between them .They share some attributes like CustID. If you want to delete the details of a particular customer from the Customer table it will be restricted as the same customer may have some transactions in the Purchase table. 3. Assertions- They are conditions that a database must always satisfy . e.g. Employee file For the age attribute the condition is that it should be less than 65, so when a data is entered if it satisfies the condition it will be added otherwise not.

4. Authorization- The different types of authorization given to the user. a. Read authorization- The user can only read the data. b. Insert authorization- The user can only insert the data but cannot make any modification. c. Update authorization- The user can modify the data. d. Delete authorization- The user can delete the data.

RELATIONAL DATABASES A relational database is based on the relational model and uses a collection of tables to represent both data and the relationships among those data. Customer Table Attributes(Columns)
CustI D C001 C002 C003 CustN Phone ame Ram Raju Ravi 9876587947 9658125834 9980776722 Address Bangalore Delhi Chennai PurI D P001 P002 P003

Tuples(Row)

Purchase Table
Cust Productc ID ode C001 QR342 Quant Rat ity e 2 3 3 400 0 600 0 400 0

C003 RT567 C004 UI9876

In relational data base we can use both DataManipulation Language and also DataDefinition Language for executing queries(finding out specific data from table)and defining tables etc. DML is mainly used for executing queries.Example: select Customer.custname from customer where customer.address= Bangalore The result that will come out will be Ram .

We can use more tables in queries also: select purchase.productcode, purchase.custid from Purchase, Customer where Purchase.rate= 4000 and Purchase.custid = customer.custid The result will be C001 and QR342 DDL is mainly used for defining tables etc. create table Customer (Custid char(10), Custname char(25), Phone Int, Address char(45))

DATABASE ARCHITECTURE The database architecture is the set of specifications, rules, and processes that dictate how data is stored in a database and how data is accessed by components of a system. Mainly it is of 2 types: 1. Two-tier architecture- A Client/Server architecture in which the user interface runs on the client and the database is stored on the server. The actual application logic can run on either the client or the server.

2. Three Tier Architecture A special type of client/Server architecture consisting of three well-defined and separate processes, each running on a different platform: 1. The user interface , which runs on the user's computer (the client). 2. The functional modules that actually process data. This middle tier runs on a server and is often called the application server. 3. A database management system(DBMS)that stores the data required by the middle tier. This tier runs on a second server called the database server

Advantages of Database advantages include the database following: systems shared data; centralized control; redundancy control; improved data integrity; improved data security,

Disadvantages Disadvantages are as follows: of database a complex conceptual design system process;
the need for multiple external databases; the need to hire database-related employees; high DBMS acquisition costs; a more complex programmer environment; a longer running time for individual applications; and, highly dependent DBMS operations

You might also like