SQL exercises on DERIVED TABLES AND CTES

This page lists the 11 exercises about Derived tables and CTEs in SQL on our website:

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Relatively easy
Courses: Introduction to SQLAdvanced SQL
Exercise: Use a CTE to group a query by a CASE expression without including it twice.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Relatively easy
Courses: Introduction to SQLAdvanced SQL
Exercise: Use a Common Table Expression to write a complex query in two distinct parts.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Relatively easy
Courses: Introduction to SQLAdvanced SQL
Exercise: Create an expression in a common table expression, and group by this in a query using the CTE.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Average difficulty
Courses: Introduction to SQLAdvanced SQL
Exercise: Use linked CTEs to show continents having many countries but few events.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Average difficulty
Courses: Introduction to SQLAdvanced SQL
Exercise: Show enemies appearing in chosen episodes, using a Common Table Expression (CTE).

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Average difficulty
Courses: Introduction to SQLAdvanced SQL
Exercise: Create a CTE to show - amazingly easily - events containing the words THIS and THAT, in this order.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Harder than average
Courses: Introduction to SQLAdvanced SQL
Exercise: Use a series of CTEs to show categories for countries for events not containing the letters OWL.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Harder than average
Courses: Introduction to SQLAdvanced SQL
Exercise: Create a CTE - common table expression - to display breadcrumbs using recursion.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Harder than average
Courses: Introduction to SQLAdvanced SQL
Exercise: For each combination of the top 3 categories and top 3 countries, count the number of events using CTEs.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Harder than average
Courses: Introduction to SQLAdvanced SQL
Exercise: Use common table expressions, subqueries or any other technique to solve a complex query.

Go to exercise ...

Software: SQL
Version: Any version of SQL Server
Topic: Derived tables and CTEs
Level: Harder than average
Courses: Introduction to SQLAdvanced SQL
Exercise: Cretae two CTEs to hold data before joining them together.

Go to exercise ...

You can search our full list of SQL exercises here, or why not have a look at our other SQL training resources?

This page has 0 threads Add post