SQL Tutorial

SQL, or Structured Query Language, is a powerful tool for managing and manipulating relational databases.


Basic Commands:

  • SELECT: Used to retrieve data from one or more tables.
  • INSERT: Adds new data into a table.
  • UPDATE: Modifies existing data within a table.
  • DELETE: Removes data from a table.

Data Definition Language (DDL): This part of SQL is used to define and manage database structures.

  • CREATE: Creates new tables or databases.
  • ALTER: Modifies existing database structures.
  • DROP: Deletes tables or databases.

Practical Examples:

Retrieving data with SELECT:

                                                    
                                                        SELECT: SELECT * FROM Students;
                                                    
                                                

Inserting data:

                                                    
                                                        INSERT INTO Students (Name, Age) VALUES ('John Doe', 20);