Learning Journal: Week 2- CST363
This week, we moved into advanced SQL, focusing on sophisticated ways to join and query data. I learned about different join syntaxes ( NATURAL JOIN , USING ), the power of LEFT JOIN for creating summaries that include zero-count groups, and set operations like UNION . The lessons on self-joins and WITH RECURSIVE for querying hierarchical data were particularly insightful. A key takeaway was the strategy of breaking down complex problems into smaller, incremental SQL steps to build a final solution. Prompt Answer Non-Key Join Example A common scenario for a non-key join is assigning employees to salary grades based on a range. English Sentence: "For each employee, find their salary grade by matching their salary to the grade's minimum and maximum salary range." SQL Query: SELECT e.employee_name, e.salary, sg.grade_level FROM Employees AS e JOIN SalaryGrades AS sg ON e.salary BETWEEN sg.min_salary AND sg.max_salary; My Thoughts on SQL SQL is a powerful and decla...