Exercise Monday

Goal: Focus on familiarizing yourself with the concepts from the homework. Including SQL commands, interacting with a database through a Java application, database schema and relationships, and testing with databases.


SQL Statements Practice

Use the cheat sheet from this weekend's SQL Basics lesson to practice SQL command writing. Here are some guidelines for directed practice. Make sure each partner has the opportunity to write each kind of command at least once.

  • Generate a database with a few tables: Maybe one for games, one for sports, and another for hobbies.
  • Add columns to your tables: Perhaps name, level of difficulty, average duration, number of people required, type.
  • Focus on one table: Drop one of the columns you created.
  • Add primary keys to each table.
  • Manually insert information into your tables (at least 3-4 rows each).
  • Run some SELECTs on the tables that you created to return specific data.
  • Run some SELECT statements with different operators (such as WHERE and LIKE)
  • Update data in your tables.
  • Delete some records.
  • Drop the tables you made.
  • Drop the entire database.

Database Schema Practice

  • Use SQL Designer to generate schema for at least two of the applications you created on either Wednesday or Thursday of last week.
  • Using your schema as a guide, create a database in PSQL.
  • Populate your tables with some sample data.

Before moving on, compare schemas with at least two other groups and discuss why they're structured in the manner you selected. Offer feedback as necessary.

Database-Backed To Do List

As mentioned in this week's objectives, we're going to build a fully-functional, database-supported To Do List application this week, just like we created our Blog together last week.

Begin building your To Do List application by working through the following lessons with your partner in class:

Then, after you've completed the features detailed in these in-class lessons, update your application and its database to utilize the completed property included in the Task class. Allow users to see only the completed or only the incomplete Tasks in a specific Category. Make sure to include tests for all additional behaviors.

Further Exploration: Address Book

If you complete the To Do List with time to spare, create an Address Book application. Begin with an Entry class that (at the very least) contains properties to hold a name, phone number, mailing address, and email address. Use SQL designer to create a schema before you begin coding.

Further Exploration: Add Databases to Previous Projects

If you're able to complete all projects above, go back and add a database to a project from last week. Make sure to design a schema before coding, and include tests for all behaviors.

If you successfully integrate a database into one partner's project, repeat this process and add a database to a project the other partner created last week.

Peer Code Review

  • Do the database table and column names follow proper naming conventions?
  • Is there a one-to-many relationship set up correctly in the database?
  • Are all routes RESTful?
  • Does the application work as expected?
  • Are tests in place for ALL behaviors?
  • Do all tests pass?