SQL Notes
SQL Notes
relational databases. Here is a basic overview of SQL and common queries you can use:
1. Database Structure:
A relational database is structured in tables, which consist of rows and columns. Each table represents an
entity (e.g., customers, orders) and each column represents an attribute (e.g., name, price).
In the context of databases, DDL (Data Definition Language) and DML (Data Manipulation Language) are
two categories of SQL commands used to interact with the database. Here's a breakdown of each:
DDL is used to define and modify the structure of a database, including creating, altering, and dropping
database objects such as tables, indexes, views, and relationships.
DML is used to manage and manipulate data within a database, including inserting, updating, and
deleting data.
- Purpose: DDL is used for defining and modifying database structure, while DML is used for
managing and manipulating data.
- Commands: DDL uses commands like CREATE, ALTER, and DROP, while DML uses commands like
INSERT, UPDATE, and DELETE.
- Impact: DDL changes the database schema, while DML changes the data within the database.
2. Basic SQL Operations: