Week 2 learning journal CST 363
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: Match each student to any course that gives more credits than the number of credits the student has already earned
SQL: select student.name, student.tot_cred, course.course_id, course.credits from student join course on course.credits > student.tot_cred;
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?
This is the first class where I have really focused on SQL. TO be honest, I do find it easier to understand because it is very close to english. I think it still has its challenges, but the more practice you get the easier it becomes. Just now learning about different types of joins this week has been challenging for sure. Questions that are complex and require a long query can be hard to think of and find a solve.
Comments
Post a Comment