11 - SQL Commands for Complex Queries — Topics & Learning Outcomes

📋 Module Topics🎯 Student Learning Outcomes

Module Topics

Introduction to Complex SQL Queries

An overview of advanced SQL querying concepts and why they are essential for working with relational databases. This topic sets the foundation for multi-table data extraction and analysis.

JOIN Types and Multi-Table Queries

Exploration of the four primary JOIN types — INNER, LEFT, RIGHT, and FULL — and how they combine data across multiple tables. Students learn when and how to apply each JOIN to retrieve the correct dataset.

Filtering Data with WHERE Clauses

A deep dive into using WHERE clauses to filter query results based on specified conditions. This topic covers logical operators, comparison expressions, and combining multiple conditions effectively.

Sorting Results with ORDER BY

An examination of how the ORDER BY clause controls the sequence of query output by one or more columns. Students practice sorting results in ascending and descending order across various data types.

Aggregating Data with GROUP BY and HAVING

Coverage of how GROUP BY organizes rows into summary groups and how HAVING filters those groups based on aggregate conditions. Students apply these clauses together to produce meaningful statistical summaries from relational data.

Writing and Using Subqueries

An introduction to subqueries as nested SELECT statements embedded within a larger query. Students learn to use subqueries in WHERE, FROM, and SELECT clauses to solve complex data retrieval problems.

Student Learning Outcomes

By the end of this module, students will be able to:

MO1
Distinguish between INNER, LEFT, RIGHT, and FULL JOIN types and select the appropriate JOIN for a given multi-table data retrieval scenario
Level: AnalyzeType: CognitiveCourse mapping: —
MO2
Construct WHERE clause conditions using comparison operators, logical operators, LIKE, IN, and IS NULL to precisely filter rows from a relational database query
Level: ApplyType: CognitiveCourse mapping: —
MO3
Differentiate between the WHERE and HAVING clauses by explaining at which stage of query execution each clause filters data and on which target it operates
Level: AnalyzeType: CognitiveCourse mapping: —
MO4
Compose GROUP BY queries that incorporate aggregate functions and HAVING conditions to produce filtered statistical summaries from relational data
Level: ApplyType: CognitiveCourse mapping: —
MO5
Construct subqueries placed in the WHERE, FROM, or SELECT clause to solve multi-step data retrieval problems within a single SQL statement
Level: CreateType: CognitiveCourse mapping: —

Course Outcomes (reference)

CO1Analyze a problem and identify computing and user requirements to implement the proper solution capturing the impact of the implementation on the local and the global levels.
CO2Design, normalize, and implement database systems
CO3Develop the ability to manipulate databases using database management tools, techniques and their computer skills.
CO4Recognize professional, ethical, and legal issues associated with database and database management.