[DAY 93-95] I built an interactive database in PostgreSQL using a shell script

Hi everyone! Welcome back to another blog where I document the things I learned in web development. I do this because it helps retain the information and concepts as it is some sort of an active recall.

On days 93-95, I picked up where I left off last blog, which is building an interactive database to rent and return bikes. I also built an interactive database to make appointments with a hair salon.

The first project is where I built an interactive database to rent and return bikes.

What I did first is to create a database with 3 tables: bikes, customers, and rentals.

After that, I assigned primary keys for each table:

  • bike_id for bikes table

  • customer_id for customers table

  • rentals_id for rentals table

I also linked the tables with foreign keys:

  • bike_id for rentals table to link with bikes table

  • customer_id for rentals table to link with customers table

Finally, I wrote a shell script that checks the available bikes, puts them up for rent, and returns the bikes that were rented.

The next project is another interactive database to make appointments with a hair salon. This is also part 3 out of 5 certification projects in the relational databases course in freecodecamp.

The first thing I did is to create a database with 3 tables: appointments, customers, and services.

After that, I assigned primary keys for each table:

  • appointment_id for appointments table

  • customer_id for customers table

  • service_id for services table

I also linked the tables with foreign keys:

  • customer_id for appointments table to link with customers table

  • service_id for appointments table to link with services table

Finally, I wrote a script that gives you a list of salon services, gets your name and your phone number, and schedules you for an appointment of your chosen service.

Anyways, that’s all for now, more updates in my next blog! See you there!