Database Management
System (DBMS)
Muhammad Farhan Malik student of Quaid-e-Awam University of Engineering,
Science & Technology Nawabshah
Topic: Database Languages
What are Database Languages?
 Database languages, also known as query
languages or data query languages, are a
classification of programming languages that
developers use to define and access databases,
which are collections of organized data that users
can access electronically.
What are Database Languages?
 These languages allow users to complete tasks
such as controlling access to data, defining and
updating data and searching for information
within the database management system (DBMS).
Categories of Database Languages
There are four categories of Database Languages:
i. Data Definition Languages (DDL)
ii. Data Manipulation Language (DML)
iii. Data Control Language (DCL)
iv. Transaction Control Language (TCL)
Data Definition Language (DDL)
 Data Definition language(DDL) is used to define
database structure.
 It is used to create schema, tables, indexes,
constraints, etc. in the database.
Data Definition Language (DDL)
 Using the DDL statements, you can create the
skeleton of the database.
 Data Definition Language is used to store the
information of metadata like the number of
tables and schema, their names, indexes, columns
in each table, constraints, etc.
Statements:
 CREATE: Creates a new database or object, such as table,
index or column
 ALTER: Changes the structure of the database or existing
objects.
 TRUNCATE: It is used to remove all records from a table.
 DROP: Deletes the database or existing objects.
 RENAME: Renames the database or existing objects.
Data Manipulation Language(DML)
 DML is used for accessing and manipulating data
in a database.
 Its common functions include inserting, updating
and retrieving data from the database.
Statements:
 SELECT: It is used to retrieve data from a database.
 INSERT: It is used to insert data into a table.
 UPDATE: It is used to update existing data within a table.
Statements:
 DELETE: It is used to delete all or specific records from a
table.
 MERGE: It performs UPSERT operation, i.e., insert or
update operations.
 CALL: It is used to call a PL/SQL or a Java subprograms.
 LOCK TABLE: It controls concurrency.
Data Control Language(DCL)
 Data control language (DCL) controls access to the
data that users store within a database.
 Essentially, this language controls the rights and
permissions of the database system.
 It allows users to grant or revoke privileges to the
database.
Data Control Language(DCL)
 The DCL execution is transactional.
 It also has rollback parameters.
(But in Oracle database, the execution of data
control language does not have the feature of
rolling back.)
Statements:
 SYSTEM: Creating a session, table, etc. are all
types of system privilege.
 GRANT: Gives a user access to the database.
 REVOKE: Removes a user's access to the
database.
Transaction Control Language(TCL)
 Transaction Control statements are used to run
the changes made by DML statements.
 It allows statements to be grouped into logical
transactions.
Statements:
 COMMIT: It is used to save the transaction on the
database.
 SAVEPOINT: It identifies a point in a transaction
to which you can later roll back.
 ROLLBACK: It is used to restore the database to
original since the last Commit.
Database Languages.pptx

Database Languages.pptx

  • 1.
    Database Management System (DBMS) MuhammadFarhan Malik student of Quaid-e-Awam University of Engineering, Science & Technology Nawabshah
  • 2.
  • 3.
    What are DatabaseLanguages?  Database languages, also known as query languages or data query languages, are a classification of programming languages that developers use to define and access databases, which are collections of organized data that users can access electronically.
  • 4.
    What are DatabaseLanguages?  These languages allow users to complete tasks such as controlling access to data, defining and updating data and searching for information within the database management system (DBMS).
  • 5.
    Categories of DatabaseLanguages There are four categories of Database Languages: i. Data Definition Languages (DDL) ii. Data Manipulation Language (DML) iii. Data Control Language (DCL) iv. Transaction Control Language (TCL)
  • 6.
    Data Definition Language(DDL)  Data Definition language(DDL) is used to define database structure.  It is used to create schema, tables, indexes, constraints, etc. in the database.
  • 7.
    Data Definition Language(DDL)  Using the DDL statements, you can create the skeleton of the database.  Data Definition Language is used to store the information of metadata like the number of tables and schema, their names, indexes, columns in each table, constraints, etc.
  • 8.
    Statements:  CREATE: Createsa new database or object, such as table, index or column  ALTER: Changes the structure of the database or existing objects.  TRUNCATE: It is used to remove all records from a table.  DROP: Deletes the database or existing objects.  RENAME: Renames the database or existing objects.
  • 9.
    Data Manipulation Language(DML) DML is used for accessing and manipulating data in a database.  Its common functions include inserting, updating and retrieving data from the database.
  • 10.
    Statements:  SELECT: Itis used to retrieve data from a database.  INSERT: It is used to insert data into a table.  UPDATE: It is used to update existing data within a table.
  • 11.
    Statements:  DELETE: Itis used to delete all or specific records from a table.  MERGE: It performs UPSERT operation, i.e., insert or update operations.  CALL: It is used to call a PL/SQL or a Java subprograms.  LOCK TABLE: It controls concurrency.
  • 12.
    Data Control Language(DCL) Data control language (DCL) controls access to the data that users store within a database.  Essentially, this language controls the rights and permissions of the database system.  It allows users to grant or revoke privileges to the database.
  • 13.
    Data Control Language(DCL) The DCL execution is transactional.  It also has rollback parameters. (But in Oracle database, the execution of data control language does not have the feature of rolling back.)
  • 14.
    Statements:  SYSTEM: Creatinga session, table, etc. are all types of system privilege.  GRANT: Gives a user access to the database.  REVOKE: Removes a user's access to the database.
  • 15.
    Transaction Control Language(TCL) Transaction Control statements are used to run the changes made by DML statements.  It allows statements to be grouped into logical transactions.
  • 16.
    Statements:  COMMIT: Itis used to save the transaction on the database.  SAVEPOINT: It identifies a point in a transaction to which you can later roll back.  ROLLBACK: It is used to restore the database to original since the last Commit.