# History

SQL was invented in the 1970s based on the Relational Data Model It was initially known as the structured English query language (SEQUEL). The term was later shortened to SQL.

Oracle, formerly known as Relational Software, became the first vendor to offer a commercial SQL relational database management system.

“History of SQL”

SQL Data Mart Materialized View BI Report Traditional OLAP BI Dashboard Modern OLAP dbt tables One Big/Wide/Super Table Semantic Layer Natural Language Queries

# Different parts of an SQL-Statement

# SQL Core Concept

StepTopicSubtopics
1Data Definition LanguageDDL Commands, DDL Syntax
2Data Manipulation LanguageDML Commands, SQL Clauses, DML vs DDL, DML vs TCL
3Aggregate QueriesAggregate Functions
4Data ConstraintsNOT NULL , UNIQUE, PRIMARY KEY, FOREIGN KEY ,CHECK ,DEFAULT
5JOIN QueriesCartesian Join, Self Join
6SubqueriesCorrelated Subqueries, Nested Subqueries, Join vs Subquery
7Aggregate FunctionsString Functions, Date & Time Functions, Numeric Functions
8ViewsCreate View, Update View, Drop View
9IndexesQuery Optimization, Best Practices
10TransactionsACID Concepts, Transaction Control
11Data Integrity and SecurityIntegrity Constraints, Access Control
12Stored Procedures and FunctionsReusability, Performance Benefits
13Performance OptimizationQuery Tuning, Indexing Strategies
14Advanced SQLWindow Functions, CTEs, Pivot/Unpivot, Dynamic SQL, Triggers

# Advanced SQL Extensions

TopicSubtopics
Set OperationsUNION, UNION ALL, INTERSECT, EXCEPT
GROUP BY and HAVINGGROUP BY clauses, HAVING filtering
Recursive QueriesHierarchical queries, Recursive CTEs
Handling NULLsIS NULL, IS NOT NULL, COALESCE, NULLIF
Transaction ManagementCOMMIT, ROLLBACK, SAVEPOINT
Isolation LevelsREAD UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE
SQL vs NoSQLDifferences, Use cases, Trade-offs
Execution PlansEXPLAIN, SHOWPLAN, Query execution analysis
IdempotencySafe re-execution of queries, duplicate prevention
PartitioningHorizontal partitioning, Range/List partitioning

# SQL System Design

TopicSubtopics
Concurrency & LockingLocks (row-level, table-level), Deadlocks, MVCC (Multi-Version Concurrency Control)
Data Loading / ETL BasicsBulk insert, COPY commands, CSV/JSON imports, Exporting data
Backup & RecoveryDatabase backups, Restore strategies, Point-in-time recovery
Stored Procedures Deep DiveFunctions vs procedures differences, Error handling in SQL (TRY/CATCH)

# Further Reading