Sitemap
Find every public page on AprenderSQL.es, grouped by section.
Other pages
SQL practice
- Practice SQL online
- 20 solved SQL exercises
- English for SQL: read errors and documentation without translating everything
- SQL cheat sheet: essential syntax with examples
- Solved SQL exercises on JOIN and aggregation
- 20 SQL interview questions with answers
- SQL game — SQL Quest
- SQL practice editor
- Test my level
- Project: query a library database
SQL Tools
SQL Course
- SQL course
- Use aliases and create calculated columns
- Modify tables with ALTER TABLE
- Combine conditions with AND, OR and NOT
- Filter ranges and lists with BETWEEN and IN
- Combined review: CASE and window functions
- Create categories with CASE
- Declare primary and foreign keys
- Protect columns with constraints
- Combined review: CREATE TABLE and ALTER TABLE
- Create tables and choose data types
- SQL level test
- Avoid duplicates with DISTINCT
- Check what you have learned
- Summarise data with COUNT, SUM, AVG, MIN and MAX
- Transform text with functions
- Join text values into a readable column
- Calculate and query dates
- Practice: combine UNION, CASE and functions
- Number rows with ROW_NUMBER
- Add sums and averages with OVER
- Practice: master window functions
- Combined review: GROUP BY and HAVING
- Create per-group summaries with GROUP BY
- Filter groups with HAVING
- Add indexes for your lookups
- Match rows with INNER JOIN
- Combined review: INSERT, UPDATE and DELETE
- Add rows with INSERT
- Combine tables and keep control of the result rows
- How to read a SQL query
- Keep all rows with LEFT JOIN
- Find text patterns with LIKE
- Combine results with UNION
- Compare values in your filters
- Sort and limit results
- Practice: combine filters and summaries
- Practice: choose the right filter
- Practice: choose and check a JOIN
- Practice: design a table with rules and an index
- Project: query a library database
- SQL project: sales analysis and audit
- What SQL is and what it is for
- Connect tables with keys and relationships
- Data analyst path
- Developer path
- Learning paths
- Recovery paths
- Choose the order of the columns
- Select data with SELECT and FROM
- Answer questions with subqueries
- Find matches with EXISTS
- Break queries into steps with CTEs
- Turn a summary into a table with a subquery in FROM
- Understand tables, rows and columns
- Control changes with COMMIT and ROLLBACK
- Practice: modify data inside a transaction
- Update rows with UPDATE
- Delete rows with DELETE
- Work correctly with NULL values
- Save reusable queries with views
- Filter rows with WHERE
- Practice: choose between subqueries and CTEs
SQL Errors
- SQL errors: diagnosis and fixes
- SQL syntax error
- JOIN with duplicate rows
- UPDATE or DELETE without WHERE
- NULL in WHERE returns no rows
- WHERE with <> does not include NULL
- LEFT JOIN loses rows
- GROUP BY with an ungrouped column
- Ambiguous column in SQLColumn does not exist in SQL
- The subquery returns more than one rowThe subquery returns more than one column
- Aggregate function in WHERE
- FOREIGN KEY fails
- INSERT: columns and values do not match
- Value too long for VARCHAR
- UNIQUE: duplicate value
- NOT NULL fails
- CHECK constraint fails
- Pagination repeats or skips rows
- DISTINCT and ORDER BY: column not selected
- UNION: the number of columns does not match
- UNION: incompatible types
- Alias does not work in WHERE
- Window function in WHERE
- CTE out of scope
- NOT IN does not return rows for NULL
- COUNT(*) with LEFT JOIN returns 1
- Division by zero in SQL
- Integer division loses decimals
- Deadlocks in transactions
- Nested aggregate functions
- Invalid date when converting text
- DROP COLUMN fails due to dependencies
SQL Glossary
- ADD COLUMN vs MODIFY COLUMN
- Grouping by month in SQL
- Alias
- Aliases with COUNT and SUM
- Aliases in subqueries
- ALTER TABLE
- ALTER TABLE on large tables
- AND, OR and NOT
- AVG
- Adding constraints with ALTER TABLE
- BEGIN / START TRANSACTION
- BETWEEN
- Best practice for aliases
- CASE
- CAST
- CHECK
- Composite primary key
- Auto-generated keys: IDENTITY, AUTO_INCREMENT and AUTOINCREMENT
- COALESCE
- Generated columns in SQL: GENERATED ALWAYS AS
- COMMIT
- CONCAT
- COUNT
- COUNT(DISTINCT) on multiple columns
- CREATE TABLE
- CREATE TABLE AS SELECT
- CROSS JOIN
- Recursive CTE with WITH RECURSIVE
- CURRENT_DATE
- CURRENT_TIMESTAMP
- How to use aliases in SELECT
- DEFAULT
- DELETE
- DELETE vs TRUNCATE vs DROP
- DISTINCT
- DROP TABLE
- Dropping columns with ALTER TABLE: practical examples
- Finding duplicates with GROUP BY and HAVING
- Common SQL alias mistakes
- EXCEPT
- EXISTS
- EXPLAIN
- EXTRACT
- FILTER (WHERE ...) in SQL aggregates
- FIRST_VALUE and LAST_VALUE in SQL
- FOREIGN KEY
- FROM
- FULL OUTER JOIN
- SQL Glossary
- GROUP BY
- GROUP BY with multiple columns
- HAVING
- IN
- INDEX
- Index on a FOREIGN KEY: when to create one
- INNER JOIN
- INNER JOIN vs LEFT JOIN
- INSERT INTO
- INSERT INTO ... SELECT
- INTERSECT
- IS DISTINCT FROM
- IS NULL / IS NOT NULL
- JOIN
- LAG
- LEAD
- LEFT JOIN
- LENGTH
- LIKE
- LIMIT
- MAX
- MERGE
- MIN
- Planning a structural change with ALTER TABLE
- Isolation levels
- NOT NULL
- NULLIF
- NULLS FIRST / LAST
- OFFSET
- ON DELETE CASCADE with FOREIGN KEY
- ORDER BY
- ORDER BY CASE
- OUTER JOIN
- OVER
- PARTITION BY
- PRIMARY KEY
- Query
- RANK and DENSE_RANK
- Renaming columns and tables with ALTER TABLE
- REPLACE
- RETURNING with INSERT, UPDATE and DELETE
- RIGHT JOIN
- ROLLBACK
- ROUND
- ROW_NUMBER
- ROWS BETWEEN / window frame
- SAVEPOINT
- SELECT
- SELF JOIN
- STRING_AGG and GROUP_CONCAT: concatenating rows in SQL
- Subquery
- SUBSTRING
- SUM
- SUM with CASE WHEN
- Adding and subtracting dates in SQL
- Temporary tables in SQL: CREATE TEMP and TEMPORARY TABLE
- TABLE
- Top N per group in SQL with ROW_NUMBER()
- Database normalisation
- Filtering between two dates
- SQL order of execution
- Running sums in SQL
- Moving average in SQL
- Compare two tables in SQL
- Removing duplicates
- PIVOT: rows to columns
- Streaks of consecutive days
- SQL data types
- TRIM
- TRUNCATE TABLE
- UNION
- UNION ALL
- UNION vs UNION ALL
- UNIQUE
- UPDATE
- UPPER and LOWER
- UPSERT in SQL: ON CONFLICT and ON DUPLICATE KEY UPDATE
- VIEW
- Views in SQL Server
- WHERE
- WHERE vs HAVING
- WITH and CTE
- CTE vs subquery
- Composite indexes in SQL: several columns and their order
- Partial or filtered indexes in SQL: indexing only some rows
- Indexes on expressions, or functional indexes
- NTILE
- Keyset / cursor pagination
- UPDATE with JOIN / UPDATE FROM
- DELETE with JOIN / USING
- GROUPING SETS / ROLLUP / CUBE
- Anti-join: NOT EXISTS / LEFT JOIN
- Date differences
- PERCENT_RANK / CUME_DIST
- LEAST / GREATEST
- LATERAL / APPLY
- Percentage of the total in SQL
- Grouping by ranges with CASE in SQL
- First and last day of the month in SQL
- UPDATE with CASE: updating several rows with different values
- ON UPDATE CASCADE with FOREIGN KEY