How SQL Communicates with Database?
SQL its self a language to communicate with Database and SQL further divided into 5 sub languages.
- Data Definition Language (DDL): Used to define schema, modify or drop the database structure or schema objects.
For example, creating tables, adding columns or dropping existing column etc.; Simply, we can say structured oriented changes can be done with DDL.
Commands: CREATE, ALTER, RENAME, DROP, TRUNCATE, COMMENT
2. Data Manipulation Language (DML): Used to manipulate data in the table.
For example, Add record, update record or delete record
Commands: INSERT, UPDATE, DELETE
3. Transaction Control Language (TCL): used to manage transactions in the database which are made by DML commands
Commands: COMMIT, ROLLBACK, SAVEPOINT
4. Data Query Language (DQL): Used to fetch data from existing tables. Also call it as Data Retrieval Language (DRL).
Command: SELECT
5. Data Control Language (DCL): Used to control data access or data manipulation among users.
Command: GRANT, REVOKE
Next, We’re going to have a “Hands-on session on SQL Commands” [ https://medium.com/@pk0411/working-with-data-definition-language-ddl-762e3a47c539 ]