07eTroubleshootingQueries

Database Management

Mick McQuaid

University of Texas at Austin

10 May 2026

Number One Error

Not including a semicolon after the query

Number Two Error

Confusing a SQLite dot command for a SQL query

Number Three Error

  • Being at a terminal prompt instead of a sqlite prompt
  • The standard sqlite prompt is sqlite>
  • Terminal prompts vary from $ to % to > to others

Number Four Error

Mistakes in case: remember that SQL keywords are case insensitive but table and column names are not

Number Five Error

Incorrect punctuation: missing commas, unclosed quotes, mismatched parentheses

Number Six Error

Order of operations: SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY

More Advice

  • Try to isolate the issue by cutting things out
  • Check what databases are available with .databases
  • Check what tables are available with .tables
  • Check table info with, e.g., pragma table_info(Books);
  • Check schema with .schema
  • Use the up arrow to see what commands you recently sent
  • Use .dump to see the SQL that created the current database

END

Colophon

This slideshow was produced using quarto

Fonts are Roboto, Roboto Light, and Victor Mono Nerd Font