A programming language called SQL (Structured Query Language) was created specifically for managing and modifying relational databases. It offers a common syntax for entering queries and making changes to data in databases. SQL was the first commercial language introduced for E.F Codd’s Relational model of a database.
- The programming language SQL was created specifically for managing data kept in a relational database management system.
- SQL is the language with which a coder communicates with a database to manipulate its data.
- It is their guiding hand, voice, and fingertips dragging across a screen, helping the coder navigate and organize the data as they see fit.
- It’s how a programmer communicates with the computer.
There are numerous commands and statements in SQL that can be used to complete various tasks. The most typical SQL statements include the following:
DDL: Data Definition Language
- DDL modifies the structure of the table by adding, removing, or changing tables, etc.
- All DDL commands are automatically committed, which permanently saves all database changes.
|Create||Used to create new tables, indexes, views, or other database objects.|
|Drop||Used to delete tables, indexes, views, or other database objects.|
|Alter||Used to modify the structure of existing tables, indexes, or other database objects.|
|Truncate||Used to remove all data from a table.|
DML: Data Manipulation Language
- The database can be changed by using DML commands. It is in charge of making any kind of database changes.
- DML commands cannot permanently save all database changes because they are not auto-committed. They are rollback able.
|Insert||Used to add new records to a table.|
|Update||Used to modify existing records in a table.|
|Delete||Used to delete records from a table.|
TCL: Transaction Control Language
- Only DML commands like INSERT, DELETE, and UPDATE can be used with TCL commands.
- These operations cannot be used when creating or deleting tables because they are automatically committed to the database.
|Commit||Used to save changes made to the database.|
|Rollback||Used to undo changes made to the database since the last COMMIT.|
|Savepoint||Used to roll the transaction back to a certain point without rolling back the entire transaction.|
DCL: Data Control Language
Any database user’s authority can be granted and revoked with the help of DCL commands.
|Grant||Used to give users or groups access to database objects.|
|Revoke||Used to revoke previously granted access to database objects.|
DQL: Data Query Language
The data query language is used to retrieve data from tables based on simple conditions.
|Select||Used to retrieve data from one or more tables in a database.|
Note: also read about Fifth Normal Form (5NF)
Please follow me to read my latest post on programming and technology if you like my post.
Staying up to the mark is what defines me. Hi all! I’m Rabecca Fatima a keen learner, great enthusiast, ready to take new challenges as stepping stones towards flying colors.
Leave a Reply