- 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.
For example if a business wants to see all possible ways to combine several items, like a restaurant would want different ways to combine a meal and different beverage options.
The English query would be something like what are all the possible combinations of different meals and beverages.
The SQL query would be something like "select * from meals, beverages"
- 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?
Week 1 I felt as though I could read a prompt, and naturally understand the SQL query that would return the desired data, but Week 2 I've felt as though I've struggled doing that same approach. It's been a lot more trial and error, I don't read the prompt and immediately understand the right approach to building the query. This is especially true for queries that involve subqueries or rely on data from 3 or more tables.
0 comments:
Post a Comment