BigBinary Academy
Learn SQL
Learn SQL by actually writing SQL code
Table of Contents
Reset Course Progress
1
Getting Started
1.1
All you need is a working internet connection
1.2
Let us know what you think of BigBinary Academy
1.3
Next & Previous page using keyboard
1.4
Running code using keyboard
2
Select
2.1
SELECT *
3
Select and filter
3.1
Select all Python students
3.4
Select where not equal to
4
Less than and greater than
4.1
Select where less than
4.3
Select where greater than
5
Less than and greater than with equal to
5.1
Select where less than or equal to
5.3
Select where greater than or equal to
6
AND & OR
6.1
Select using AND condition
6.3
Select using OR condition
6.5
Select using both AND and OR
7
BETWEEN & NOT BETWEEN
7.1
Select using BETWEEN
7.3
Select using BETWEEN and other conditions
7.5
Select using NOT BETWEEN
8
IN & NOT IN
8.1
Select using IN
8.3
Select using NOT IN
9
NULL value
9.1
What is null
9.2
Select where NULL
9.4
Select where NOT NULL
10
LIKE value
10.1
Select all names starting with To
10.2
Select all names ending with r
10.3
Select all names containing ar
11
NOT LIKE value
11.1
Select where NOT LIKE
11.2
Select students course does not end with t
11.3
Select students course does not contain y
12
DISTINCT operator
12.1
SELECT DISTINCT
13
Select specific column
13.1
Select only name
13.2
Select only name & age
14
COUNT operator
14.1
Count all students
14.2
COUNT from a column
15
AS operator
15.1
AS to change the column header
15.3
AS - another example
16
COUNT & DISTINCT
16.1
COUNT with DISTINCT
17
SUM and AVG
17.1
Sum of ages
17.4
Average of marks
18
MAX and MIN
18.1
Maximum age
18.4
Minimum marks
19
Select multiple data
19.1
Select multiple data
20
ORDER BY
20.1
Order students by marks
20.3
Order students by grade and marks
21
ORDER BY - Ascending and Descending
21.1
Order students by marks in descending order
21.3
Order students by less age and more marks
22
ORDER BY - More use cases
22.1
Order students alphabetically
22.3
Order distinct courses alphabetically
23
LIMIT
23.1
Select only 5 students
23.3
Select 4 students enrolled in Python or Ruby
24
LIMIT with ordering and offset
24.1
Select top 10 students with highest marks
24.5
Select top students with highest marks from rank 6 to 10
25
Using LENGTH
25.1
Selecting LENGTH
25.3
Filter using LENGTH
25.5
Order using LENGTH
26
Arithmetic - Operations on columns
26.1
Introduction to Modulus.
26.2
Detecting even and odd with Modulus
26.4
Arithmetic operations on columns
26.6
Arithmetic operations on combination of columns
27
Arithmetic - Filtering and Ordering
27.1
Filter records with even values.
27.2
Filter using arithmetic
27.7
Modulo operation
27.9
Order using arithmetic
28
Selecting modified data from rows
28.1
Selecting boolean data from rows
28.3
Selecting non-column data from rows
28.5
Selecting conditional data from rows
29
Combining data from columns
29.1
Concatenating data from columns
30
Handling NULL
30.1
IFNULL
30.3
COALESCE
31
GROUP BY - with COUNT
31.1
Count students in each grade
32
GROUP BY - with other aggregate functions
32.1
GROUP BY and aggregate functions
33
GROUP BY - more use cases
33.1
GROUP BY modified column data
33.3
GROUP BY with ordering
33.5
Filters over results from GROUP BY
34
GROUP BY - multiple columns
34.1
GROUP BY over multiple columns
35
GROUP BY - GROUP_CONCAT
35.1
GROUP_CONCAT
36
JOINS - INNER JOIN
36.1
Context for JOINS
36.2
INNER JOIN
36.3
INNER JOIN - Continued
36.4
INNER JOIN - Column aliases for distinction
36.7
Aliasing table names in JOIN
37
JOINS - OUTER JOIN
37.1
LEFT OUTER JOIN
38
JOINS - SELF JOIN
38.1
SELF JOIN
39
JOINS - Multiple tables
39.1
Joining more than 2 tables
40
JOINS - Filtering and Ordering
40.1
JOINs with filters
40.4
JOINs with ordering
41
JOINS - Grouping
41.1
JOINs with GROUP BY
42
JOINS - Complex grouping
42.1
Grouping across more than 2 tables
43
JOINS - Cartesian Product
43.1
Cartesian product using JOINs
43.3
Cartesian product using SELF JOINs and filters
44
UNION
44.1
UNION
44.4
UNION ALL
45
INTERSECT and EXCEPT
45.1
INTERSECT
45.3
EXCEPT
46
Subqueries
46.1
Subqueries
46.4
Subqueries with multiple results
47
Subqueries in FROM clause
47.1
Subqueries in FROM
48
Correlated subqueries
48.1
Correlated subqueries in filter
48.3
Correlated subqueries in SELECT
49
Subqueries - EXISTS operator
49.1
Subqueries - EXISTS operator
49.4
Subqueries - NOT EXISTS operator
50
Creating tables
50.1
CREATE TABLE
50.3
CREATE TABLE - Data types
51
Inserting data in tables
51.1
Inserting records in a table
51.3
Inserting NULL records
51.5
Inserting multiple records
51.7
Inserting records in specific columns
52
Executing multiple statements
52.1
Executing multiple SQL statements
53
Column constraints - NOT NULL and UNIQUE
53.1
NOT NULL Constraint
53.3
UNIQUE Constraint
53.5
Combining constraints
54
Column constraints - DEFAULT and CHECK
54.1
DEFAULT Constraint
54.3
CHECK Constraint
55
Table constraints - PRIMARY KEY
55.1
PRIMARY KEY
55.2
PRIMARY KEY - Continued
55.4
PRIMARY KEY with multiple columns
56
PRIMARY KEY - AUTOINCREMENT
56.1
PRIMARY KEY - AUTOINCREMENT
57
Table constraints - FOREIGN KEY
57.1
FOREIGN KEY
58
Updating data in tables
58.1
Updating data in a column
58.3
Updating data in multiple columns
58.5
Updating data in all rows
59
Deleting data from tables
59.1
Deleting specific data from table
59.3
Deleting all data from table
60
Adding and updating columns
60.1
Adding columns to table
60.3
Renaming columns in table
61
Renaming and deleting tables
61.1
Renaming tables
61.3
Deleting tables
62
SQL statements with subqueries
62.1
Copying data from one table to another
62.4
Updating data using subqueries
63
VIEWS
63.1
VIEWS