0% found this document useful (0 votes)
74 views

Unit 1-Introduction of Dbms-1

Uploaded by

ommlachure
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)
74 views

Unit 1-Introduction of Dbms-1

Uploaded by

ommlachure
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/ 62

INTRODUCTION OF DBMS

1 Mr. Lalit P. Patil


Assistant Professor,
Department of Electronics and Telecommunication
Pune Institute of Computer Technology, Pune
[email protected], www.pict.edu
SCHEME
 Theory: DM
 Teaching Scheme: Lectures 3 Hrs /Week
 Examination Scheme:
 In Semester Assessment : 30 Marks
 End Semester Assessment : 70 Marks

 Practical: DM Labrotory
 Teaching Scheme: Practical: 2 Hrs /Week
 Examination Scheme:
• Oral : 25 Marks

Mr.Patil L. P.
CONTENTS
 Unit I: Introduction to DBMS : 07 Hrs

 Unit II: Relational Database Design


: 07 Hrs

 Unit III: Basics of SQL : 08 Hrs

 Unit IV: Database Transactions Management


: 08Hrs

 Unit V: Parallel Databases : 07Hrs


3
 Unit VI: Distributed Databases : 08Hrs
Mr.Patil L. P.
COURSE OBJECTIVES
 To understand fundamental concepts of database from its design
to its implementation.

 To analyze database requirements and determine the entities


involved in the system and with one another.

 To manipulate database using SQL Query to create, update and


manage Database.

 Be familiar with the basic issues of transaction processing and


concurrency control.

 To learn and understand Parallel Databases and its


Architectures.
4

 To learn and understand Distributed Databases and its


applications.
Mr.Patil L. P.
COURSE OUTCOMES:
• Recall data handling and operations on data using various data
structures and data types. Define database and file system to identify
limitations and scope further. Describe various data models, discuss
with examples an entity relational model with an appropriate relational
algebra.
• Apply the concept of relational model to design a database for a given
problem. Carry out normalization and decomposition techniques to
improve data relations.
• Prepare and Design relational database using SQL DDL/DML
commands to demonstrate various operations to give solutions to the
queries for developing databases. Construct advanced SQL queries on
data and write functions, procedures, cursors and triggers through
PL/SQL.
• Analyze transactions and concurrency control for given database.
Construct a model to manage schedule for recovery.
• List types of parallel and distributed databases, define and discuss
DBMS architectures for parallel, distributed and multiusers, describe 5
architecture, data storage and transactions.
Mr.Patil L. P.
COURSE OUTCOMES:
• Understand the database management system
software requirements and install MySQL software.
• Implement a project using the concept of relational
database model and database connectivity as an
individual and/or in a team and write a report and
draw conclusion at technical level.
• Implement a project using the concept of relational
database model and database connectivity as an
individual and/or in a team and write a report and
draw conclusion at technical level.

Mr.Patil L. P.
BOOKS
Text Books:
Text Books:
1. A. Silberschatz, H.F. Korth and S. Sudarshan , “Database System Concepts”,
McGraw Hill, 6th Edition.
2. C.J. Date, A. Kannan, S. Swamynathan “An introduction to Database
Systems”, Pearson, 8th Edition.

Reference Books:
1. Martin Gruber, “Understanding SQL”, Sybex Publications.
2. Ivan Bayross, “SQL- PL/SQL”, BPB Publications, 4th Edition.
3. S.K. Singh, “Database Systems: Concepts, Design and Application”, Pearson,
Education, 2nd Edition.

 MOOC / NPTEL Courses:


1. NPTEL Course “Database Management System”
Link of the Course: https://nptel.ac.in/courses/106/106/106106220/
7

Mr.Patil L. P.
UNIT 1

Introduction to database management system [DBMS]

Mr.Patil L. P.
DATA

 Facts and statistics


collected together for
reference or analysis.
 "Data" comes from a
singular Latin word,
“datum”, which
originally meant
"something given."
 Over time "data" has
become the plural of
datum.

Mr.Patil L. P.
DATA
 Data Phrases in Technology
 As technology advances and changes, numerous phrases have been used over
the years to describe data

 The data-related definitions are:

 Raw Data: Information that has been collected but not formatted or analyzed.

 Structured Data: Structured data refers to any data that resides in a fixed field
within a record or file. This includes data contained in relational databases and
spreadsheets.

 Unstructured Data: Information that doesn't reside in a traditional row-column


database.

 Big Data: A massive volume of both structured and unstructured data that is so
large it is difficult to process using traditional database and software techniques

 Big Data Analytics: The process of collecting, organizing and analyzing large sets of
data to discover patterns and other useful information. 10

Mr.Patil L. P.
DATA
 Data Center: Physical or virtual infrastructure used by enterprises to
house computer, server and networking systems and components for
the company's information technology (IT) needs.

 Data Integrity: Refers to the validity of data. Data integrity can be


compromised in a number of ways, such as human data entry errors
or errors that occur during data transmission.

 Data Miner: A software application that monitors and/or analyzes the


activities of a computer, and subsequently its user, of the purpose of
collecting information.

 Data Mining: A class of database applications that look for hidden


patterns in a group of data that can be used to predict future
behavior.

 Database: A database is basically a collection of information


organized in such a way that a computer program can quickly select
desired pieces of data.

11

Mr.Patil L. P.
DATABASE
 It is a collection of information arranged and
presented to serve an assigned purpose
 Example:

 Maintaining your own telephone diary

 Telephone directory

 Dictionary

12

Mr.Patil L. P.
TYPES OF DATABASES
 Centralized database
 Typically used by bigger organizations,
eg. business or university
 Cloud database
 The data is stored on a local hard drive or server,
but the information is available online.
 Distributed database
 Spread out over multiple devices which
increased speed, better reliability and ease of
expansion.
 End-user database
 Spreadsheet stored on your local computer.
13

Mr.Patil L. P.
TYPES OF DATABASES
 Object-oriented database
 The data is represented as objects and classes
 Open-source database
 An open-source database is designed for the public to use for
free.
 Operational database
 The purpose of an operational database is to allow users to
modify data in real-time
 Personal database
 NoSQL database
 Storage and retrieval of data other than tabular relations model
used in relational databases. allows them to process larger
amounts of data at speed and makes it easier to expand in the
future 14

 Relational database
Information is stored and retrieved in a structured way
Mr.Patil L. P.

OPPORTUNITY
 Data Manager
 A data manager supervises a company’s data systems and
ensures they are organized, stored and secure.
 Depending on the size of the company, a data manager
might work in a team of data operators or as an individual
 Data Analysts
 Data analysts organize and interpret large amounts of data
for others to easily understand.
 Business professionals use this interpreted data to make
business decisions
 Data Scientist
 Data scientists analyze raw data and synthesize it into
results that can be easily understood.
 data scientists use the data from their analyses to solve
real-world problems in business and politics 15

Mr.Patil L. P.
BANKING AND FINANCIAL SERVICES
SOFTWARE PROVIDERS
 ACI Worldwide, Inc., Adobe, ADP, AdviseSoft, Alfa Financial Software

Holdings plc, ARCHIBUS, Argo Data Resource Corp., Asseco Group,

Atlassian, Avaloq, Axway, Backbase, Banqsoft AS, BIS – Business

Integration Services, Bloomberg, Budgetrac, Calypso Technology, Calyx,

Capita Software, Cisco Systems, Citrix, Clarifire, Clearwater Analytics,

COCC, Constellation Financing Systems Corp, CoStar Group, DATEV,

Deloitte, Dileoz, DocuSign, Inc., Dropbox, Ebix, Edgeverve, an Infosys

company, eFront, S.A., Ellie Mae, Envestnet, Equifax, ERI Bancaire, Exela

Technologies, Inc., FICO, Fraedom, GBST Holdings Limited, Genesys

Telecommunications Laboratories, Google, Hexagon, Homnet Leasing,

HubSpot 16

Mr.Patil L. P.
BANKING AND FINANCIAL SERVICES
SOFTWARE PROVIDERS
 IBM, Imagine Software, Informatica, International Decision Systems

(IDS), ION Trading, ISGN Corporation, Jack Henry & Associates, Kofax,

KOGER, Inc., Laserfiche, Linedata Services S.A., LoanLogics, LogMeIn,

Inc., LRS Retirement Solutions, LTi Technology Solutions, Milliman Marc,

MSCI, Murex, NetSol Technologies Inc., Newgen Software, Nice Systems,

Nuance Communications Inc., Odessa Technologies, Oleeo, Open Text

Corporation, Paycom, Pegasystems, Q2ebanking, Quantrix, Salesforce,

Serrala, ServiceNow, SimCorp, SmartStream, Sopra Steria Group SA,

Tableau Software, TalentMap, Teradata Corporation, Thomson Reuters

Elite, Tieto (Ex EMRIC AB), TotalSoft, Verint Systems Inc., White Clarke
17
Group, Wolters Kluwer, Workday, Workiva, ZenTreasury, Zoom Video

Communications, and many others.


Mr.Patil L. P.
 Salary start : 6 lac onwards
 Coding necessary Java / python

 Understand the code

 Aptitude, case study, communication with client

18

Mr.Patil L. P.
DATABASE MANAGEMENT SYSTEM
(DBMS)
A DataBase Management System (DBMS)
is a piece of software that manages databases
and lets you create, edit and delete databases,
their tables and their data.
SQL Non SQL
Oracle Document: MongoDB, CouchDB,
MySQL
Microsoft SQL Server Key-value: Redis, DynamoDB
PostgreSQL
SQLite Wide-column: Cassandra, Hbase
Microsoft access
Graph: Neo4j, Amazon Nept
19

Mr.Patil L. P.
EMBEDDED / STATIC SQL
 Embedded or Static SQL is those SQL statements
that are fixed and can't be changed at runtime in an
application.
 These statements are compiled at the compile-time
only.
 The benefit of using this statement is that you know
the path of execution of statements because you have
the SQL statements with you,
 You can optimize your SQL query and can execute the
query in the best and fastest possible way.
 The way of accessing the data is predefined and these
static SQL statements are generally used on those
20
databases that are uniformly distributed.
USE EMBEDDED SQL RATHER THAN SQL OR ONLY A
GENERAL-PURPOSE PROGRAMMING LANGUAGE.

 Writing queries in SQL is typically much easier than


coding the same queries in a general-purpose
programming language.
 Not all kinds of queries can be written in SQL.
 Nondeclarative actions such as printing a report,
interacting with a user, or sending the results of a
query to a graphical user interface cannot be done
from within SQL.
 Under circumstances in which the best of both worlds,
we can choose embedded SQL or dynamic SQL, rather
than using SQL alone or using only a general-purpose
programming language.
 Embedded SQL has the advantage of programs being
less complicated since it avoids the clutter of the
ODBC or JDBC function calls, but requires a
21
specialized preprocessor
DYNAMIC SQL

 Dynamic SQL statements are those SQL


statements that are created or executed at the
run-time.
 The users can execute their own query in some
application.
 These statements are compiled at the run-time.

 These kinds of SQL statements are used where


there is a non-uniformity in the data stored in
the database.
 It is more flexible as compared to the static SQL
and can be used in some flexible applications.
22
DATABASE MANAGEMENT SYSTEM (DBMS)
• Collection of interrelated data
• Set of programs to access the data
• DBMS contains information about a particular enterprise
• DBMS provides an environment that is both convenient and efficient to
use.

Database Applications:
• Banking: all transactions
• Airlines: reservations, schedules
• Universities: registration, grades
• Sales: customers, products, purchases
• Manufacturing: production, inventory, orders, supply chain
23
• Human resources: employee records, salaries, tax deductions

Mr.Patil L. P. Databases touch all aspects of our lives
APPLICATION OF DBMS
 Enterprise Information
 Sales: For customer, product, and purchase
information.
 Accounting: For payments, receipts, account balances,
assets and other accounting information.
 Human resources: For information about employees,
salaries, payroll taxes, and benefits, and for
generation of paychecks.
 Manufacturing: For management of the supply chain
and for tracking production of items in factories,
inventories of items in warehouses and stores, and
orders for items.
 Online retailers: For sales data noted above plus
online order tracking, generation of recommendation
lists, and maintenance of online product evaluations. 24

Mr.Patil L. P.
APPLICATION OF DBMS
Banking and Finance
 Banking: For customer information, accounts,
loans, and banking transactions.
 Credit card transactions: For purchases on credit
cards and generation of monthly statements.
 Finance: For storing information about holdings,
sales, and purchases of financial instruments
such as stocks and bonds; also for storing real-
time market data to enable online trading by
customers and automated trading by the firm.
25

Mr.Patil L. P.
APPLICATION OF DBMS
 Universities: For student information, course
registrations, and grades (in addition to standard
enterprise information such as human resources
and accounting).
 Airlines: For reservations and schedule
information. Airlines were among the first to use
databases in a geographically distributed
manner.
 Telecommunication: For keeping records of calls
made, generating monthly bills, maintaining
balances on prepaid calling cards, and storing
information about the communication networks. 26

Mr.Patil L. P.
DATABASE MANAGEMENT SYSTEM

27

Mr.Patil L. P.
DATABASE MANAGEMENT SYSTEM

28

Mr.Patil L. P.
PURPOSE OF DATABASE SYSTEM
In the early days, database applications were built on top of file
systems

Drawbacks of using file systems to store data:

 Data redundancy and inconsistency


 Multiple file formats, duplication of information in different files

 Difficulty in accessing data


 Need to write a new program to carry out each new task

 Data isolation —
 multiple files and formats

 Integrity problems
 Integrity constraints (e.g. account balance > 0) become part of program code
29
 Hard to add new constraints or change existing ones

Mr.Patil L. P.
PURPOSE OF DATABASE SYSTEM
Drawbacks of using file systems (cont.)

 Atomicity
 Failures may leave database in an inconsistent state with partial updates

carried out

 E.g. transfer of funds from one account to another should either complete or

not happen at all .

 Concurrent access by multiple users


 Concurrent accessed needed for performance

 Uncontrolled concurrent accesses can lead to inconsistencies

 E.g. Bank interest applicable to all at same time

 Security problems
30

Database systems offer solutions to all the above problems


Mr.Patil L. P.
ARCHITECTURE FOR A DATABASE SYSTEM
(3 LEVEL ABSTRACTION)

View level: application programs


hide details of data types.
View Level
Views can also hide information
(e.g., salary) for security purposes.
View 1 View 2 View N
Logical level: describes data
stored in database, and the
relationships among the data.
Type customer = record
name: string;
street: string; Logical
city: integer; Level
end;

Physical level describes how a Physical


31
record is stored (centralized / Level
Distributed)
Mr.Patil L. P.
DATA ABSTRACTION
 Physical level (Low Level )
 How data are actually stored
 Describe Complex low-level data structure
 E.g. index, B-tree, hashing.

 Logical Level(Conceptual Level) (Middle Level )


 What data are stored and what relationship exist
among those data
 View Level (External Level) (High Level)
 Describe only part of the entire database
 E.g. tellers in a bank get a view of customer accounts,
but not of payroll data.
32

Mr.Patil L. P.
INSTANCES AND SCHEMAS
 Schema – the logical structure of the database
 e.g., the database consists of information about a set of customers
and accounts and the relationship between them
 Analogous to type of a variable in a program
 Physical schema: database design at the physical level
 Logical schema: database design at the logical level
 Instance – the actual content of the database at a particular
point in time
 Analogous to the value of a variable
 Physical Data Independence – the ability to modify the
physical schema without changing the logical schema
 Applications depend on the logical schema
 In general, the interfaces between the various levels and
components should be well defined so that changes in some parts do
not seriously influence others. 33

Mr.Patil L. P.
INSTANCES AND SCHEMAS
For Customer For Purchase Manager

View 1
View 2 • A database may also have several
Item_Number
Item_Name
Item_Name schema's at the view level (external
Price
Quantity Price level)
Quantity • Sometimes called subschemas, that
describe different views of the
database.
Logical / Conceptual Level • Eg: Name, price of Item

Item _Number Character (6)


Item_Name Character(20)
Price Numeric(5) • The logical schema describes the
Quantity Numeric(4) database design at the logical level
(conceptual level).
Eg: (Item_Name, Price,
Balance_qty)

Physical / Internal Level


Stored_Item Length = 40
Number Type = Byte(6)
• The physical schema describes the
Name Type = Byte(20) database design at the physical level
34
Price Type = Byte(8) Eg:: as a file of records of a
Quantity Type = Byte(4) particular type
Mr.Patil L. P.
FILE SERVER ARCHITECTURE

• The processing is distributed


about the network, typically a
local area network (LAN).
• The file-server holds the files
required by the applications
and the DBMS.
• However, the applications and
the DBMS run on each
workstation, requesting files
from the file-server when
necessary
• The file-server acts simply as
a shared hard disk drive.
• This approach can generate a
significant amount of network
traffic
35
• Concurrency, recovery, and integrity control are more complex
because there can be multiple DBMSs accessing the same files
Mr.Patil L. P.
TWO TIER ARCHITECTURE

 There is a client
process, which
requires some
resource
 server, which
provides the
resource
 no requirement
that the client
and server must
reside on the
same machine.
36

Mr.Patil L. P.
ADVANTAGES CLIENT SERVER ARCHITECTURE
 It enables wider access to existing databases.
 Increased performance – if the clients and server reside on
different computers then different CPUs can be processing
applications in parallel.
 It should also be easier to tune the server machine if its
only task is to perform database processing.
 Hardware costs may be reduced – it is only the server that
requires storage and processing power sufficient to store
and manage the database.
 Communication costs are reduced – applications carry out
part of the operations on the
 client and send only requests for database access across the
network, resulting in less data being sent across the
network.

Alternative client–server topologies:


(a) Single client, single server
(b) multiple clients, single server 37
(c) multiple clients, multiple servers
Mr.Patil L. P.
THREE TIER ARCHITECTURE
 The user interface layer,
which runs on the end-
user’s computer (the
client).
 The business logic and
data processing layer.
This middle tier runs on a
server and is often called
the application server.
 A DBMS, which stores the
data required by the
middle tier. This tier may
run on a separate server38
called the database server.
Mr.Patil L. P.
THREE TIER ARCHITECTURE
 The need for less expensive hardware because the
client is ‘thin’.
 Application maintenance is centralized with the
transfer of the business logic for many
 end-users into a single application server. This
eliminates the concerns of software distribution that
are problematic in the traditional two-tier client–
server model.
 The added modularity makes it easier to modify or
replace one tier without affecting the other tiers.
 Load balancing is easier with the separation of the
core business logic from the database functions
39

Mr.Patil L. P.
DATABASE SYSTEM ARCHITECTURE
Functions of DBA
• Schema Definition.
• Storage structure and
access method
definition.
• Schema and physical
organization
modification.
• Granting of
authorization for data
access.
• Routine maintenance.
40

Mr.Patil L. P.
TWO-TIER AND THREE-TIER ARCHITECTURES

User
client User

Application Application
client

network
network

Application
Database server server
system
Database
system

Two-tier architecture:
E.g. client programs using ODBC/JDBC to communicate with a
database 41
Three-tier architecture:
E.g. web-based applications, and applications built using middleware”
Mr.Patil L. P.
DATA MODELS
 Data Model is a collection of conceptual tools
for describing data, data relationships, data
semantics, and consistency constraints.

A data model provides a way to describe the


design of a database at the physical, logical,
and view levels.

 Data models define how data is connected to


each other and how they are processed and
42
stored inside the system.
Mr.Patil L. P.
TYPES OF DATA MODELS
 Record-based Data Models
 The Relational Model
 The Network Model
 The Hierarchical Model

 Object-based Data Models


 The Entity-Relationship Model
 The Object-Oriented Model

 Physical Data Models


43

Mr.Patil L. P.
HIERARCHICAL DATA MODEL

• Each child record has only one parent, whereas each parent record
can have one or more child records.
• The relationships formed in the tree-structure diagram must be such
that only one-to-many or one-to-one relationships exist between a
parent and a child. 44
• In order to retrieve data from a hierarchical database the whole tree
needs to be traversed starting from the root node.
Mr.Patil L. P.
NETWORK DATA MODEL

In Network Model data are represented by collections of records,


and relationships among data are represented by links. 45

Mr.Patil L. P.
RELATIONAL MODEL
A relational model uses a collection of tables to
represent both data and the relationships
among those data
 Each table has multiple columns(attributes)
and each column has a unique name.
 No special charter allowed to define attribute
except under score(_)
 Each table consists of multiple rows (tuples)
Table: Student-Info

Student_ID Student_roll_no Student_Name Student_Email


P20203201 2345 Sachin [email protected]
Z20203405 2641 Parag [email protected] 46
T20194390 4555 Mrunal [email protected]
Mr.Patil L. P.
RELATIONAL MODEL
 Each row(tuples) is a set of values that by
definition are related to each other in
someway; these values conform to the columns
of the table.
 For each column(attribute) there is a
permitted set of values, called the domain of
that attribute.

Table: Student-Info
Student_ID Student_roll_no Student_Name Student_Email
P20203201 2345 Sachin [email protected]
Z20203405 2641 Parag [email protected]
47
T20194390 4555 Mrunal [email protected]

Mr.Patil L. P.
RELATIONAL MODEL
A relational database management
system (RDBMS) has following
properties:
 Represent data in the form of tables
 Does not require the user to understand its
physical implementation
 Provides information about its content and
structure in system table
 Supports the concepts of NULL value

48

Mr.Patil L. P.
RELATIONAL MODEL PROPERTIES…

 The relation has a name that is distinct from all


other relation names in the relational schema
 Each cell of the relation contains exactly one atomic
(single) value
 Each attribute has a distinct name
 The values of an attribute are all from the same
domain
 Each tuple is distinct; there are no duplicate tuples
 The order of attributes has no significance
 The order of tuples has no significance, theoretically.
(However, in practice, the order may affect the
efficiency of accessing tuples.) 49

Mr.Patil L. P.
RELATIONAL DATABASE
 Relation A relation is a table with columns and
rows.
 Attribute An attribute is a named column of a
relation
 Tuple A tuple is a row of a relation.

 The cardinality of a relation is the number of


tuples it contains
 The number of tuples is called the cardinality of
the relation
 This changes as tuples are added or deleted.

50

Mr.Patil L. P.
DOMAIN
 A domain is the set of allowable values for one or more attributes
 Every attribute in a relation is defined on a domain.
 Domains may be distinct for each attribute, two or more attributes may
be defined on the same domain.
 More information is available to the system when it undertakes the
execution of a relational operation, and operations that are semantically
incorrect can be avoided.
 A semantic error means that a legal SQL query was entered, but the
query does not or not always produce the intended results, and is
therefore incorrect for the given task. i.e. error can arises using the
wrong variable or using wrong operator or doing operation in
wrong order
 Domains for some attributes of the Branch and Staff relations as below

51

Mr.Patil L. P.
DEGREE
 The degree of a relation is the number of
attributes it contains
 If relation has four attributes i.e. degree
four.
 A relation with only one attribute would have
degree one and be called a unary relation or
one-tuple.
 A relation with two attributes is called binary

 One with three attributes is called ternary

 After that the term n-ary is usually used. 52

Mr.Patil L. P.
FUNDAMENTALS OF DATABASE

Field Name

Recor Name Locality City Pin Code


d 1st Records
1 Garav 121, Pankha Rd New Delhi 110059
2 Deepak 12/B, M. G. Rd Mumbai 400001
3 Faizal 132, S. B. Rd Hydrabad 300052 5th Records
4 Manoj 1218, Ramesh nagar Mumbai 400002
5 Shiv A32, Mahavir Enlave Madras 600005

Field Contents
53
File Database

Mr.Patil L. P.
FUNDAMENTALS OF DATABASE
Fields /Attributes/Columns

Emp_code Name Experie


nce
Records 001 Amar 2
/ Tuples
002 Kuldeep 4 Entity set
/ Rows
003 Manoj 26
004 Rita 10
Domain
Relation schema − A relation schema describes the relation name (table
name), attributes and their names.
Relation instance − A finite set of tuples in the relational database system
represents relation instance. Relation instances do not have duplicate tuples.
Relation key − Each row has one or more attributes, known as relation key,
which can identify the row in the relation (table) uniquely.
54
Attribute domain − Every attribute has some pre-defined value scope,
known as attribute domain. A set of all possible values that can be attain by
an attribute
Mr.Patil L. P.
ENTITY-RELATIONSHIP MODEL

• Entities (objects) E.g. customers, account


• Relationships between entities

Widely used for database design


55
Database design in E-R model usually converted to
design in the relational model which is used for
Mr.Patil L. P. storage and processing
PROCEDURAL AND NONPROCEDURAL LANGUAGE
 In procedural languages, the program code is
written as a sequence of instructions.
 User has to specify “what to do” and also “how to
do” (step by step procedure). These instructions
are executed in the sequential order.
 These instructions are written to solve specific
problems.
 The iterative loops and recursive calls are used

 It is not suited for applications where time is a


critical constraint.
 Eg: Java, c, c++ 56

Mr.Patil L. P.
PROCEDURAL AND NONPROCEDURAL LANGUAGE
 In the non-procedural languages, the user has to
specify only “what to do” and not “how to do”.
 It is considered as a function-driven language.

 It involves the development of the functions from


other functions to construct more complex
functions.
 It is well-suited for applications where time is a
critical factor.
 Eg: SQL, LISP, PROLOG.

57

Mr.Patil L. P.
TYPES OF DATABASE LANGUAGE

 Data Definition Language[DDL]


 DDL is a language used to define data
and their relationships to other types
of data.

 DDL defines the format or schema of


the database

 It is mainly used to create files,


databases and tables within
databases 58

Mr.Patil L. P.
TYPES OF DATABASE LANGUAGE
 Data Manipulation Language[DML]
 DDL is a language which deals with the
processing or manipulation of various
database objects

 DML also known as query language

 It provides platform for the programmer


to interface, open and close database,
find records in files, add new records
and change / delete existing records
59

Mr.Patil L. P.
TYPES OF DATABASE LANGUAGE
DATA MANIPULATION LANGUAGE[DML] CONT…
Two classes of languages
 Procedural – user specifies what data is required
and how to get those data

 Nonprocedural – user specifies what data is


required without specifying how to get those data

60

Mr.Patil L. P.
TYPES OF DATABASE LANGUAGE

Data Control Language[DCL]


 DCL is a language which is used
to impose security features and
thus prevents unauthorized
access to data in the database

61

Mr.Patil L. P.
62

You might also like