Step 1: Understand SQL command categories.
SQL commands are broadly classified into different categories depending on their functions.
Two important categories are:
• DDL (Data Definition Language)
• DML (Data Manipulation Language) Step 2: DDL Commands.
DDL commands are used to define and manage the structure of database objects such as tables and schemas.
Common DDL commands include:
• CREATE: Used to create a new table or database.
Example:
\[
\texttt{CREATE TABLE Student (ID INT, Name VARCHAR(20));}
\]
• ALTER: Used to modify the structure of an existing table.
• DROP: Used to delete a table or database permanently.
• TRUNCATE: Used to remove all records from a table quickly. Step 3: DML Commands.
DML commands are used to manipulate the data stored in tables.
Common DML commands include:
• INSERT: Adds new records into a table.
• UPDATE: Modifies existing records in a table.
• DELETE: Removes records from a table.
• SELECT: Retrieves data from a table. Step 4: Conclusion.
Thus DDL commands define database structures while DML commands manipulate the data stored in the database.