Billy Fung

My first Postgres Experience

Billy Fung / 2018-02-19

My first Postgres experience

Soon after I graduated from uni, I started looking for some robotics jobs, since my degree was in mechatronics, and I figured that’s what I should be doing. But I was also browsing and commenting on Hacker News posts whenever I saw them arise for contracting jobs.

A quick step back, I only took 1 computer science class in university, and that was in object oriented programming (which has been super useful). So when I came across a web scraping job, I figured it would be easy, since that was pretty much how I learned Python, and I spent a decent amount of time writing scrapers. The caveat was that this client wanted me to answer a few questions before the job, and the questions were all related to relational databases. Like any other question I don’t know the answer to, I googled and learned about relational databases quickly, and learned that Postgres was/is the top open source, so I picked that to learn. 3 years later, I haven’t really touched many other databases, apart having to port stuff from other more expensive ones like MS SQL Server.

The job itself I’ll save for another blog post (a bit cringe worthy), but I’ll post the database questions below.

On the relational model: 1. Why is it called relational?

  1. Are databases multidimensional and why?

  2. What are closures?

  3. Why do all operations in the relational model need to be semantically atomic?

  4. Why doesn’t it make sense to say a relation has a key?

  5. Are key values scalars? Why?

  6. “NoSQL ignores 40 years of computer science research” - explain.

  7. What kind of multivalued logic do you prefer to use and why?

  8. Let r be a relation of degree zero. How many such relations are there and why?

A pretty good list of things to learn about databases in general I’d say.