SQL Reference and Interactive Tutorial

Last updated: August 27, 2026.

SQL retrieves and changes data in relational databases. Begin with SELECT, filtering, and sorting, then move to joins, grouping, aggregates, and data modification.

Core query clauses

Combine and summarize data

A practical query

SELECT
    c.customer_name,
    COUNT(o.order_id) AS order_count,
    SUM(o.total_amount) AS revenue
FROM customers AS c
JOIN orders AS o ON o.customer_id = c.customer_id
WHERE o.order_date >= '2026-01-01'
GROUP BY c.customer_id, c.customer_name
HAVING SUM(o.total_amount) >= 1000
ORDER BY revenue DESC;

Change database data

SQL dialects differ in details, so check the documentation for your database engine. The PostgreSQL SELECT reference is a thorough standards-oriented reference.

admin

admin

Leave a Reply

Your email address will not be published.