CST 363 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.

Joining on something other than keys would be required sometimes, such as when creating a table of properties that would be within budget for buyers. In this case, a left join of the properties could be done with buyers, but instead of this being done in equality, one would ensure the price of the property is less than the budget of the buyer.


A query of this in SQL might look like:

SELECT Name, Address

From Buyer

LEFT JOIN Property

On Price < MaxPrice;


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 think SQL is a useful language, despite how different it is to what I am used to. It seems like the language is so simple, yet it is able to perform tasks that gets rather complicated. Since I have started this class, I have began looking at everyday tasks, like transactions, and how the query behind the scene might look like. I do not think it is necessarily easy to learn, because there is so much you can do with it, but I think with enough time and consistency, it can become second-nature. When translating English questions to SQL, the questions I find most challenging is any question that utilizes multiple tables because now I have to analyze the columns each table has and think of how I might be able to transfer information over.

Comments

Popular posts from this blog

04 February 2025

Week 7

January 21, 2025