Exercise 1: sqlite3 mydata.db vs. MySQL/Postgres's Install-Then-Connect Workflow — Possible Solution ==================================================================== WHAT RUNNING sqlite3 mydata.db ACTUALLY DOES ------------------------------ Per this chapter, "that single command opens mydata.db if it already exists, or creates a brand-new, empty database at that path if it doesn't — and immediately drops into an interactive prompt. No authentication step, no host or port to specify." The command checks whether a file already exists at the given path: if so, it opens that existing database; if not, it creates a brand-new, empty database file at that exact path. Either way, the command drops directly into an interactive SQL prompt with no separate steps in between. MYSQL'S MULTI-STEP WORKFLOW ------------------------------ Per this chapter, "mysql1 walked through installing a MySQL server package, starting the service, and then connecting a client to it," and this chapter's own comparison table lists the concrete steps: install the server package, start the service, run mysql -u user -p to connect, then CREATE DATABASE to actually create the database itself, before finally being able to use it. POSTGRES'S MULTI-STEP WORKFLOW ------------------------------ Per this chapter, "postgres1-2 walked through installing Postgres, running initdb, starting the service, and connecting via psql," with this chapter's own table listing: install the server package, run initdb and start the service, then run psql -U user dbname to connect. THE CONTRAST ------------------------------ Both MySQL and Postgres require several distinct, sequential steps — installing separate server software, initializing/starting that server as its own running process, and then connecting a separate client to it — before a single SQL statement can even be run. SQLite collapses this entire sequence into one command: sqlite3 mydata.db does everything needed (locating or creating the database, and opening an interactive session) in a single step, because there was never a separate server to install or start in the first place — this is the direct, practical demonstration of sqlite1-1's own "no server" claim. WHY THIS WORKS AS AN ANSWER ------------------------------ It explains the open-or-create behavior precisely, and lays the full MySQL and Postgres workflows (using the chapter's own comparison table) directly alongside SQLite's single command to make the contrast concrete rather than asserting it abstractly.