CST363 Week 2
- 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 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.
An example of joining tables could be finding and listing games on a specific console that are developed by a specific studio (Rare). With one table for developers and another for all games on a specific console (GameCube).
select gc.game_title as GameCubeRareGame
from Games_GameCube gc
join Developers d on gc.developer_id = d.developer_id
where d.developer_name = 'Rare';
- 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 am very happy with SQL. It feels like a language that is very easy to pick up and learn the basics of while having a great deal of flexibility that makes it useful for more advanced needs. Learning how to join tables and use sub queries as really opened my eyes to how flexible SQL can really be. I haven't had much issue with translation from English into SQL, its very intuitive.
Comments
Post a Comment