0% found this document useful (0 votes)
7 views9 pages

Database Languages and Interfaces

The document provides an overview of database languages, interfaces, and systems, detailing types such as DDL, DML, DCL, and TCL, along with their key operations and examples. It also discusses database interfaces, the components of a database system environment, and the advantages and disadvantages of centralized and client/server architectures. Additionally, it classifies database management systems based on various criteria including data model, user numbers, distribution, cost, access, and usage.

Uploaded by

Martin Porus
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
7 views9 pages

Database Languages and Interfaces

The document provides an overview of database languages, interfaces, and systems, detailing types such as DDL, DML, DCL, and TCL, along with their key operations and examples. It also discusses database interfaces, the components of a database system environment, and the advantages and disadvantages of centralized and client/server architectures. Additionally, it classifies database management systems based on various criteria including data model, user numbers, distribution, cost, access, and usage.

Uploaded by

Martin Porus
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

Database Languages and Interfaces

Database languages are specialized languages used to create, manipulate, and query
databases. They provide the means to define database schemas, insert, update, delete, and
retrieve data from databases.

Types of Database Languages:

1.) Data Definition Language (DDL):


Data Definition Language (DDL) is a type of SQL command that is used to define,
modify, and manage the structure of database objects such as tables, indexes, schemas, and
views.
 It primarily focuses on the creation, alteration, and deletion of database schema and
its components.

Key Operations of DDL:


 CREATE: Used to create new database or objects in a database.
 ALTER: Used to modify the structure of a database, such as adding or dropping
columns in a table.
 DROP: Deletes a database object from the database permanently.
 TRUNCATE: Deletes data from table.
 RENAME: Used to rename a table or a column.
 COMMENT: Used to comment on the data dictionary.
Example:
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
DepartmentID INT
);
ALTER TABLE Employees ADD Email VARCHAR(100);
DROP TABLE Employees;

2.) Data Manipulation Language (DML):


Data Manipulation Language (DML) refers to the type of SQL commands used to
retrieve, insert, update, and delete data from a database.
 These operations are crucial for interacting with data in relational databases.
Common DML Statements:
 SELECT: Used to retrieve data from the database.
 INSERT: Used to insert data into a table.
 UPDATE: Used to update existing data within a table.
 DELETE: Used to delete all records from a table.
Example:
SELECT * FROM Employees WHERE DepartmentID = 1;

INSERT INTO Employees (EmployeeID, FirstName, LastName, DepartmentID) VALUES


(1, 'John', 'Doe', 1);

UPDATE Employees SET Email = 'john.doe@example.com' WHERE EmployeeID = 1;


DELETE FROM Employees WHERE EmployeeID = 1;
3.) Data Control Language (DCL):
Purpose: Used to control access to data in the database.
Functions:
 GRANT: Gives user’s access privileges to the database.
 REVOKE: Removes access privileges from the database.
Example:
GRANT SELECT, INSERT ON Employees TO user1;
REVOKE INSERT ON Employees FROM user1;

4.) Transaction Control Language (TCL):


Purpose: Used to manage transactions within the database.
Functions:
 COMMIT: Saves all changes made in the current transaction.
 ROLLBACK: Reverts all changes made in the current transaction.
 SAVEPOINT: Sets a savepoint within a transaction.
 SET TRANSACTION: Sets the characteristics of the current transaction.
Example:
BEGIN TRANSACTION;

INSERT INTO Employees (EmployeeID, FirstName, LastName, DepartmentID) VALUES


(2, 'Jane', 'Smith', 2);

SAVEPOINT Savepoint1;

UPDATE Employees SET DepartmentID = 3 WHERE EmployeeID = 2;

ROLLBACK TO Savepoint1;

COMMIT;
Database Interfaces
Database interfaces provide the means through which users interact with a database. These
interfaces range from command-line interfaces to graphical user interfaces and APIs.

Types of Database Interfaces:


Command-Line Interface (CLI): Users interact with the database by typing commands
directly into a command-line interface. It is often used by database administrators and
developers. Example: MySQL Command Line, PostgreSQL psql.

Graphical User Interface (GUI): Provides a graphical interface for users to interact with
the database, making it easier for non-technical users to manage and query data.
Example: phpMyAdmin for MySQL, pgAdmin for PostgreSQL, Microsoft SQL Server
Management Studio.

Web-Based Interface: Allows users to interact with the database through a web browser.
These interfaces are typically easier to access remotely. Example: Adminer, DBeaver,
Oracle APEX.

Application Programming Interface (API): Allows developers to interact with the


database programmatically through code. APIs can be used in various programming
languages to perform database operations.
Example: JDBC for Java, ODBC for various languages, ADO.NET for .NET languages.

Embedded SQL: Embeds SQL statements directly within the code of a host programming
language.
Example: SQL statements within C/C++ code, PL/SQL for Oracle databases.

Database Connectivity Drivers: Provide the necessary connectivity between an application


and the database.
Example: JDBC (Java Database Connectivity), ODBC (Open Database Connectivity), and
database-specific drivers like MySQL Connector/J.
Database System Environment

The database system environment is comprised of


the components that are meant for defining and
managing the data that we collect, store, manage and
use in the database environment. A database
environment has 5 major components for
functionality. The components necessary are:
hardware, software, people, data, and procedures.

1. Hardware - The hardware component of the


database system environment includes all the
physical devices that comprise the database system.
It includes storage devices, processors, input and
output devices, printers, network devices and many
more.

2. Software - The software component of the database environment includes all the software that
we require to access, store and regulate the database. DBMS software controls and regulates the
database. The application program and utilities access the database and if required you can even
manipulate the database.

3. People - there are different roles needed to help build the overall database environment. These
roles would include to system and database administrators, database designers, programmers,
analysts, and end users

 System administrator - is in charge of setting up and managing the system and server.
They are needed to make sure there are no server crashes or any missing information
within the database
 Database administrators ensure the physical database is working properly through
monitoring the performance and also managing security access.
 Database designers and programmers - code all queries, relationships, and data and
make sure they are stored properly within the database management system.
 Analysts - review all the data the designers and programmers have implemented.
 end users- are the ones that utilize the database management system and make the
system more usable for other users.

4. Data
Data component include a collection of related data which are the known fact that can be
recorded and it has an implicit meaning in the database.

5. Procedures
The procedure component of the database environment is nothing but the function that regulates
and controls the use of the database.

System Utilities
Database system utilities are the tools that can be used by the database system administrator to
control and manage the database system.
1. Loading Utility
Loading database utility helps in loading the database file into the database. It efficiently
reformats the current format of data files to the format that is required by the destination database
file structure. Some loading programs or tools are specially designed for loading data from one
DBMS to another.
If you provide source database storage description and target database storage description to
these loading tools then it will automatically reformat the data files to target database storage
description.

2. Backup Utility
The backup utility in the database environment helps in creating a backup copy of the entire
database. Generally, the entire data of the database is copied to mass storage and we refer to it as
a backup copy. This backup copy can be used when there is a system failure or storage of your
system is corrupted.
You can always choose incremental backups which only record the changes from the previous
backup. Though the incremental backup requires a more complex algorithm it saves more space
as compared to regular backup.

3. Database Storage Reorganization Utility


Sometimes we need to relocate the set of database files to a different location. The database
storage reorganization utility helps to relocate and organize the database files to a different
location and it also produces a new access path to access the files from its new location.

4. Performance Monitoring Utility


Performance monitoring utility monitors the usage of the database by its user and provides
statistics for the same to the database administrator (DBA). The statistics provided by the utility
helps the DBA to decide whether it is required to reorganize the data files, whether there is a
need to add new indexes or not, whether some indexes to the files must be dropped to improve
the performance of the database system.
There are more utilities in the database environment that help in sorting the database file on some
basis, handling data compression on the large databases, monitoring the user’s access to the
database and many more.

Centralized and Client/Server Architecture for DBMS

Centralized Architecture: In Centralized


Architecture, the mainframe computers are used
for processing all system functions including User
application Programs and User Interface Programs
as well as DBMS functionalities.

Client/Server Architecture:
The concept of client/server architecture assumes
an underlying framework that consists of many
PCs as well as a smaller number of mainframe
machines, connected via LANs and other types of
computer networks.
A client in this framework is typically a user machine that provides user interface capabilities and
local processing.
A Server is a system which contains both Hardware and Software
which provides services to client Machines like file access, printing
and database access.
1) Two Tier Client/Server Architecture for DBMS:
Architecture has two layers, which are client layer and
Datalayer. In Client layer we have several Client machines
which can have the access to the database server.
2) Three-Tier client/server Architecture for DBMS: Here there
is an additional layer which acts as an intermediate between
Client layer and Datalayer called Business logic layer. Simply
the Client machines will contact Application Server which in
turn processes our Application Programs and fetches the
Required Data from Database and then sends this Information
back to the client machine in the suitable format only.

Advantages and disadvantages of Client-Server Architecture


Client-Server Architecture has some advantages and disadvantages, depending on the
requirements and constraints of the system.

Advantages:
1) It is centralised, which means that all data and services are stored and managed in a
single place. This makes it easier to maintain, update, and secure the system.
2) It is cost-efficient, as it requires less hardware and software resources for the client side.
The client only needs a network connection and an application or web browser to access
the server.
3) It has high performance and low latency, as the server can handle many requests from
many clients simultaneously and efficiently.

Disadvantages
1) It has limited scalability, as it depends on the capacity and availability of the server. If
the server is overloaded or fails, the system may not function properly or at all.
2) It has high network dependency, as it relies on the network connection between the
client and the server. If the network is slow or disrupted, the system may experience
delays or errors.
3) It has complex architecture, as it involves multiple components and layers that need to
be designed, implemented, and coordinated. The system may also face challenges such as
security, synchronisation, and compatibility.
Classification of Database Management System
Database management systems can be classified based on several criteria, such as the data
model, user numbers and database distribution.

Based on the data model


Relational database – This is the most popular data model used in industries. It is based on the
SQL. They are table oriented which
means data is stored in different
access control tables, each has the
key field whose task is to identify
each row. The tables or the files
with the data are called as relations
that help in designating the row or
record, and columns are referred to
attributes or fields. Few examples
are MYSQL(Oracle, open source),
Oracle database (Oracle), Microsoft
SQL server(Microsoft) and
DB2(IBM).

Object oriented database – The information


here is in the form of the object. It adds the
database functionality to object programming
languages. It requires less code, use more
natural data and also code bases are easy to
maintain. Examples are ObjectDB (ObjectDB
software).

Object relational database – Relational


DBMS are evolving continuously and they
have been incorporating many concepts developed in object oriented database.

Hierarchical database – In this, the information


about the groups of parent or child relationships
is present in the records which is similar to the
structure of a tree. They are used in industry on
mainframe platforms. Examples are IMS(IBM),
Windows registry(Microsoft).

Network database – Mainly used on a large


digital computers. If there are more connections, then
this database is efficient. They are similar to hierarchical
database, they look like a cobweb or interconnected
network of records. Examples are CA-IDMS
(COMPUTER associates), IMAGE(HP).
Based on the number of users
Single user –it can support only one user at a time. It is mostly used with the personal computer
on which the data resides accessible to a single person. The user may design, maintain and write
the database programs.
Multiple users – It supports multiple users concurrently. Data can be both integrated and shared,
a database should be integrated when the same information is not need be recorded in two places.
For example
 a student in the college should have the database containing his information. It must be
accessible to all the departments related to him.
 library department and the fee section department should have information about
student’s database. So in such case, we can integrate and even though database resides in
only one place both the departments will have the access to it.

Based on the sites over which network is distributed


Centralized database system – The DBMS and database are stored at the single site that is used
by several other systems too. We can simply say that data here is maintained on the centralized
server.

Parallel network database system –


This system has the advantage of
improving processing input and
output speeds. It holds the multiple
central processing units and data
storage disks in parallel.

Distributed database system – In


this data and the DBMS software are
distributed over several sites but
connected to the single computer.

Further they are classified as


1. Homogeneous DBMS – They use same
software but from the multiple sites.
Data exchange between the sites can be
handled easily.
2. Heterogeneous DBMS – They use
different DBMS software for different
sites but there is a additional software
that helps the exchange of the data
between the sites.

Client-server database system – This system has two logical components namely client and
server. Clients are generally the personal computers or workstations whereas servers are the large
workstations, mini range computers or a main frame computer system. Both server and client
computers are connected over the network.

Multi-tier client-server database system – The rise of personal computers in business has
increased the reliability of the network hardware leading to evolution of two-tier and three-tier
systems which use different software for the client and software.
Based on the cost
Low cost DBMS – The cost of these systems vary from $100 to $3000.
Medium cost DBMS – Cost varies from $10000 to $100000.
High cost DBMS – Cost pf these systems are usually more than $100000.

Based on the access


This classification simply based on the access to data in the database systems
Sequential access – One after the other.
Direct access

Based on the usage


Online transaction processing(OLTP) DBMS – They manage the operational data. Database
server must be able to process lots of simple transactions per unit of time. Transactions are
initiated in real time, in simultaneous by lots of user and applications hence it must have high
volume of short, simple queries.

Online analytical processing(OLAP) DBMS – They use the operational data for tactical and
strategical decision making. They have limited users deal with huge amount of data, complex
queries.

Big data and analytics DBMS – To cope with big data new database technologies have been
introduced. One such is NoSQL (not only SQL) which abandons the well known relational
database scheme.

XML DBMS – two types


1. Native XML DBMS – Use the logical,intrinsic structure of XML document.
2. Enabled XML DBMS – Existing DBMS with facilities to store XML data and structured
data in integrated way.

Multimedia DBMS – Stores data such as text, images, audio, video and 3D games which are
usually stored in binary large object.

GIS DBMS – Stores and queries the spatial data.

Sensor DBMS – Allows to manage sensor data, bio-metric and telematics data.

Mobile DBMS – Runs on the smartphones, tablets. It Handles the local queries. Supports self
management( no DBA).

Open source DBMS – Code is publicly available and can be extended by anyone, popular for
small business applications.

You might also like