bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL

SQL

SQL Tutorial

SQL Tutorial focused on Introduction to SQL and related concepts.

Lesson 1visual

SQL Tutorial

SQL Tutorial

2 min
Read lesson →
Lesson 2visual

Introduction to SQL

Introduction to SQL

2 min
Read lesson →
Lesson 3visual

SQL Syntax

SQL Syntax

2 min
Read lesson →
Lesson 4visual

SQL SELECT Statement

The SQL SELECT Statement The SELECT statement is used to select data from a database. Example Return data from the Customers table: SELECT CustomerName, City FROM Customers; SELECT Syntax SELECT colu…

2 min
Read lesson →
Lesson 5visual

SQL SELECT DISTINCT Statement

SQL SELECT DISTINCT Statement

2 min
Read lesson →
Lesson 6visual

SQL WHERE Clause

The SQL WHERE Clause The WHERE clause is used to filter records. The WHERE clause is used to extract only those records that fulfill a specific condition. Example Here we select all customers from Me…

2 min
Read lesson →
Lesson 7

SQL ORDER BY Keyword

The SQL ORDER BY The ORDER BY keyword is used to sort the result-set in ascending or descending order. The ORDER BY keyword sorts the result-set in ascending order (ASC) by default. Example Sort the…

2 min
Read lesson →
Lesson 8visual

SQL AND Operator

The SQL AND Operator The WHERE clause can contain one or many AND operators. The AND operator is used to filter records based on more than one condition. Note: The AND operator displays a record if a…

2 min
Read lesson →
Lesson 9visual

SQL OR Operator

The SQL OR Operator The WHERE clause can contain one or more OR operators. The OR operator is used to filter records based on more than one condition. Note: The OR operator displays a record if any o…

2 min
Read lesson →
Lesson 10visual

SQL NOT Operator

The NOT Operator The NOT operator is used in the WHERE clause to return all records that DO NOT match the specified criteria. It reverses the result of a condition from true to false and vice-versa.…

3 min
Read lesson →
Lesson 11visual

SQL INSERT INTO Statement

The SQL INSERT INTO Statement The INSERT INTO statement is used to insert new records in a table. It is possible to write the INSERT INTO statement in two ways: Syntax 1 Specify both the column names…

3 min
Read lesson →
Lesson 12visual

SQL NULL Values

SQL NULL Values

2 min
Read lesson →
Lesson 13visual

SQL UPDATE Statement

The SQL UPDATE Statement The UPDATE statement is used to update or modify one or more records in a table. UPDATE Syntax UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition ;…

3 min
Read lesson →
Lesson 14visual

SQL DELETE Statement

The SQL DELETE Statement The DELETE statement is used to delete existing records in a table. DELETE Syntax DELETE FROM table_name WHERE condition ; Note: Be careful when deleting records in a table!…

2 min
Read lesson →
Lesson 15visual

SQL SELECT TOP, LIMIT and FETCH FIRST

The SQL SELECT TOP Clause The SELECT TOP clause is used to limit the number of records to return. The SELECT TOP clause is useful on large tables with thousands of records. Returning a large number o…

3 min
Read lesson →
Lesson 16

SQL Aggregate Functions

SQL Aggregate Functions An aggregate function is a function that performs a calculation on a set of values, and returns a single value. Aggregate functions are often used with the GROUP BY clause of…

2 min
Read lesson →
Lesson 17

SQL MIN() F unction

SQL MIN() F unction

2 min
Read lesson →
Lesson 18

SQL MAX() Function

SQL MAX() Function

2 min
Read lesson →
Lesson 19

SQL COUNT() Function

SQL COUNT() Function

2 min
Read lesson →
Lesson 20

SQL SUM() Function

SQL SUM() Function

2 min
Read lesson →
Lesson 21

SQL AVG() Function

SQL AVG() Function

2 min
Read lesson →
Lesson 22visual

SQL LIKE Operator

SQL LIKE Operator

3 min
Read lesson →
Lesson 23visual

SQL Wildcards

SQL Wildcard Characters A wildcard character is used to substitute one or more characters in a string. Wildcard characters are used with the LIKE operator. The LIKE operator is used in a WHERE clause…

3 min
Read lesson →
Lesson 24visual

SQL IN Operator

The SQL IN Operator The IN operator is used in the WHERE clause to check if a specified column's value matches any value within a provided list. The IN operator functions as a shorthand for multiple…

2 min
Read lesson →
Lesson 25

SQL BETWEEN Operator

The SQL BETWEEN Operator The BETWEEN operator is used in the WHERE clause to select values within a specified range. The range is inclusive - the beginning and end values of the range are included in…

2 min
Read lesson →
Lesson 26visual

SQL Aliases

SQL Aliases SQL aliases are used to give a column or a table a temporary name. Aliases are used to make column names more readable. An alias only exists for the duration of that query. An alias is cr…

3 min
Read lesson →
Lesson 27

SQL Joins

The SQL JOIN Clause The JOIN clause is used to combine rows from two or more tables, based on a related column between them. Here are the different types of JOINs in SQL: (INNER) JOIN : Returns only…

2 min
Read lesson →
Lesson 28

SQL INNER JOIN

SQL INNER JOIN

2 min
Read lesson →
Lesson 29visual

SQL LEFT JOIN

SQL LEFT JOIN

2 min
Read lesson →
Lesson 30

SQL RIGHT JOIN

SQL RIGHT JOIN The RIGHT JOIN returns all rows from the right table (table2), and only the matched rows from the left table (table1). If there is no match in the left table, the result for the column…

2 min
Read lesson →
Lesson 31visual

SQL FULL JOIN

SQL FULL JOIN The FULL JOIN returns all rows when there is a match in either the left or right table. If a row in the left table has no match in the right table, the result set includes the left row'…

2 min
Read lesson →
Lesson 32visual

SQL Self Join

SQL Self Join A self join is a regular join, but the table is joined with itself. Self Join Syntax SELECT column_name(s) FROM table1 T1, table1 T2 WHERE condition ; T1 and T2 are different table alia…

2 min
Read lesson →
Lesson 33visual

SQL UNION Operator

The SQL UNION Operator The UNION operator is used to combine the result-set of two or more SELECT statements. The UNION operator automatically removes duplicate rows from the result set. Requirements…

2 min
Read lesson →
Lesson 34visual

SQL UNION ALL Operator

The SQL UNION ALL Operator The UNION ALL operator is used to combine the result-set of two or more SELECT statements. The UNION ALL operator includes all rows from each statement, including any dupli…

2 min
Read lesson →
Lesson 35visual

SQL GROUP BY Statement

The SQL GROUP BY Statement The GROUP BY statement is used to group rows that have the same values into summary rows, like "Find the number of customers in each country". The GROUP BY statement is alm…

2 min
Read lesson →
Lesson 36visual

SQL HAVING Clause

The SQL HAVING Clause The HAVING clause is used to filter the results of a GROUP BY query based on aggregate functions. Unlike the WHERE clause, which filters individual rows before grouping, HAVING…

2 min
Read lesson →
Lesson 37visual

SQL EXISTS Operator

The SQL EXISTS Operator The EXISTS operator is used in a WHERE clause to check whether a subquery returns any rows. The EXISTS operator evaluates to TRUE if the subquery returns at least one row, and…

2 min
Read lesson →
Lesson 38

SQL ANY Operator

The SQL ANY Operator The ANY operator is used to compare a value to every value returned by a subquery. The ANY operator evaluates to TRUE if at least one value in the subquery result-set meet the co…

2 min
Read lesson →
Lesson 39

SQL ALL Operator

The SQL ALL Operator The ALL operator is used to compare a value to every value returned by a subquery. The ALL operator evaluates to TRUE if every value in the subquery result-set meet the condition…

2 min
Read lesson →
Lesson 40

SQL SELECT INTO Statement

SQL SELECT INTO Statement

2 min
Read lesson →
Lesson 41visual

SQL INSERT INTO SELECT Statement

The SQL INSERT INTO SELECT Statement The INSERT INTO SELECT statement is used to copy data from an existing table and insert it into another existing table. The INSERT INTO SELECT statement requires…

2 min
Read lesson →
Lesson 42

SQL CASE Expression

The SQL CASE Expression The CASE expression is used to define different results based on specified conditions in an SQL statement. The CASE expression goes through the conditions and stops at the fir…

2 min
Read lesson →
Lesson 43

SQL NULL Functions

SQL COALESCE(), IFNULL(), ISNULL(), and NVL() Functions Operations involving NULL values can sometimes lead to unexpected results. SQL has some built-in functions to handle NULL values, and the most…

2 min
Read lesson →
Lesson 44visual

SQL Stored Procedures

SQL Stored Procedures

3 min
Read lesson →
Lesson 45

SQL Comments

SQL Comments Comments are used to explain SQL code, or to temporarily prevent execution of SQL code (for debugging). Comments are ignored by the database engine. SQL supports single-line comments --,…

2 min
Read lesson →
Lesson 46

SQL Operators

SQL Operators SQL operators are keywords and symbols used to perform operations with data values. SQL operators are used in SQL statements like SELECT, WHERE, LIKE, etc. SQL operators is categorized…

2 min
Read lesson →