SQL Superstar: Unlocking the Secrets of DML and DQL for Data Manipulation
SQL is a programming language that is used to manage and manipulate data in relational databases. It is mostly used for creating, modifying, and retrieving data from the database.
Some simple SQL commands are as follows:
Note that this chart is not exhaustive and there may be additional SQL commands depending on the specific database management system being used.
Some best resources to learn SQL are Datacamp, Codecademy, Khan Academy, SQLZOO, and W3School. And Youtube university is always at everyone’s disposal.
Ultimately, the best resource for learning SQL depends on your personal learning style and goals. Try a few different resources to find the one that works best for you.
SQL can be categorized into different types like DDL, DML & DQL. DDL is used to define and manage the structure of the database. DDL statements are used to create, modify, and delete tables, indexes, views, and other database objects. Here are some examples of DDL statements:
- CREATE TABLE: creates a new table in the database:
- ALTER TABLE: modifies an existing table by adding, modifying, or deleting columns or constraints:
- DROP TABLE: deletes an existing table from the database
DML (Data Manipulation Language) is a subset of SQL that is used to manage the data in the database. DML statements are used to insert, update, and delete data in the database. Here are some examples of DML statements:
- INSERT INTO: adds a new row of data into a table
- UPDATE: modifies one or more rows of data in a table:
- DELETE FROM: removes one or more rows of data from a table
DQL (Data Query Language) is a subset of SQL that is used to retrieve data from the database. DQL statements are used to select and filter data from one or more tables. Here are some examples of DQL statements:
- SELECT: retrieves data from one or more tables:
- WHERE: filters data based on a condition:
- JOIN: combines data from two or more tables: