Useful for batter understanding of Database Languages and its types in Database Management System.
Size: 103.47 KB
Language: en
Added: Mar 31, 2022
Slides: 17 pages
Slide Content
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: Data Definition Languages (DDL) Data Manipulation Language ( D ML) Data Control Language (DCL) 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: C reating 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.