Another year, another course review. In this post, I’ll be writing about CPSC 340, CPSC 304 & CPSC 312, which I took in 2021 WT1 at UBC. As usual, I tried to make these as objective as possible by keeping my opinions in the ‘My Experience’ section, but as an additional disclaimer, everything is based on my personal experience and opinion.

CPSC 304 Introduction to Relational Databases

Introduction

All the database things, including ER models (databases diagrams), database design and normalization, relational query language, SQL, data warehouses and data mining.

The course also includes a project in a team of 3, where you you design a database schema for a real world entity (e.g., school, library), from drafting the database schema diagram, to creating the tables and inserting dummy data, to creating a backend to query the database.

Lecture Topics

  • ER diagrams
  • database schema normalization, functional dependencies
  • relational algebra
  • SQL queries
  • data warehousing and data mining

Coursework

  • database project with 6 milestones
  • 2 midterms + final exam
  • in class exercises

Project

The project was only worth 25%, and accordingly, it’s not a big or difficult portion of the class, but it does take some time to complete and discuss with your team.

We began by choosing a real-world database application, for example a library management system that keeps a books catalogue, users, each users’ borrowed books and due dates, etc. This also included drawing the ER diagram, where the entities and relationships of the system are modelled. Then we mapped the diagram to tables, which included deciding on keys and normalizing the tables to a standard format to reduce redundency. Finally, we created the tables in SQL, and populated them with dummy data. I think this part of the project took the longest simply because of the number of tables and relationships.

The end product was a webpage, which allows the user to do some sample queries on the database, for example, “Insert a new book into the library”, or “Select the average cost of all the books in the library”. The backend portion consisted of creating the SQL connection and executing the queries. The webpage also has a simple HTML/CSS frontend for the user to enter a few details of their query, like the name of the new book to be inserted, and see the printed table contents after the query. This coding portion was very minimal, and mostly copying pasting from a provided template and then modifying the contents.

Tech stack

  • Database: Oracle DB
  • Database access: SQL plus, “the most basic Oracle Database utility, with a basic command-line interface” (Wikipedia)
  • backend/SQL connection: Java/JDBC or PHP
  • frontend: HTML/CSS

Experience

I found the course material to be very theoretical for something that I thought was going to be more practical. Though the project sounds like a practical and good idea, the technology seemed to be pretty outdated, such as using SQL Plus on the command line to access the db to display table contents. I definitely think there are better tools out there.

Bottom line: if you already know how to do SQL queries like I did from my previous co-op, then there’s not much additional/useful/interesting takeaways from CPSC 304, and don’t think that you are obligated to take it because everyone else takes it, or says that databases skills are employable. Personally I found that the course clarified a few concepts of SQL queries that I found confusing previously, but for me it wasn’t worth a whole term. But if you don’t know anything about SQL, then it is worth learning.

Workload: 2/5 Difficulty: 1/5 Usefulness: 2.5/5

CPSC 340 Machine Learning and Data Mining

Introduction

In this class, you can expect to learn about and implement machine learning models, including classifiers such as decision trees, K-means, and Naive Bayes, linear regression with different loss functions and regularization, minimization algorithms (gradient descent) and neural networks. Lectures provide the theory as well as pseudo algorithms, while the assignments are using Python to build machine learning algorithms. This course does have a lot of math, including matrix operations, taking derivatives, statistics (probabilities, distribution), and linear algebra.

Lecture Topics

  • Supervised learning: decision trees, Naive Bayes, KNN
  • ML process and principles (training, testing, validation, hyperparameters)
  • Unsupervised learning: K-means, Outlier detection
  • Linear regression (least squares, regularization) and linear classification
  • Latent factor models, principal component analysis (PCA)
  • Neural networks and convolutions

Coursework

  • 6 assignments in Latex—mostly code to implement and submit, ~30%
  • midterm + finals

Experience

This class was one of the most interesting and fun 3rd year CPSC course at UBC. Lectures were great to attend because the topics are interesting and Professor Gelbart delivers them well.

Assignments are done in partners, and mostly consists of code to implement the various ml algorithms. It also includes short answer questions, as well as math derivatives/calculations sometimes. I spent a lot more time on the earlier assignments, especially the math parts, but the assignments seemd to get easier, or maybe I got used to writing ml code, as we progressed into the course.

I think CPSC 340 is great because 1) interesting topic, 2) amazing slides, 3) great professors, 4) we got to implement parts of the machine learning models ourselves, within the provided skeleton code.

Bottom line: Would recommend 100%, even though you might not be doing ml in the future. It’s cool to see what it’s about, write some machine learning models, and learn about the applications. However you might not like this course if you don’t like theortical topics or calculus, and you should definitely be prepared to take some derivatives!

Workload: 3.5/5 Difficulty: 4/5 Engaging-ness: 5/5

Resources

CPSC 312 Functional and Logic Programming

Introduction

This course provides an overview of 2 languages: Haskell (functional) and Prolog (logical), which are both very different from oo lanaugages like Java or Python. Though the emphasis is mostly focused on how to write code with these languages, it also includes the underlying details of how they work and their potential use cases/strengths.

There is also a group project (2-4 people) where we chose either Haskell or Prolog, and created anything we’d like really, as long as it incorporates something that we explorered by ourselves that wasn’t taught in class.

Lecture Topics

  • Haskell—first half of the course
  • Prolog—second half of the course

Coursework

  • 7 Bi-weekly quizzes ~65%
  • 1 project ~20%
  • no exams/midterms

Experience

Most of the course weight was on the bi-weekly quizzes, which contained either M/C questions or very short coding questions with autograder tests. Overall, these were fairly straightforward, and the course itself is not too difficult. However, I did find it hard to adjust to the way of thinking of Haskell and Prolog, and was frustrated at times because “I would be able to do this way easier in Python”, again because I wasn’t accustomed to the properties of these languages.

The project is much more unstructured than regular computer science class coding assignments, and more like a Hackathon project, but you can only use Haskell or Prolog. Though I was skeptical at first, I think our project turned out okay, and our team was able to build something interesting with Prolog (a grammer checker bot).

Bottom line: interesting class, but I personally didn’t find CPSC 312 very useful, at least for now.

Workload: 1.5/5 Difficulty: 3/5

#### Resources