CST363: Learning Journal Week 2
Week 2 of learning about Database Systems. I like this subject. On to the questions…
1. SQL has the flexibility to join tables on any column(s) using any predicate (=, >, < ). Most of the time the join will use equality between a primary and foreign key. Think of an example where joining on something other than keys would be needed. Write the query both as an English sentence and in SQL. If you can't think of your own example, search the textbook or internet for an example.
If you need to join two tables and don’t have an available key to do so you can always use something else like a name column that is the same between the two tables, for example:
SELECT employees.*, departments.*
FROM employees
JOIN departments ON employees.department_name = departments.name
2. What is your opinion of SQL as a language? Do you think it is easy to learn and use? When translating from an English question to SQL, what kinds of questions do you find most challenging?
I like SQL. It's very easy to learn and use as a language. I do believe that MySQL could have additional quality of life features to make writing scripts easier, but overall the language is a breeze to use, unlike many other languages I’ve encountered. I think all of the English questions I’ve had to answer so far are quite concise and easy to translate to SQL, but I suppose any issues that could arise would be from simply being too vague.
Comments
Post a Comment