This article introduces the opening topics of a 2020 SQL course. The instructor distinguishes SQL, the language used to work with databases, from SQLite, the database system used in the course with DB Browser for SQLite. The course begins with creating a database and planning tables before practicing commands with sample data.
Topics covered in the course introduction
- Database structure: learn how databases, tables, columns, and data types fit together before deciding which keys and relationships are needed.
- Keys and constraints: the course discusses primary keys, foreign keys, and unique constraints. Choose them based on which values identify records and which values must not be duplicated.
- Changing and querying data: the instructor says the course will demonstrate adding, deleting, and updating data, as well as querying records. Practice with a test database first, not with important data that has no backup.
- Inspecting results: use the database browser to run a statement, inspect tables, and check whether the result matches what you intended.
SQL and SQLite are not the same thing
SQL is a language for working with relational databases. SQLite is a database engine that supports SQL within its own feature set. SQLite’s documentation describes the SQL it supports; some syntax or capabilities can differ from MySQL, SQL Server, or PostgreSQL. Check the documentation for the database system you plan to use.
Practice after the introduction
- Create a test table with clearly named columns and an appropriate primary key.
- Add sample records, then query only the rows you expect.
- Update one test row using a specific condition and inspect the result before applying a change to many rows.
- Before deleting test data, check the condition and keep a backup of the database file.
- If information is split across tables, review the relationships and keys before writing a query that joins them.
These are practice ideas based on the introductory topics described for the course; they are not a summary of the entire six-hour course. The recording dates to 2020, so use it for the concepts and interface shown at that time. Check current installation instructions, software versions, and SQL features against the documentation for your chosen system.
Further reading
The examples are for general education. Back up important data and confirm a statement’s effect before running it against a live database.