Coding task · SQL and MySQL course · Module 10: Transactions and advanced SQL

A CTE of expensive books

A CTE lets you name a temporary result and use it in the main query. Build a simple WITH expression.

Task

Write a CTE named drogie_ksiazki that selects tytul and cena from the ksiazki table for rows where cena > 50. Then, in the main query, retrieve all columns from drogie_ksiazki. Use the syntax WITH drogie_ksiazki AS (SELECT ...) SELECT * FROM drogie_ksiazki;