[DAY 87-89] I created a bash script to build a student database

thomascansino

Thomas Cansino

Posted on July 24, 2024

[DAY 87-89] I created a bash script to build a student database

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 87-89, I continued where I left off last blog, which is building a student database to learn SQL by creating a bash script that uses SQL to enter information about CS students into Postgres.
Image description

I created 4 tables in the database which are: students, majors, courses, and majors_courses.

After that, I assigned primary keys for each table:

  • student_id for students table
  • major_id for majors table
  • course_id for courses table
  • major_id and course_id (composite primary keys) for majors_courses table

I also linked each table with foreign keys:

  • major_id for students table to link with majors table
  • major_id for majors_courses table to link with majors table
  • course_id for majors_courses table to link with courses table  

Then, I proceeded to create a script in bash to automate the process of inserting values in every table.

With that, I finished building the student database where I learned much about postgres queries on joining, filtering, and sorting tables. As well as making a bash script to automate the process of creating a database.
Image description

Moving forward, I started the next solo project in the course which is a database consisting of world cup games with postgres.
Image description

The requirement is that I must create a bash script that enters values into the database consisting of world cup games into PSQL.

However, this part is not done yet and I’ll be continuing this build next week. 

Overall, I thought I wasn’t going to grasp the concepts I just learned and just rely on the good ol’ “build side projects to fill in the knowledge gaps”

Fortunately, because of the repetitions throughout the whole course, I was able to quickly pick up the principles behind it. Due to this, I haven’t been having much trouble with the solo projects so far. 

I give props to freecodecamp for providing a comprehensive course about databases and scripts.

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

💖 💪 🙅 🚩
thomascansino
Thomas Cansino

Posted on July 24, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related