CSCI 3342 Web Development
Spring 2024

Database and SQL

SQL CRUD

Not a widely loved language.
The Structured Query Langauge (SQL, pronounced either as "S-Q-L" or "sequel") has been around for a very long time. It's a declarative langauge (like HTML, as opposed to procedural languages like JavaScript) that defines queries to request or update data in an RDBMS. SQL is powerful and flexible, and every RDBMS has its own extensions to the language. Fortunately, the core standard hasn't changed in forever, is well-supported by every RDBMS, and is sufficient for typical app usage.
That typical usage is often referred to as Create-Read-Update-Delete (CRUD). For most apps, that's 90% of what they need to do: create a record in a table, read records from tables, update a record in a table, or delete a record from a table. Follow the video below to manually run some SQL commands in DB Browser for SQLite.
Keep all your SQL queries in a file queries.txt and commit it to your repo.

SELECT, INSERT, UPDATE, DELETE (16:19)

The basics, plus a little join.
Additional resource: SQL Tutorial @w3schools.

Assignment Checklist

Write and run SELECT queries with WHERE clauses in DB Browser for SQLite
Write and run an INSERT query in DB Browser for SQLite
Write and run a DELETE-by-id query in DB Browser for SQLite
Write and run an UPDATE-by-id query in DB Browser for SQLite
Write and run a SELECT JOIN query in DB Browser for SQLite
Commit your queries.txt file