This is a collection of 30 'worked examples' where I show the viewer how I go about writing SQL queries. SQL queries are rarely written left-to-right, top-to-bottom. Instead, a database developer typically builds their queries up from small and simple to more complex. These playbacks show how my queries grow as I get closer and closer to a correct solution. They also emphasize how to use an ER Diagram and schema when writing queries.
The database I am using describes courses taken by students in a university. It is a SQLite database called studentGrades.sqlite. Here are the entities and relationships:
Entites:
Relationships:
Here is an ER Diagram and schema describing the database:
If you are brand new to SQL you might want to start with another one of my 'books' of code playbacks:
Database Design and SQL for Beginners
If you would like to learn how to write programs that use a database you can read:
Programming with SQLite.
If you'd like to stay connected and get updates when I add new playbacks you can follow me on twitter:@markm208.