Data base systems INTRODUCTION The primary memory of a computer is limited and hence programs and data are

deleted from primary memory once their use is over. These programs and data are organised into files for permanent storage on secondary storage device for reuse. These files are structured in a particular way depending upon the type of access required and the media on which they are stored. If the data requires quick access, it is stored on disks and if it requires only serial processing the data is usually stored on tape. The file is made up of a number of records. The records are a group of fields and each field is made up of some bits of data. Each file is given a name for its identify. The name generally consists of two parts: the first is a single-word name and the second, a three-letter extension name to indicate the type of file. For instance .COB, . PRG etc. for program files and .OBF, .OAT etc. for data files. For example, in stock.dat, stock is the first part of the file name and .dat is the extension. A file holds records of logically similar data. Each record consists of a set of fields for data. Each field holds. data of defined nature like date field holds only dates, name field holds only names, etc. The computer files are organised on physical storage devices like magnetic tape, disk and CD-ROM. Data and Information Dat,a is the result of measurements of various attributes of entities such as product, student, inventory item and employee. The measurements may be recorded in alphabetical, numerical, image, voice or other forms. Thus, the raw and unanalysed numbers and facts about entities constitute data. On the other hand information results from data when they are organised or structured in some meaningful ways. The processed data have to be placed in a context for have them to derive meaning and relevance. Relevance in turn adds to the value of information in decisions and actions. Data processing requires some infusion of intelligence ( meaning, purpose and usefulness) into data to generate information. The application of intelligence may be in the form of some principles, knowledge, experience and intuition to convert data into information. Definition of Information The term 'information' is a very common word and it conveys some meaning to the recipient. Itis very difficult to define it comprehensively. Yet, Davis and Olson 1 give a fairly good definition. They define information as "data that has been processed into a form that is meaningful to the recipient and is of real or perceived value in current or prospective actions or decisions". This implies that information is: Processed data It has a form

• . It is meaningful to the recipient It has a value, and, • It is useful in current or prospective decisions or actions. Differences between data and information Though the words 'data' and 'information' are often used interchangeably, there is clear distinction between the two. Some of the major differences are as follows: Data are facts but information, though based on data, is not fact. • Though information arises from data, all data do not become information. There is a lot of selective filtering of data before processing them into information. • Data are the result of routine recording of events and activities taking place. Generation of information is user-driven which is not always automatic. • Data are independent of users whereas information is user dependent. Most information reports are designed to meet anticipated information needs of a user or a group of users. That is, information for one user is very likely to be data for other users. Field, Record and File A file is a collection of related records. A record is made up of a number of fields to hold data items. Each field is made up of a number of storage spaces. Each storage space can hold a byte of information. A collection of logically related files forms a database. It usually contains quite a few files holding data, which can be accessed by many users.

Roll no, name, sex and address are the field names. Each field reserves some spaces for storage of respective data. For example, Roll No has a 7 byte storage space, Name has 30 bytes storage and so on. Roll No field holds data items 9501101, 9501105 and 9501112 as roll numbers of students. ARUN GOKUL, RAJESH KUMAR etc. are data items in the name field. Each line of fields relates to an entity: student. Attributes of the studententity such as roll no, sex and address become the field names.

ordering can be in the ascending order of roll no in case of a student file. it can be stored on disk device for efficient file processing. File Organisation The file organisation means the way the records are written up in a file and depends on: (i) File activity. Serial file Organisation The records in a serial file are stored randomly and are generally appended at the end of a file as the data originate. File volatility means the proportion of record changes. disk medium is more efficient and offers a finite access. Sequential file organisation This file can be created on a magnetic tape or disk. . direct access for quick response (ii) Cost of storage medium (iii) Volume of storage. If records are changed very frequently.magnetic tapes are available. Logical design represents the logical relationship among the data items in the field. All attributes of an entity taken together form a record.esign can be logical or physical. The logical order of records with respect to a key field does not bear any relation to the order of physical storage of such records in the file. and. On the other hand magnetic disks offer more flexibility as they support both sequential access and direct access. (iv) Security of data Methods of File Organisation 1) Serial file organisation 2) Sequential organisation 3) Indexed sequential organisation 4) Direct file organisation 1. When such related records are put together. On the other hand. Other considerations in file organisation are: (i) Response time. For high volatility files such as seat reservation files in a transport firm. If only a few records are accessed in a single run. 2. that collection is called a file. If the file activity is low. The physical record design means the way data items are physically stored on some media like disk and tape. the file activity is high and such files can be stored on tapes so that processing is more efficient and less costly. and (iii) Storage device File activity means the properties of records processed in one run. If only. Record d. activity is low. (ii) Volatility of information.Data fields hold the basic elements of data in them. if a good number of records are accessed in any given time. Each record is written up on the tape or disk one by one logically ordered on one or more key fields. For example. the volatility is very high. then files are organised in sequential organisation. It is also referred to as non-keyed sequential file.

and product-code for an inventory file) to a numeric value. The access time of a single record depends on where in the file the record is stored. The advantages of sequential file are simple organisation and ease in accessing records sequentially. 1. This file organisation supports both sequential access ard random access of records in the file.The records are stored on a sorted order. random and dynamic. There are quite a number of ways of converting a key (such as roll no for a student file. Modes of File Access The computer file can be accessed in three modes: sequential. as there will be three files any time. called hashing. another new file has to be created to update the existing file with the changes to be effected since creation or last update of the file. The keys may be numeric. The index file holds pairs of key and storage address of records in the data file. The hashing function. and so on until the required record is reached. 2. it takes much less time to access than a record that is at the end of the file. Direct File Organisation These files are created on disks or CD-ROMs. Direct file supports direct access of files and minimises the access time of records. In direct file organisation a hashing technique is used to generate storage address of records in the file. the new records are bunched in a transaction file and the master file (that is the original file which is relatively permanent) is updated in a single run leading to the creation of a new master file. To minimise the cost of update. record 2. If new records are added or existing records are deleted. alphabetic or alphanumeric. h (k). if it is the first record in the file. The index file helps in randomly locating records in the data file as the physical storage location of the record is obtained from the index file. generates a value for each key. If the file is stored on a magnetic tape. In the case of alphabetic and alphanumeric keys. This is done to maintain the proper sequence of the records in the file. The records need not be sorted before storage as in an indexedsequential file. WhlCh is used as an address for storage location. Direct mapping is done by performing some arithmetic manipulation of the key value. 3.Random Access This method takes the same time for accessing the record . That is. This file update is called grand father-father-son update. the file has to be resorted in case of disk file. numeric key value has to be generated. 4. that is record 1. This file organisation creates an index file in addition to the data file created. Indexed-sequential file organisation An index is a combination of key and storage address of records.Sequential Access This means that for accessing a record sequentially. the file has to be read from the beginning.

the data must be stored in random access files. it may be required to start sequential access from a given record only. Methods of Updating Sequential file Sequential files can be updated in two ways: direct updating and grand father-father-son updating. The master files have to be made current by incorporating changes in data to the master files. This process is called file updating. master file. The two input files are the master files requiring updating and the Transaction file containing the transaction data of the period. For example a file holds 2000 records and records numbered 1220 to 1250 are to be accessed for processing. 3. Direct updating In case of direct update. The direct update keeps all files updated and enables real-time response. Deletion of records is also not possible. Data arising out of day-to-day transactions change very often and they are. deletion of a record from. In this case. There are three ways in which these changes are effected: addition of a record to master file. If data are very large or are likely to change occasionally. It saves disk space as transaction files are not opened for temporary storage of data. Examples of random access storage devices are magnetic disks. Master files are relatively permanent and are used for referring to the data there in when required. But it is very difficult to recreate a file if it is corrupted or deleted accidentally. that is no back up files are maintained.in the file wherever the record is physically located in the file. For direct updating. it is better to locate the record number 1229 randomly and access the remaining records in sequential mode. At times. and modification of a record held in. Grand Father-Father-Son update In this method two files are used as input files and they result in the creation of a new updated master file. such data are held in a master file. Both the files are to be sorted in the same order on the same key before updating starts. the data are processed online and files are updated directly. therefore. held in a temporary file called transaction file. The storage location of the record is obtained by converting the key value of the record into its numeric location address by hash function. File Updating Updating of files means making" the file current by incorporating changes to the records held in it or adding new records to it. Updating Process Both the master file and transaction file are read (1) The keys are then compared .Dynamic Access This mode combines both sequential and random modes of access. Then the record is located directly. magnetic drums and CD·ROMs.

the particular record is randomly accessed and updated. created . In traditional file management system. Integrity can be maintained. Indexed file is highly suitable where quick response is required. Indexed File Updating Indexed file has random access capability. It does not contain any input or output data. applications owned their own data and it was not shared with other applications. The disadvantage of direct updating is that no back up files are maintained and it may be difficult to undo changes effected. Any record in the file can be read at any time. It stores transaction data. Updating is easier in case of indexed files as only those records requiring modification need only be read and modified. Indexed files allow direct updating. The input data may cause a change to operational data but are not part of the database. track and sector number) according to the contents of the key field. airline reservation or railway reservation requires direct updating. The database system gives centralised control over the database resources. (4) If the master file key is greater than transaction file key.(2) If the master file key is less than the transaction file key. The record is copied to the new master file. then the record is to be either deleted or modified. (3) If the master file key is equal to Transaction file key. Each application defined its data. The concept of IRM calls for treating information as an organisational resource. be enforced. Inconsistency can be avoided. then it means that the transaction file record is new and is therefore to be copied to the new master file. no change is required. Security restrictions can be applied. The key chosen must be able to identify a record uniquely. The input data and output data are transient and they are not stored in the database. and. the output data mean the reports or query responses from the system. The data can be shared. Whenever any change in data takes place. The advantages of centralised control over the data are1: Redundancy can be reduced. Standards can. for example. Database System A database is a set of logically connected data files that have common access methods between them. (5) Three generations of files are maintained always. Indexed file or Indexed sequential file organisation keeps in addition to data files an index or table that lists the address of records on disk (namely. Similarly. Hence the name Grandfather-father-son update.

It also authorises people to access data for various data processing activities. as the related files were not updated simultaneously. Since the data are programindependent. Thus. It can evolve as the number of applications and queries increase to meet their data requirements. Advantages of Database Systems The database system approach has the following advantages • Data independence The data are logically designed into databases and they are independent of applications. • Data integrity Access to the database is controlled by the database management system. It performs a number of tasks like controlling access to the database. integrated collection of logically organised data. making security checks etc. Thus applications like payroll. The central control ensures data sharing among applications and enforces database security procedures. • Data shareability Database permits simultaneous multiple access to the database. Database is a centrally controlled. The system authorises personnel for entering. The data items in the database are logically related and this helps in integration of database.its file structure and stored the data conveniently to be accessed by its application program. Components of Database System The common database components are: Database files The database files store the transaction data. there is little chance of inconsistency in the database. • Data availability The database is centrally controlled and access to data is permitted through an authorisation scheme. any application can use them without any modification to the code. Often application programs had to be modified to use data files of other applications. editing and deleting data. Several applications stored the same data item in many files. The data resources are therefore available to the users in the organisation subject to the authorisation procedure. owned their own data. DBMS It is a set of programs that manages the database. Host level language interface system This system interacts with application programs and interprets their data requests that are issued in high-level . • Data evolvability The database is flexible and can store huge quantity of data. Since the database stores one data item only in one place and updates it with fresh transaction data automatically. inventory management etc. multiple users can share the same data. This caused a lot of duplication in data storage and the consequent data inconsistency.

It defines each data item in the database. It controls access to files. the user needs to specify both the data and its storage location. It might also produce documents like invoice and process ad-hoc queries and special report requests. DBMS is general-purpose system software. . DBMS maintains database by adding. Its tasks include defining. designing. data structures. Constructing database means storing the data on storage medium under the control of the DBMS. The data independence permits the applications to use the data for a variety of purposes. Natural language interface DBMS needs to process queries and data requests issued to it in natural languages called English-like language. It permits multiple users to access the same files simultaneously. storage constraints etc. process.language. Users of Database Systems There are three broad classes of users for organisational database systems. control and manage data. person authorised to modify it etc. constructing. Data Dictionary The data dictionary contains schema of the database. Database Management System (DBMS) DBMS is a set of system programs that manages the entire database. Application programmers who write application programs that manipulate the data in the database. In traditional file management system. 3. 2. They are: 1. Application programs The application programs request for data from the database. Database Administrator who is responsible for planning. The natural language interface performs interpreting the queries and requests in natural language. retrieve. Database manipulation includes merging databases. It also facilitates managerial interac. the DBMS processes the request. It updates files and retrieves data from the files on request by applications for processing. Report generator The system generates output for users in the form of query response or reports. It acts as an interface between the application programs and the data in the database. End-users who access the database by invoking application programs or through a structured query language. deleting and modifying records in database. If the user wants some data from the database. and.tion with the database for decision support applications. locates the data in the database and displays them for the user. creating and maintaining the database. store. and manipulating database for applications. DBMS requires storing the database on direct access storage devices. source. Defining database involves specifying data types. It works in conjunction with the operating systems to create. lists its structure.

processing queries etc. many of which are 3GLs or 4GLs. DBMS uses data dictionary to store all details of data such as data definition. design. data use and access privileges. and later developing and extending it to meet growing organisational requirements. Database Administrator (DBA) Organisations that implement database systems constitute a function called database administration to supervise the organisational database resources. its creation etc. It defines relationships between different data elements and serves as an interface for application programs that use the data. can only be done by the database administrator. The data manipulation language is usually integrated with other programming languages. Hence there is no universal query language. Data Dictionary Data dictionary is an electronic document that contains data definition and data use for every data type in the database. The three main components of a DBMS are data definition language. Database Manipulation Language Data is processed and updated using a language called data manipulation language. data integrity. data manipulation language. use. Query language is used to access the data for report generation. Data Definition Language The contents of database are created using the data definition language. Structured Query Language (SQL) is a non-procedural language that deals with data. and data dictionary. • Establishing the database and monitoring the use of .generating reports. It describes the data and its characteristics such as its location. He maintains the schema and data dictionary. The job of database administrator is to plan. Any change in the form of data item. modify and maintain the database of the organisation with special emphasis on security and data integrity. ownership and methods of accessing and security of data. create. data access. It allows a user to query database and receive summary or customised reports. query processing and other data processing activities. It identifies its origin. data retrieval. data storage. Database administrator supervises the database administration function. size and type. He is not much concerned with the details of the application programs that access the database for data. data query and data security. Each database package has its own query language with unique rules and instruction formats. His specific responsibilities include: • Guiding the initial design of the database. data manipulation. Most DBMS packages use some version of SQL whose primary purpose is to allow users to query a database and generate ad-hoc reports that provide customised information.

He has to see that the relevant data are collected and stored in the database. Data insecurity and integrity Most of the security and integrity problems are related to the fact that many users have access rights to the database. and additional processing power. This is due to the strict and elaborate procedure for data access. network and relational structures. Elaborate security systems are implemented to protect the database and to prevent unauthorised access. The records or aggregates of data are logically conceived to be stored at different levels of hierarchy. • Establishing and monitoring database control and . • Deciding on the content of the database. Any data element can be related to any number of . In a hierarchical database. it allows many-to-many relationships among records. This structure permits multiple relations between data items. Most organisations do not have enough personnel with necessary expertise to implement and manage database systems.it. One record can be linked to only record at the higher level. updating and processing. Disadvantages of Database The following are some of the disadvantages of database: Higher data processing costs The database system causes higher data processing costs. greater communication capability (including communication software). They are hierarchical.security policies and procedures. the relationship between records is one of parent-child. That is. One entity linked up to any number of other types of entities. This increases the hardware and software costs. Network Structure This structure can represent more complex logical relationships. The relation between entities is structured in such a way as to link it with only one data item at the higher level. Increased hardware and software costs It requires more direct access memory capacity. Insufficient database expertise Database technology is complex. There are three basic ways of organising data in a database. Data stored in a lower level node (child record) can be accessed only through the higherlevel node (parent record). The structure looks like a tree with branches turned upside down. Hierarchical Structure The relationships between records form a hierarchy. Database Architecture The purpose of database is to facilitate huge storage and quick retrieval of data from the database. • Servicing database users by educating and training them in the use of the database.

businesscomputing technologies concentrated on data capture storage and retrieval.F. Each column contains the data related to a single attribute of the entity . Data warehousing means organising large amounts of data and making them available company-wide to users. All data elements stored in the database are conceived to be stored in tables. machine learning. Data Mining and Data Warehousing Large organisations have huge quantity of data in their databases and they are still growing. Data mining is the focus of the new class of technologies being developed to help business find meaning in data lying idle. some very old like the statistical techniques including linear programming. The focus has shifted from data storage and retrieval to data analysis for making inferences. Relation model is most successful mode of all three models. But. Codd . the need to interpret and find patterns in the huge data is growing and computing technologies are making it possible now. The quality and quantity of data available for data mining is a function of data warehousing. Until recently. The information can be used in product development.warehousing. products and markets betteT. Data mining employs a host of techniques. Huge databases have necessitated the need for data . Different data tables are linked up using common type of data item in different tables. Designed by E.other data elements. Relational Structure Relational Slructure is the most recent of these three structures. Data warehousing is an integral part of data mining. relational model is based on the theory of sets and relations of mathematics. The data mining helps in drawing inferences from the data and in understanding the customer. Each row contains data related to an entity such as a student. The table is called a relation. product customisation and target marketing. Data mining helps in identifying preferences of customers groups and deciding on promotional material to influence their buying habits. These techniques help in discovering new patterns in data. online analytical processing etc. Relational Database Management System (RDBMS) A DBMS that is based on relational model is called as RDBMS. Data mining represents a new trend in the use of information technology. and others are recently developed and are known as data analysis. Relational model represents data in the form a table. the columns of the table are called domains and the r0WS are called tuples. A tuple contains values of data items called data elements of an entity. A table is a two dimensional array containing rows and columns.

course is another attribute and so on.a-days. Tuple / Row A single row in the table is called as tuple. now. This is used to refer to the .such as student name. Column Name Each column in the table is given a name. One of the reasons behind the succes s of relational model is its simplicity. Another important advantage with relational model. Figure 1 shows how data is represented in relational mo del and what are the terms used to refer to various components of a table. Each row represents the data of a single entity. Instead it allows you to have dynamic relationship between entities using the values of the columns. Almost all Database systems that are sold in the market. it doesn’t bind data with relationship betwe en data item. The fol lowing are the terms used in relational model. For exa mple. have either complete or partial implementation of relational mod el. This name is used to refer to value in the column. if details of students are stored then student name is an attribute. It is easy to understand the data and easy to manipulate. Attribute / Column A column stores an attribute of the entity. Table Name Each table is given a name. compared with remaining two models is.

table. The name depicts the content of the table. If you tak e STUDETNS table. Each row in the table contains roll number of the student. employee number of an employee Composite Primary Key In some tables a single column cannot be used to uniquely identify entities (rows). Each student’s data in the table must be uniquely identified. In c ase of STUDENTS table (see figure 1) we can use ROLLNO as the primary key as it in not duplicated. The following are two other terms. we have PAYMENTS table. Some other examples for primary keys are account number in bank. That colum n. it contains data related to students. In that case we have to use two or more columns to uniquely identify rows of the table. that are very important in relational model. payment date and amount paid. Primary Key A table contains the data related entities. Neither of the columns can uniquely identify rows. which contains th e details of payments made by the students. So we have to combine ROLLNO and DP to uniquely identify rows in t he table. For each student there will be one row in the table. So a primary key can be defined as a set of columns used to uniquely identify rows of a table. primary key and f oreign key. In o rder to identify each entity uniquely in the table. As primary key is consisting of two columns it is called as composite primary k ey . When a primary key contains two or more columns it is cal led as composite primary key. which is used to uniquely identify entities (students) in the table is called as pr imary key. we use a column in the table. In figure 2. product code of products.

As we already h ave ROLLNO column in PAYMENTS table. Roll number in PAYMENTS table can be used to obtain remaining information about the student. . So foreign key is the key on the many side of the relationship. Roll number column of PAYMENTS table is called as foreign key as it is used to join PAYMENTS table with STUDENTS table. To get remaining information about the student we have to use STUDETNS table. we often store data in differen t tables and put them together to get complete information. One student may make payment for many times.Figure 2: Composite Primary Key Foreign Key In relational model. The relationship between entities student and payment is one-to-many. it is possible to join with STUDENTS table and get information about parent entity (student). in PAYMENTS table we have only ROLLNO of the student. For example.

We must not have orphan records. Domain integrity Data is said to contain domain integrity when the valu e of a column is derived from the domain. If the value of date of joining is an invalid date. When a child table contains a row that doesn’t refer to a corresponding parent key. All valid dates form on e domain. The following are the main integrity rules that are to b e followed.Figure 3: Foreign Key ROLLNO column of PAYMENTS table must derive its values from ROLLNO column of STUDENTS table. So every effort is to be made to ensure data integrity is maintained. then it is said to violate domain integrity. Each entity that is stored in the table must be uniquely identifie d. Integrity Rules Data integrity is to be maintained at any cost. Entity integrity This specifies that all values in primary key must be not null and unique. If da ta loses integrity it becomes garbage. Every table must contain a primary key and primary key must be not null and uni . Domain is the collection of potential valu es. it is called as orphan record. as they are result of lack of data integrity. column date of joining must be a valid date. For example.

Intersect and Minus . See figure 4. All the values of ROLLNO column of BA TCHES table must be derived from ROLLNO column of STUDENTS table. Operators in relational algebra take one or more tables as parameters and produce one table as the result. The following are operators in relational algebra: Union Intersect Difference or minus Project Select Join Union This takes two tables and returns all rows that are belo nging to either first or second table (or both). then ROLLNO column of the table will be ref erencing ROLLNO column of STUDENTS table. This is because of the fact that no student who is not part of STUDENTS table can join a batch Relational Algebra A set of operators used to perform operations on tables is called as relational algebra . For example.que. Referential Integrity This specifies that a foreign key must be either null or must have a value that is derived from corresponding parent key. i f we have a table called BATCHES. Figure 4: Union.

See figure 5.5. See figure 1. not on how you get it. SQL is a non-procedural lang uage. . The tables being joined must have a common column. Structured Query Language (SQL) Almost all relational database management systems use SQL (Structured Query Language) for data manipulation and retrieval. Select Takes a sin gle table and returns a horizontal subset of the table . Select and Join Join Rows of two table are combined based on the given colum n(s) values.5. See figure 4. Figure 5: Project. Project Takes a single table and returns the vertical subset of t he table. Difference or Minus This takes two tables and returns all rows that exist in the first table and not in the second table. Put it in other way. SQL is the standard language for relational database systems.i ntersect This takes two tables and returns all rows that are belo nging to first and second table. where you need to concentrate on what you want. See figure 1 . you need not be concerned with procedural details. See figure 4. That means it returns only those rows that satisfy the condition.

All programs. invoked from clien ts (dumb terminals). CREATE TABLE.SQL Commands are divided into four categories. DML and Query are also collectively called as DML. there are three methods. For example. For example. Depending upon where it is done and how it is done. all terminals are attached t o mainframe. Mainframe is best example for this kind of processing. GRANT. Terminals do not have any processing ability. DCL commands are used to control access to data. Processing data means retrieving data and deriving information from data. Query is used to retrieve data using SELECT. INSERT and DELETE are used to manipulate data. Th e entire data is stored and processed on mainframe. DDL (Data Definition Language) DML (Data Manipulation Language) DCL (Data Control Language) Query (Retrieving data) DDL commands are used to define the data. They take input from users . are executed on the mainframe and data is also stored in ma inframe Figure 6: Centralized data processing. As you can see in figure 6. And DDL and DCL are called as DDL Data processing Methods Data that is stored is processed in three different ways. DML commands such as. Centralized data processing De-centralized data processing Distributed data processing Centralized data processing In this method the entire data is stored in one place a nd processed there itself. depending upon what they do.

Each departmen t stores data related to itself and runs all programs that process its data. the following steps will t ake place: . See figure 7. As common data is to be stored in each machine. Decentralized data processing In this data is processed at various places. That means the data stored by two departme nts will not agree with each other. Data in this mode is duplicated. A typical examp le is each department containing its own system for its own data processing needs. it is called as redundancy . But th e biggest drawback of this type of data processing is that data is to be duplicated. This redundancy will cause data inconsistency. data process is distributed between client and server.and send output to users. for an example of decentralized data processing. as there is no means to store common data in one place and access from all machines Figure 7: Decentralized Data Processing Distributed Data Processing (Client/Server) In this data processing method. Server takes care of managing data. if you assume a process where we need to draw a graph to show th e number of students in a given month for each subject. For example. Client interacts wi th user.

whose methods are to be invoked by client to perform the required operation. which is sent to server.Figure 8: Distributed data processing . 2. The process is evenly distributed between client and server. The following is an example of 3-tier client server. This is also called as two-tier client/server architecture. If you look at the above process. Server then will query the database to get data rela ted to the month. takes the request from client and sends the request in the language understood by database server. client interacts with user and takes input (month name) from user and then passes it to server. w here client interacts with user on one side and interacts with application server on anothe r side. The lang uage used to send commands from client to server is SQL (see figure 8). the client and server are equally participating in the process. In this we have only two tiers (layers) one is server and another is client. which processes and validates data. The client will then use the data retrieved from data base to draw a graph. and will send data back to client. 1 First. That is the reason this type of data processing is ca lled as distributed. Applicatio n servers are generally object oriented. Application server takes some burden from database server and some burden from . C lient is a program written in one of the font-end tools such as Visual basic or Delphi. SQL Server etc. Server is a database management system such as Oracle. 3. They expose a set of object. Application.

Since the advent of web application we are also seeing more than 3-tiers. database server and application server may reside on different machines or on the same machine. SQL is a language commonly used in RDBMS to store and r etrieve da ta. Figure 9: 3-tier client-server architecture. sends request to web server. 4. SQL can execute queries against a database  . which may be an AS P or JSP. SQL is one of the most important languages if you are dealing with an RDBMS because total data access is done using SQL. Relational algebra is a collection of operator s used to operate on tables. Web server executes the request page.web browser. ASP or JSP will access application server. Primary key is used for unique identification of rows and foreign key to join tables. 2. Client. the following is the sequence in a typical web application. Application server then will access database server. which is called as n -tier architecture. In my opinion. 1. We will see how to practically use these operators in later chapter.client. For example. Summary A DBMS is used to store and manipulate data. In 3-tier client/server architecture. 3. A DBMS b ased on relational model is RDBMS.

procedures. and views .SQL can retrieve data from a database  SQL can insert records in a database  SQL can update records in a database  SQL can delete records from a database  SQL can create new databases  SQL can create new tab les in a database  SQL can create stored procedures in a database  SQL can create views in a database  SQL can set permissions on tables.