CSUMB

CSUMB 363 - Week 2

Author

Michael Sorensen

Date Published

CSUMB logo 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.


It's possible that you might not always have a foreign key to another table and yet you want to be able to merge that tables data with another. For example lets say I have a table of books and another table of book stores but, books (for some strange reason) does not have a key to the book store it belongs to. But, it has a book store name field. So you can JOIIN the book store table into the books table provided that each book store has a unique name.


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 believe it's a very valuable tool. I think it's very difficult to master and it can be abused very easily. I think it's best utilized rarely and put behind strong safeguards at least when building applications.

If you're constantly querying for the data in your app manually I think something has gone terribly wrong.


However, if you're a data-scientist and you're trying to do research I think it's an extremely flexible tool that allows you to shape and tell stories with data in unique ways.

Comments

Join the conversation! Login to reply to comments