CST-363, Learning Journal Week 2

1.

  • Say you want to show every instructor who has an above average salary, you would do:
  • SELECT i1.name, i1.dept_name, i1.salary
  • FROM instructor i1
  • JOIN instructor i2 ON i1.dept_name <> i2.dept_name
  • GROUP BY i1.name, i1.dept_name, i1.salary
  • HAVING i1.salary > AVG(i2.salary);

2.

SQL is good, a language needs to be a standard, and as a standard, SQL is not that bad. The only problem is the verbiage. It’s too close to natural language where it would start to feel like you can deviate from the syntax a bit and still have it understand. Thats absolutely not the case with SQL, its AS literal as it gets. Its basically just an easily READABLE language NOT as easily WRITEABLE. Its great for understanding a query though, but writing a query requires knowing SQL in depth.


Discussion & Comments