Lesson Weekend

Before this course section, data for our programs has been stored in our computers' random-access memory, or RAM. Memory (RAM) is a fast, temporary place to store information, but it's not suitable for long-term storage. Anything we want to have saved after our programs end and our machines have been powered off needs to be written to permanent storage on a hard disk. Beginning in this course section, we will store data in a database.

In this section, we will cover:

  • Postgres, the Structured Query Language (SQL) database management system we will use with Ruby
  • Relational database basics
  • SQL statements to select, insert, retrieve, update and delete data
  • How objects in Ruby and tables in Postgres work together with data
  • Building a Sinatra application with a database
  • CRUD functionality including implementation of HTTP methods: PATCH/PUT and DELETE

Note that this will be another challenging course section! It is difficult to work with raw SQL and we are continuing to use complex nesting for our CRUD applications. Ultimately, Rails and ActiveRecord will make this much easier. However, it's very important to understand how both SQL and routing work.

Independent Project Objectives


At the end of this section, you will complete an independent project. Your code will be reviewed for the following objectives:

  • Tests are 100% passing. You may not significantly alter the included tests but you may add additional tests as necessary.
  • Database is set up correctly, using standard naming conventions.
  • Correct set up of a one-to-many relationship.
  • Application has all required CRUD functionality.
  • Sinatra routes follow RESTful conventions.
  • Project is in a polished, portfolio-quality state.
  • The prompt’s required functionality and baseline project requirements are in place by the deadline.

Lesson 1 of 29
Last updated August 7, 2022