What is SQL Programming Language ?

SQL is a programming language that helps to manage databases. SQL stands for a structured query language, and it is pronounced as S‑Q-L or sometimes as See-Quell. SQL (Structured Query Language) is a computer language aimed to store, manipulate, and retrieve data stored in relational databases. The first commercial relational database was released by relational software later becoming oracle.

  • Save
SQL

The SQL language has several parts:

  • Data Def­i­n­i­tion Lan­guage (DDL) pro­vides com­mands for defin­ing rela­tion schemas, delet­ing rela­tions, and mod­i­fy­ing rela­tion schemas.
  • Inter­ac­tive data-manip­u­la­tion lan­guage (DML). It also includes com­mands to insert tuples into, delete tuples from, and mod­i­fy tuples in the database.
  • View def­i­n­i­tion includes com­mands for defin­ing views.
  • Trans­ac­tion con­trols include com­mands for spec­i­fy­ing the begin­ning and end of transactions.

The pur­pose of design­ing SQL is To man­age database

Data Definition language

The state­ment is used to define the data­base struc­ture or schema.
The Short form of Data Def­i­n­i­tion lan­guage is DDL
Some Exam­ples:-

  • CREATE — to cre­ate a data­base and its objects like (table, index, views, store pro­ce­dure, func­tion, and triggers)
  • ALTER — alters the struc­ture of the database
  • DROP — delete objects from the database
  • RENAME — rename an object.

Data manipulation language

The state­ment is used for man­ag­ing data with­in schema objects.
The Short form of Data Manip­u­la­tion lan­guage is DML
Select retrieve data from the data­base.
Some Exam­ples:-

  • INSERT — insert data into a table.
  • UPDATE — updates exist­ing data with­in a table.
  • DELETE — deletes all records from a table, the space for the record remains.
  • CALL — a PL/SQL or Java subprogram.

Data Control language

the state­ment is used to grant and revoke per­sim­mon from those who have access to the data­base
The short form of Data Con­trol lan­guage is DCL.
Some Exam­ples:-

  • GRANT — This com­mand grants peo­ple access to the database.
  • REVOKE — This com­mand removes the user’s access rights grant­ed by the GRANT command.

Transaction Control Language

State­ments are used to man­age trans­ac­tions in the data­base.
The short form of Trans­ac­tion Con­trol lan­guage is TCL
Some Exam­ples:-

  • COMMIT — The COMMIT com­mand is used to store any trans­ac­tion into the data­base permanently.
  • ROLLBACK — The roll­back com­mand restores the data­base to the last com­mit­ted state. ROLLBACK is also used with the savepoint.
  • cre­ates points with­in the groups of trans­ac­tions in which to ROLLBACK.
  • SAVEPOINT — A SAVEPOINT is a point in a trans­ac­tion in which you can roll the trans­ac­tion back to a cer­tain point with­out rolling back the entire transaction.

Leave a Comment

Share via
Copy link
Verified by MonsterInsights