मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता १२

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

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. | पृष्ठ २३१

संबंधित प्रश्‍न

Write the difference between table constraint and column constraint?


What is a constraint?


Write any three DDL commands.


Write the use of the Savepoint command with an example.


Write a SQL statement using the DISTINCT keyword.


Consider the following employee table. Write SQL commands for the question.

EMP CODE NAME DESIG PAY ALLO WANCE
S1001 Hariharan Supervisor 29000 12000
P1002 Shaji Operator 10000 5500
P1003 Prasad Operator 12000 6500
C1004 Manjima Clerk 8000 4500
M1005 Ratheesh Mechanic 20000 7000

To display all employees whose allowance is between 5000 and 7000.


Consider the following employee table. Write SQL commands for the question.

EMP CODE NAME DESIG PAY ALLO WANCE
S1001 Hariharan Supervisor 29000 12000
P1002 Shaji Operator 10000 5500
P1003 Prasad Operator 12000 6500
C1004 Manjima Clerk 8000 4500
M1005 Ratheesh Mechanic 20000 7000

To remove the employees who are mechanics.


Consider the following employee table. Write SQL commands for the question.

EMP CODE NAME DESIG PAY ALLO WANCE
S1001 Hariharan Supervisor 29000 12000
P1002 Shaji Operator 10000 5500
P1003 Prasad Operator 12000 6500
C1004 Manjima Clerk 8000 4500
M1005 Ratheesh Mechanic 20000 7000

To add a new row.


Consider the following employee table. Write SQL commands for the question.

EMP CODE NAME DESIG PAY ALLO WANCE
S1001 Hariharan Supervisor 29000 12000
P1002 Shaji Operator 10000 5500
P1003 Prasad Operator 12000 6500
C1004 Manjima Clerk 8000 4500
M1005 Ratheesh Mechanic 20000 7000

To display the details of all employees who are operators.


Construct the following SQL statement in the student table-

SELECT statement using GROUP BY clause.


Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×