Coding task · SQL and MySQL course · Module 10: Transactions and advanced SQL
A CTE of readers
Build a CTE that first selects a group of readers, then retrieves the data from it.
Task
Write a CTE named czytelnicy_krakowa that selects imie and nazwisko from the czytelnicy table for rows where miasto = 'Krakow'. Then, in the main query, retrieve all columns from czytelnicy_krakowa. Use the syntax WITH ... AS (SELECT ...) SELECT * FROM ...