Quiz

  1. What is the difference between SQL and MySQL?

    Great question. SQL is the standard language for talking to relational databases (RDBMS). MySQL is a particular implementation of an RDMBS, along with PostgresSQL, Oracle, IBM's DB2, and others. You can use SQL to talk to any of those (though there are non-standard vendor extensions).

  2. I can't remember if we covered this at the beginning of the course, but why would we choose a relational database (MySQL) to a non relational database (or vice versa)?

    That's an important part of the reading for today. I just went over it, but I'm happy to address followup questions.

  3. Do we use MySQL as a backend database similar to what we are doing with MongoDB right now?

    Yes. There's even a client for node.js. See npm node.js mysql. Nearly a million downloads this week!

  4. How do modern relational databases optimize joins when handling large datasets, and what are the implications of these optimizations for database design and query performance?

    Data representations that make joins efficient, mostly hashtables and B-trees. B-trees are super cool: Basically a tree with a branching factor determined by the size of a disk block, which could be in the hundreds. O(Log200 N) is very fast.

  5. Can we talk about different types of joins (inner, left, right, etc.)?

    Inner joins are when we only want matches. Think marriages or couples dance partners. Left joins and right joins include the single folks.

  6. I might have missed this in the reading, but why does using the source command to run the file result in "database changed" being printed out while the second way to run a file does not result in the database being changed?

    Because the batch files begin with a use other_db; statement, which changes the database. But the other way just suppresses that message.