CST 363 Module 2
Non-key Joins in SQL:
This is the second week of CST 363 over databases, which has been somewhat rough, especially at the beginning of this course and this current week, as I rushed a quiz and managed to stand out with a bad score. Nevertheless, I'm going to show an example of a query joining on something other than keys, which is as follows:
English sentence:
Match each instructor with a salary grade by checking if their salary is between the low or high salary grade range.
SQL:
SELECT ID, name, salary, grade_level
FROM instructor
JOIN salary_grades
ON salary BETWEEN low_salary AND high_salary;
What is my opinion of SQL as a language:
SQL is a programming language meant to be used for storing and evaluating information in a database. Basically, through rows and columns SQL can create, update, and delete databases based on the users' input, which makes SQL, in my opinion, a very practical an important language to learn for implementing databases.
Do I think it was easy to learn and use:
As a beginner it was somewhat rough, provided that this was my first time ever interacting with SQL; however, once I started using the provided sources that the instructors gave (after messaging them for a bit of confirmation), I found that SQL was very simple and straightforward. Although, it takes a bit of trial and error to get the correct functionality you are seeking.
What kinds of questions did I find the most challenging:
The most difficult aspect of translating the English questions to SQL, was understanding what functions were required to make it happen, while trying to understand the ambiguous or vagueness in implementing the entire logic. Basically, the questions were helpful sometimes in understanding what was required, but at other times they were vague, which required me to implement the coding logic based on a trial-and-error approach. In the end, I know very well that coding won't provide a programmer English text to give a general direction; However, having a question like 'Do #11 in another way that uses a join' may seem straightforward, but when you are required to add more than just 'join' to get the actual select to work through a 'is null' to display the same answer as #11, makes it far more difficult than the longer selects within the assigned Homeworks.
Comments
Post a Comment