Exercise 2: Choosing a Data Access Approach — Possible Solution ================================================================= (a) A one-off script that copies data between two tables A plain driver. The script is small and will only run once or twice; a couple of SQL statements are the clearest way to express "copy these rows". Setting up an ORM's schema and generation step would be more work than the script itself. (b) A medium-sized TypeScript web app built by a small team An ORM such as Prisma. There will be many ordinary queries (create a user, list posts, update a comment), the data model will change over time, and several people will work on it. Generated types catch mistakes early, and Prisma Migrate keeps everyone's database schema in step. (c) A reporting tool made mostly of complex, hand-tuned SQL A plain driver or a query builder. The value of this tool is in precise SQL — window functions, carefully chosen joins, database- specific features — that an ORM's query API isn't designed for. (If the rest of the application already uses Prisma, its raw SQL features can also cover this case.) WHY THIS WORKS AS AN ANSWER ------------------------------ It judges each case on its real needs — size, lifespan, team, and how much of the work is custom SQL — rather than treating one approach as always right. Other answers are reasonable if they're justified.