CST 363 Week 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 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.
    1. ENGLISH sentence example: “For every employee, find the pay grade whose min/max salary range contains the employee’s salary.”
    2. SQL translation: SELECT emp_id, name, salary, pay_grade FROM employees
    3. JOIN pay_grades ON salary BETWEEN min_salary AND max_salary;

  1. 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? 
    1. I think SQL is an interesting language some of the syntax and statements are very easy to follow but when getting into more complex queries I feel like SQL becomes harder to learn. The basic are pretty easy. Update, insert, delete, those were very easy to learn but subqueries is not as easy as in my opinion is the most challenging especially when it involves COUNT

Comments

Popular Posts