Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Exam (elaborations)

SQL Concepts - Quick Revision Guide | Updated, Winter 2026

Document preview thumbnail
Preview 2 out of 5 pages

SQL Concepts - Quick Revision Guide | Updated, Winter 2026

Content preview

SQL Concepts – Quick Revision Guide
What isSQL?

SQL (Structured Query Language) is the standard language for managing and manipulating relational
databases. It is used to:

Create & modify database structures (DDL)
Insert, update, delete (DML)
Retrieve data (DQL)
Control access and permissions (DCL)
Manage transactions (TCL)


Tips: SQL is declarative, meaning you tell the database what you want, not how to do it.


Types of SQL Commands


Categor y Commands Purpose

CREATE, ALTER, DROP, Define/modify database
DDL (Data Definition Language)
TRUNCATE schema

DML (Data Manipulation
INSERT, UPDATE, DELETE Change data
Language)

DQL (Data Query Language) SELECT Retrieve data

TCL (Transaction Control
COMMIT, ROLLBACK, SAVEPOINT Manage transactions
Language)

DCL (Data Control Language) GRANT, REVOKE Control access



SQL Datatypes

Common categories:

Numeric: INT,SMALLINTB,IGINTDE,CIMAL(p,s), FLOAT, REAL
Character: CHAR(n) (fixed), VARCHAR(n) (variable), TEXT
Date/Time: DATE,TIMED,ATETIMETI,MESTAMP, INTERVAL
Boolean: BOOLEAN /BIT
Binary: BLOB,BYTEA (PostgreSQL), VARBINARY
Json: JSON, JSONB


Best Practice: Use the smallest suitable datatype to save space and improve performance.

, Popular SQL Databases

Open Source: MySQL, PostgreSQL, SQLite, MariaDB
Enterprise: Oracle Database, Microsoft SQL Server, IBM Db2
Cloud-Native: Amazon Aurora, Google Cloud Spanner, Snowflake, Azure SQL Database


Core Concepts

Table → Logical collection of data in rows and columns
Row → One complete record
Column → An attribute/field of the data


Constraints


Constraint Purpose Example

PRIMARY KEY Uniquely identifies each row PRIMARY KEY(id)

References another table’s primary FOREIGN KEY(dept_id) REFERENCES
FOREIGN KEY
key department(id)

UNIQUE No duplicate values allowed UNIQUE(email)

NOT NULL Disallow null values name VARCHAR(50) NOT NULL

CHECK Enforce condition CHECK(age >= 18)

DEFAULT Set default value status VARCHAR(10) DEFAULT 'Active'



Clauses

Filtering: WHERE, HAVING
Grouping: GROUP BY
Sorting: ORDER BY
Pagination: LIMIT (MySQL/PostgreSQL), OFFSET, TOP(SQL Server)
Aliasing: AS


Views

Definition: Virtual tables created from queries
Use cases: Security (hide sensitive columns), simplified queries
Materialized Views: Store the result physically for faster reads


Functions

Aggregate Functions: Operate on sets of rows SUM(), AVG(), COUNT(), MAX(), MIN()

Document information

Uploaded on
January 22, 2026
Number of pages
5
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
NurseHenny
4.4
(31)
Sold
173
Followers
75
Items
2088
Last sold
1 week ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions