0% found this document useful (0 votes)
9 views20 pages

DB Chapter No 3

The document outlines the different database languages used in DBMS, including Data Definition Language (DDL), Data Manipulation Language (DML), and Data Control Language (DCL), explaining their functions and operations. It also discusses single-user and multi-user database environments, detailing client-server and three-tier architectures, along with their advantages and disadvantages. Key features of DBMS such as transaction support, concurrency control, and data independence are highlighted as essential requirements for effective database management.

Uploaded by

orwawajid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views20 pages

DB Chapter No 3

The document outlines the different database languages used in DBMS, including Data Definition Language (DDL), Data Manipulation Language (DML), and Data Control Language (DCL), explaining their functions and operations. It also discusses single-user and multi-user database environments, detailing client-server and three-tier architectures, along with their advantages and disadvantages. Key features of DBMS such as transaction support, concurrency control, and data independence are highlighted as essential requirements for effective database management.

Uploaded by

orwawajid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Instructor: Rimla Anwar

Following database languages are used in DBMS


1. Data Definition Language (DDL)

2. Data Manipulation Language (DML)

3. Data Control Language (DCL)


create table Employee(
DDL and DML are not separate languages. ID char(4),
name varchar(20),
They are the part of a single database dept_name varchar(20),
salary numeric(8,2))
language which is SQL (Structured Query
Language).
Following database languages are used in DBMS
Data Definition Language (DDL):
▪ Data definition language is used to describe logical
structure/schema of database.

▪ This language is used to define data and its structure.


create table Employee(
▪ With the help of this language, DBA
ID char(4),
name varchar(20),
1. CREATE,ALTER and DROP database instance. dept_name varchar(20),
2. CREATE, DROPANDALTER RELATIONS(Tables) salary numeric(8,2))

3. Describes Entities
4. DescribesAttributes (Metadata)
5. Describes Relationship
6. Describes Constraints.
Data Manipulation Language (DML):
▪ Data manipulation language is used to

manipulate data in database.

▪ DML is used to perform different


select name
operations on data. Some examples of from Employee
where ID = ‘343’
operations are

1. To view data from tables in database.


2. Insertion of new data into tables.
3. Modification of data stored in the database
4. Retrieval of data contained in the database
5. Deletion of data from the database
▪ Data manipulation language is further divided into two
categories.

1. Procedural DML
▪ User has to tell DBMS what to do and how to do. It is
tough job. More work is done by user. Hierarchal and
network models uses Procedural DML Language. C,
select name
Cobol, BASIC etc. from Employee
where ID = ‘343’
2. Non Procedural DML
▪ User just tells what to do NOT how to do. Manipulation
of data is easy. Less work is done by user and more
work is don’t by DBMS. Relational DBMS uses Non
procedural DML. It is also called “Declaration
Languages”. SQL, LISP etc.
Data Control Language (DCL):
▪ With the help of this language, DBA

controls database.

▪ DBA uses this language


1. To grant and revoke privileges to access
database.

2. To store and remove transactions which


can effect the database.
1. DBMS should allow multiple users to store data in database.

2. DBMS should allow multiple users to retrieve data from database.

3. DBMS should allow multiple users to update data in database.

4. DBMS should provide transaction support to users and must ensure that each transaction update
data successfully.
5. DBMS should provide concurrency control. Concurrency means accessing and performing
transactions on database by multiple users at same time.

6. DBMS should ensure consistency of data. Correct data values should be available to each users.
7. DBMS should ensure that multiple transactions from different users executing concurrently will
not violate database consistency. This is called “Concurrency Transparency”
8. In case of some failure, DBMS should provide some mechanism for recovering from failure.
9. DBMS must provide a mechanism that only authorized persons should be provided access to
database.

10. DBMS must ensure data independence i-e there must be clear separation between users and

details and structure of stored data.


11. DBMS should also provide the facility of communicating data to authorized users when

necessary.

12. DBMS should be able to import and export data from database as per users requirement.

13. DBMS must support certain utility software like report generators or form builders in order to

facilitate users.
Single User Database Environment
The database environment which supports only one user accessing the database at a
specific time.
The DBMS might have a number of users but at a certain time only one user can log into
the database system and use it.
This type of DBMS systems are also called Desktop Database systems.

Multi-User Database systems


The DBMS which can support a number of users simultaneously interacting with the
database indifferent ways.A number of environments exist for such DBMS.
1. Teleprocessing
2. File Servers
3. Client-Server
TELE PROCESSING
▪ In this multiuser database
system, a central
computer has database.

▪ Different users request to that central computer

usually by a dumb terminal.

▪ Transactions are performed at central computer

and results are sent back to dumb terminals.

▪ It has become obsolete now.


FILE SERVERS

• In this multiuser database environment, database is

present at central server.

• File server maintains a connection between the users of

the database system.


• Each client of the network runs its own copy of the

DBMS

• When a user needs data from the file server it makes a

request. Server sends complete file to the client


containing the required data.
▪ User may requests one or two records from the database but the server sends a complete

file, which might contain hundreds of records.

• Now if the client after making the desired operation on the desired data wants to write

back the data on the database he will have to send the whole file back to the server, thus
causing a lot of network overhead.

• The Good thing about this approach is that the server does not have lots of actions to do.
CLIENT SERVER

• This type of multi-user environment is the best


implementation of the network and DBMS

environments. This architecture is also called 2-Tier


client server architecture.
• It has a DBMS server machine which runs the DBMS

and to this machine are connected the clients having


application programs running for each user.
• Once a users wants to perform a certain operation on

data in the database it sends its requests to the DBMS


through its machine’s application software; the request
is forwarded to the DBMS server which performs the
required operation on data in the database stored in the
computer and then passes back the result to the user
intending the result.

• This environment is best suited for large enterprises

where bulk of data is processed and requests are very


much frequent.
It is basic client server model which is also called two tier
architecture.
First Tier:
▪ Client at first tier has application program and user interface.
▪ User enters data in UI and application program processes this
input and generates relevant query for this input.
▪ The application on client side establishes a connection with the
server to communicate with DBMS.
▪ Client side application uses APIs(Application Program Interface)
like ODBC, JDBC to establish a connection with server.
Second Tier:
▪ Server at second tier has database and DBMS.
▪ Server is responsible for query processing and other management
facilities.
Examples:
Railway booking system.
Pharmacy system

Advantages:
▪ Easy to manage.
▪ Maintenance is very easy.
Disadvantages:
▪ Scalability is very difficult.
▪ Lots of load on server if number of users are increased.
▪ Security issues may arise because client directly connects
database server.
In three tier architecture, another layer is present
in between client and server. This layer contains
Application Server.

First Tier:
▪ Client is present at first tier.
▪ First tier is also called “Client tier”/
“Presentation Layer”.
▪ This tier or layer contains only user interface
part of our application.
▪ The user interface is used to take input from user
and provide data to user.
▪ Client cannot directly communicate with server.
Second Tier:
▪ Application server is present at second tier.
▪ Second tier is also called “Business Tier or
Business Layer”.
▪ This tier act as interface between client layer
and data layer.
▪ When user enters data in user interface, this
data first comes to application server for
processing and specific query is generated
against each request.
▪ This query is sent to database server.
▪ Client layer communicates with database
server/data layer by using business layer.
Third Tier:
▪ Database server is present at third tier.
▪ This tier is also called “Data layer”.
▪ Database server at third tier contains database.
▪ Database server at data layer receives query
from application server, processes this query
and provides output to application layer. This
output is further sent to the user by application
layer.
Examples:
Web applications use 3 Tier Architecture.

Advantages:
▪ Scalability is easy.
▪ Less burden on server.
▪ Security is improved as clients are not directly
connected with server.
Disadvantages:
▪ Management is tough.
▪ Maintenance is difficult.
▪ Complexity is increased.

You might also like