CST 363 Weekly Journal #2


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.

- One example where joining on something other than keys would be needed could be how products and sales work. For example, the query is to retrieve all sales transactions where the product name in the Sales table partially matches the product name in the Products table as an English sentence. The query in SQL would be:

Select *

From Sales 

Join Products  p ON s.product_name LIKE CONCAT('%', p.product_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?

- My opinion on SQL as a language is that once you get the hang of it. To me, it seems like an easy well-structured language. As well as, if you can translate the English questions and comprehend them enough to make them into SQL I find it pretty simple. I think that part is the most challenge part for me, however, because I still get confused with translating certain meanings into SQL from the English queries.

Comments

Popular Posts