Learn SQL

Learn SQL by actually writing SQL code

Table of Contents

Show Exercises

1.Getting Started

2.Select

3.Select and filter

4.Less than and greater than

5.Less than and greater than with equal to

6.Comments

7.AND & OR

8.BETWEEN & NOT BETWEEN

9.IN & NOT IN

10.NULL value

11.LIKE value

12.NOT LIKE value

13.DISTINCT operator

14.Select specific column

15.COUNT operator

16.AS operator

17.COUNT & DISTINCT

18.SUM and AVG

19.MAX and MIN

20.Select multiple data

21.ORDER BY

22.ORDER BY - Ascending and Descending

23.ORDER BY - More use cases

24.LIMIT

25.LIMIT with ordering and offset

26.Using LENGTH

27.Date functions

28.Arithmetic - Operations on columns

29.Arithmetic - Filtering and Ordering

30.Selecting modified data from rows

31.Combining data from columns

32.Handling NULL

33.GROUP BY - with COUNT

34.GROUP BY - with other aggregate functions

35.GROUP BY - more use cases

36.GROUP BY - multiple columns

37.GROUP BY - GROUP_CONCAT

38.JOINS - INNER JOIN

39.JOINS - OUTER JOIN

40.JOINS - SELF JOIN

41.JOINS - Multiple tables

42.JOINS - Filtering and Ordering

43.JOINS - Grouping

44.JOINS - Complex grouping

45.JOINS - Cartesian Product

46.UNION

47.INTERSECT and EXCEPT

48.Subqueries

49.Subqueries in FROM clause

50.Correlated subqueries

51.Subqueries - EXISTS operator

52.Creating tables

53.Inserting data in tables

54.Executing multiple statements

55.Column constraints - NOT NULL and UNIQUE

56.Column constraints - DEFAULT and CHECK

57.Table constraints - PRIMARY KEY

58.PRIMARY KEY - AUTOINCREMENT

59.Table constraints - FOREIGN KEY

60.Updating data in tables

61.Deleting data from tables

62.Adding and updating columns

63.Renaming and deleting tables

64.SQL statements with subqueries

65.VIEWS