openskills.info
Open Course

SQL Fundamentals

SQL (Structured Query Language) is the standard language for querying and manipulating data in relational databases. It covers SELECT statements, filtering, joins, aggregation, subqueries, data modification, and the declarative approach to describing what data you want rather than how to get it.

itProgramming languages

Don't Panic — SQL Fundamentals

SQL is the language for asking a relational database to arrange and change information. You say what answer you need; the database chooses the route through the data. That is a useful delegation, because databases have better attendance than a notebook of hand-written pointer chasing.

The furniture is tables: rows hold records, columns hold named and typed values. Tables become a database rather than a pile of spreadsheets when keys connect them. A primary key identifies a row; a foreign key says that one row refers to another. An order can therefore name its customer without carrying a stale copy of the customer's email around like a folded note in a pocket.

The most important habit is to ask what one result row means before writing a query. A join combines related tables, but a one-to-many relationship can make one customer appear once for every order. That is correct when the question is about orders and disastrous when a total is supposed to be per customer. SQL will faithfully count the rows it has been handed. It is not being difficult; it is being literal, which is its preferred hobby.

The language arrives in several departments. CREATE and ALTER define structure. INSERT, UPDATE, and DELETE change rows. SELECT reads and reshapes them. GRANT and REVOKE control access. BEGIN, COMMIT, and ROLLBACK make a transaction: a group of changes that all survive or all disappear. Constraints add the database's own veto: missing, duplicate, negative, or orphaned values can be rejected where they enter.

Two parts require respect. NULL is not an ordinary empty value; its comparisons can be unknown, so an innocent-looking filter can omit rows. And SQL is a standard with regional accents. PostgreSQL, MySQL, SQL Server, Oracle Database, and SQLite share the core ideas, then add different syntax and features. Learn the tables, keys, joins, grouping, constraints, and transactions first. The accents make more sense after that.

Read the Cheatsheet when a clause, join, or constraint needs a compact reminder. Use the Practice Reference for query shapes and the Exercise to make a small database prove its promises. The Timeline explains how this shared language acquired so many extensions; the Landscape shows where its dialects live. The rest of SQL is detail, although it has accumulated a rather impressive amount of detail over the decades.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources