SQL (Single table operations)

Projected Time

About 3.5-4 hours

Prerequisites

Motivation

Most software applications store data of some sort – user data, content, etc. Databases are used to store data, so software developers should know how to use them. Relational databases are a common type of database that are good for storing many types of data. Most companies use relational databases to store their data.

Objectives

Participants will be able to:

Specific Things to Learn

Materials

Lesson

Common Mistakes / Misconceptions

Independent Practice

Section 1: Creating tables and basic querying

  1. Work through the Codecademy SQL Tutorial Section 1 (Manipulation):
  2. SQLite is a version of SQL that comes installed on mac! Try it out:
  3. Using SQLite, try creating tables and adding, updating, deleting, and querying data yourself!

  4. Download and install DB Browser for SQLite via its download page. Try opening the database you just created! Browse the data and get a feel for how to move around. One way to view SQL data is through the command line, and another way is through graphical tools like the SQLite Browser.

  5. Try writing queries for the following using the food table:

Section 2: Queries

  1. Work through the Codecademy SQL Tutorial Section 2 (Queries)

  2. In sqlite, try writing queries for the following using the food table. Add some data to the table that meets the criteria below so you’ll have something to query for.

Section 3: Advanced queries

  1. Now do the Codecademy SQL Tutorial Section 3 (Aggregate functions)

  2. Try writing queries for the following using the food table:

Supplemental Materials