Structure Query Language(SQL)
SQL is a collection of statements used to communicate with Data Bases. SQL can also be called as Sequel.
To communicate with data bases human needs a language that is SQL. In the same way SQL also needs some set of commands to communicate with database.
When you are going to start SQL. You need keep know basic elements of database.
Database contains 'n' number of schemas, Schemas contains 'n' number of tables, Tables contains 'n' number of rows and columns.
In SQL there are five commands in total:
- DQL(Data Query Language).
- DDL(Data Definition Language).
- DML(Data Manipulation Language).
- DCL(Data Control Language).
- TCL(Transaction Control Language).
Further I will also share some shortcuts to remember commands in sql
Data Query Language(DQL):
- The name itself specifies that this is a query language.(Query is a statement to retrieve something from the database with some conditions included in it).
- DQL has only one command i.e. SELECT.
Syntax:
SELECT column1,column2,column3.....
Data Definition Language(DDL):
- DDL commands are used to define the structure of the schemas i.e, it defines the structure of tables etc..
Syntax:
```<DDL_Command> Table <table_name>```
- It contains 5 commands:
- DROP
- RENAME
- CREATE
- ALTER
- TRUNCATE
To remember commands easily follow the first letter of each command which is DR.CAT
Data Manipulation Language(DML):
- DML commands are used to manipulate the data present in the data base.
Syntax:
<DML_Command> <table_name>
- It contains 5 commands:
- LOCK
- UPDATE
- CALL
- INSERT
- DDELETE
To remember commands easily follow the first letter of each command which is LUCID
Data Control Language(DCL):
DCL commands delay with permissions and rights in the database.
-
It contains 5 commands:
- GRANT
- REVOKE
Transaction Control Language(TCL):
-
Transaction: Transaction is a set of SQL statements.
Transactions are categorised into 3 types:
- Explicit
- Implicit
- Auto commit
To control the flow of sql statements commands of TCL is used.
-
TCL contains 3 commands:
- Commit
- Rollback
- Savepoint
Checkout my design: SQL Commands
In this Blog, I covered some prerequisites, essential SQL commands and share tips to easily remember. Whether you're a beginner or an experienced developer, there's something valuable for everyone.
Don't miss out on this opportunity to level up your SQL. Check out the blog and let me know what you think.
Your appreciation and follows really motivate me to create more content like this. If you feel that you’ve learned something, please hit the follow button and let me know what you think. 😊
👉 follow me on Linkedin
Happy coding!
Top comments (1)
Feel free to share your thoughts here in comments, so that it would be helpful for me to learn something and change accordingly.. 😊