How to remember SQL commands

Hello everyone, I just started learning SQL, Although it looks straightforward to follow the instruction and do exercises but how can I remember all the SQL query commands? if anyone have some tips to remember them please share with me.

thanks

Hello @amritdhillon39011841 ,

I feel it is like anything, the more you use the commands, you start to remember them.

Here is a link to a forum question on other commonly used SQL Commands:

Are there any other commonly used SQL commands? - FAQ / SQL FAQ - Codecademy Forums

Codecademy also has SQL summary:
https://www.codecademy.com/article/sql-commands

1 Like

Hi Amritdhillon,

SQL commands are categorized into five categories:

  1. Data Definition Language (DDL) - used to define the database schema. List of DDL commands:
  • CREATE - This command is used to create the database or its objects (like table, index, function, views, store procedure, and triggers).
  • DROP - This command is used to delete objects from the database.
  • ALTER - This is used to alter the structure of the database.
  • TRUNCATE - This is used to remove all records from a table, including all spaces allocated for the records are removed.
  • COMMENT - This is used to add comments to the data dictionary.
  • RENAME - This is used to rename an object existing in the database.
  1. Data Query Language (DQL) - used for performing queries on the data within schema objects. List of DQL:
  • SELECT - It is used to retrieve data from the database.
  1. Data Manipulation Language (DML) - deals with the manipulation of data present. List of DML commands:
  • INSERT - It is used to insert data into a table.
  • UPDATE - It is used to update existing data within a table.
  • DELETE - It is used to delete records from a database table.
  • LOCK - Table control concurrency.
  • CALL - Call a PL/SQL or JAVA subprogram.
  • EXPLAIN PLAN - It describes the access path to data.
  1. Data Control Language (DCL) - deal with the rights, permissions, and other controls of the database system. List of DCL commands:
  • GRANT - is command gives users access privileges to the database.
  • REVOKE - This command withdraws the user’s access privileges given by using the GRANT command.
  1. Transaction Control Language (TCL) - Each transaction begins with a specific task and ends when all the tasks in the group successfully complete. If any of the tasks fail, the transaction fails. The following TCL commands are used to control the execution of a transaction:
  • COMMIT - Commits a Transaction.
  • ROLLBACK - Rollbacks a transaction in case of any error occurs.
  • SAVEPOINT - Sets a save point within a transaction.
  • SET TRANSACTION - Specifies characteristics for the transaction.

Maybe seeing how the commands are organized like this will help you memorize SQL commands.

Source: Geeks4Geeks.com

2 Likes

thanks so much for such a great explanation

thanks for sharing the link. It will be helpful.

2 Likes

Excellent.

If you can do some more help, provide syntax for above commands also. This will be great help.

I find this cheat sheet on google which covers almost everything. Hope it will help.

I don’t understand what you are asking about or you are looking for someone who can tutor you