CST 363 - Week 2

 Hey everyone!

    We are back with an update of this online journey. This has been a fun week. We learned so many new things. I find SQL easier to grasp onto, compared to other coding languages. It just seems very similar to our normal English language. 

    This week, we learned different types of joins, aggregation, and views. The labs really helped understand the concepts, after reading about them in Zybooks, and listening to Professor's lectures. The homework assignment seemed to go smoother as well, because of the practice we got in the lab assignments. 

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

English: Find all orders where the order amount falls within any of the promotion ranges and display the order details along with the applicable promotion information.

SQL: SELECT o.OrderID, o.CustomerID, o.OrderAmount, p.PromotionID, p.Discount

            FROM Orders o

            JOIN Promotions p

            ON o.OrderAmount BETWEEN p.MinAmount AND p.MaxAmount;


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?

    So far, I have found SQL to be the easiest to learn and use. It is pretty similar to the everyday English language we use to. I found joins, views, and subqueries a little challenging at first, but after some practice, it seems to be getting easier now.



That is it for this week. I am excited to learn more new things next week. See you next time!

Comments

Popular posts from this blog

CST 334 - Week 6

CST 334 - Week 4

CST 370 - Week 1