What to Focus on when Learning on SQL for a Day¶
- Getting started with SQLite Browser
- SELECTing rows FROM data tables
- LIMIT and ORDER BY in SQL queries
- USING the WHERE clause to filter data in SQL
- More Boolean Expressions to Filter SQL Queries Using LIKE, IN, BETWEEN, and wildcards to match multiple values in SQL
- Functions for transforming text and numbers in SQL
- Aliasing Columns and Tables in SQL Databases
Now, I don’t expect you to master these concepts in a weekend or a week. So what do I want you to focus on while I show things in class? If I could describe it in a couple of words: Push and Flow.
Push and Flow¶
For the first part of SQL education, where we cover the basic concepts of selecting, filtering, sorting, etc. data, I expect you to read this amount of bulk lessons:
- I want you to see the flow of my work and thought process.
- And I also want to give you ideas on how to push yourself to challenge whether you get the full syntax or not.
Some concepts:
- The basic and mundane steps of starting the database client and opening a database file
- Navigating around the client, particularly how to get to the Query Editor
- How I start by tackling a complex question with simple step of a query.
- How I write my queries and execute them one step at a time.
- How I use keyboard shortcuts to make this process faster.
- How I deliberately make errors in my queries to make sure that my query isn’t accident by “lucky”
- How I ask very simple questions to make sure my query comes up with the expected answers.
Concepts to be gathered more formally in a guide¶
SQL syntax¶
End all statements with a semicolon, even if it doesn’t affect the GUI client
Avoid special punctuation – hypbens, arithmetic signs, etc. – as much as possible when using it for the name, i.e. the identifier of a column or table.
- Commas
- Used to separate columns in a list, such as in a
SELECT
orORDER BY
clause
- Used to separate columns in a list, such as in a
- Whitespace is insignificant
- Consecutive spaces are treated as a single space
- Newline space is the same as a space character
- Tokens don’t require the use of spaces as separators
Syntax is case-insensitive, e.g.
ORDER BY
andorder by
SQL style¶
Too many human and technical things to incorporate. But here’s a couple of guides that I will derive from: