SQL

Database Schema

  • SQL defines the structure of a database using CREATE statements for tables, specifying columns and their data types.
  • Relationships between tables are established using keys: primary keys uniquely identify records, while foreign keys establish relationships between tables.

Data Manipulation

Command Description
SELECT Retrieves data from one or more tables based on specified criteria.
INSERT Adds new records into a table.
UPDATE Modifies existing records in a table.
DELETE Removes records from a table.

Data Definition

Command Description
CREATE Defines new databases, tables, views, or indexes.
ALTER Modifies existing database objects, such as tables.
DROP Deletes databases, tables, views, or indexes.

Data Control

Command Description
GRANT Gives users access privileges to database objects.
REVOKE Removes previously granted permissions.