हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा १२

What are the components of SQL? Write the commands in each.

Advertisements
Advertisements

प्रश्न

What are the components of SQL? Write the commands in each.

संक्षेप में उत्तर
Advertisements

उत्तर

Components of SQL:

The various components of SQL are

  • Data Definition Language (DDL)
  • Data Manipulation Language (DML)
  • Data Query Language (DQL)
  • Transactional Control Language (TCL)
  • Data Control Language (DCL)

Data Definition Language (DDL):

  • The Data Definition Language (DDL) consists of SQL statements used to define the database structure or schema.
  • It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in databases.
  • The DDL provides a set of definitions to specify the storage structure and access methods used by the database system.

A DDL performs the following functions:

  • It should identify the type of data division such as data item, segment, record, and database file.
  • It gives a unique name to each data item type, record type, file type, and database.
  • It should specify the proper data type.
  • It should define the size of the data item.
  • It may define the range of values that a data item may use.
  • It may specify privacy locks for preventing unauthorized data entry.

SQL commands which come under Data Definition Language are:

Create To create tables in the database.
Alter Alters the structure of the database.
Drop Delete tables from the database.
Truncate Remove all records from a table, also release the space occupied by those records.

Data Manipulation Language:

  • A Data Manipulation Language (DML) is a computer programming language used for adding (inserting), removing (deleting), and modifying (updating) data in a database.
  • In SQL, the data manipulation language comprises the SQL-data change statements, which modify stored data but not the schema of the database table.
  • After the database schema has been specified and the database has been created, the data can be manipulated using a set of procedures that are expressed by DML.

The DML is basically of two types:

  • Procedural DML – Requires a user to specify what data is needed and how to get it.
  • Non-Procedural DML – Requires a user to specify what data are needed without specifying how to get it.

SQL commands which come under Data Manipulation Language are:

Insert Inserts data into a table
Update Updates the existing data within a table
Delete Deletes all records from a table, but not the space occupied by them.

Data Control Language:

  • A Data Control Language (DCL) is a programming language used to control the access of data stored in a database.
  • It is used for controlling privileges in the database (Authorization).
  • The privileges are required for performing all the database operations such as creating sequences, views of tables, etc.

SQL commands which come under Data Control Language are:

Grant Grants permission to one or more users to perform specific tasks.
Revoke Withdraws the access permission given by the GRANT statement.

Transactional Control Language:

  • Transactional control language (TCL) commands are used to manage transactions in the database.
  • These are used to manage the changes made to the data in a table by DML statements.

SQL command which comes under Transfer Control Language are:

Commit Saves any transaction into the database permanently.
Rollback Restores the database to the last commit state.
Savepoint Temporarily save a transaction so that you can roll back.

Data Query Language:
The Data Query Language consists of commands used to query or retrieve data from a database.
One such SQL command in Data Query Language is
Select: It displays the records from the table.

shaalaa.com
SQL Commands and Their Functions
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 12: Structured Query Language (SQL) - Evaluation [पृष्ठ २३१]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 12 TN Board
अध्याय 12 Structured Query Language (SQL)
Evaluation | Q 3. | पृष्ठ २३१
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×