SQLite | The School of Code

Settings

Appearance

Choose a typography theme that suits your style

SQLite

Learn database fundamentals with SQLite, the world's most widely deployed database.

1

SELECT Basics

SQLite uses SELECT to retrieve data from tables. It’s the foundation of all database queries.

Example

Run this example to see how it works and then try the exercise.

example.sql
Loading...
Output
Click "Run" to see the example in action...
Exercise
main.sql
Loading...
Output
Click "Run" to execute your code...
Quiz

What does SELECT * return?

SUMMARY

In this section, you learned how to retrieve data with SELECT. Next, you'll learn how to filter data with WHERE clause.

2

WHERE Clause

The WHERE clause filters rows based on conditions. Only rows that match the condition are returned.

Example

Run this example to see how it works and then try the exercise.

example.sql
Loading...
Output
Click "Run" to see the example in action...
Exercise
main.sql
Loading...
Output
Click "Run" to execute your code...
Quiz

Which operator is used for 'not equal to' in SQL?

SUMMARY

In this section, you learned how to filter data with WHERE clause. Next, you'll learn how to sort results with ORDER BY.

3

ORDER BY

ORDER BY sorts results by one or more columns. Use ASC for ascending (default) or DESC for descending.

Example

Run this example to see how it works and then try the exercise.

example.sql
Loading...
Output
Click "Run" to see the example in action...
Exercise
main.sql
Loading...
Output
Click "Run" to execute your code...
Quiz

What is the default sort order if not specified?

SUMMARY

In this section, you learned how to sort results with ORDER BY. Next, you'll learn how to limit results with LIMIT and OFFSET.

Unlock 10 More Lessons

You've completed the free preview! Upgrade to Pro to access all 12 lessons in this course, plus advanced projects and certificates.

Locked lessons:
  • LIMIT and OFFSET
  • INSERT Statements
  • UPDATE Statements
  • DELETE Statements
  • Aggregate Functions
  • GROUP BY
  • JOINs
  • Subqueries
  • Final Project: Library Database
SELECT Basics 1
WHERE Clause 2
ORDER BY 3
Unlock 10 more lessons Access all content with Pro
Upgrade
LIMIT and OFFSET 4 INSERT Statements 5 UPDATE Statements 6 DELETE Statements 7 Aggregate Functions 8 GROUP BY 9 JOINs 10 Subqueries 11 Final Project: Library Database 12

Reset Progress?

Are you sure you want to reset all progress for this course? This action cannot be undone.