Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.46 KB

lab_07.md

File metadata and controls

34 lines (23 loc) · 1.46 KB

Lab 7

Objective: Get experience writing data to and reading data from a database


Database CLI usage

Can use the CLI for DuckDB (and other databases):


You'll pair in your Lab group. Work on branches and submit pull requests for the chunks of work — you decide what the "chunks" are.


Steps

You'll be changing your API over to use DuckDB.

  1. Install the Python client.
  2. Create a SQL script to take data from your CSV file and write it to a persistent database.
  3. Update your API to read from the database.
  4. Add a table named "users" to your persistent database.
    • The table should have three columns: username, age, and country
  5. Add a POST method to add a new user to the table through your API
    • Use this method to add several made-up users
  6. Add a GET method to get the number of users, the average age, and the three countries with the most users.
  7. Submit via CourseWorks:
    • Links to the pull request(s)
    • A screenshot showing data in your database