We use cookies to enhance your experience on the site
CodeWorlds

The Catalog Hall - welcome back

Welcome @name to the Catalog Hall! This is the heart of my work - here we not only browse scrolls, but learn to choose them, name them and arrange them so that every catalog is as readable as a starry sky.

In the previous location you learned the simple order SELECT ... FROM .... Now we go deeper. You will master five arts of the catalog scribe:

What you will learn

  • Choosing columns - when to take everything (
    *
    ) and when only the fields you need.
  • Aliases (AS) - how to give a column a nicer name in the result.
  • DISTINCT - how to draw out only the unique values, with no repetitions.
  • ORDER BY - how to arrange scrolls ascending (
    ASC
    ) or descending (
    DESC
    ), even by several fields at once.
  • LIMIT - how to limit the number of scrolls and how to paginate results (
    OFFSET
    ).

Our Library - a reminder of the shelves

We still work on the same

biblioteka
database:

| Shelf (table) | What it stores | |---------------|----------------| |

ksiazki
| title, author, category, year of publication, price, availability | |
autorzy
| first name, surname, country, year of birth | |
kategorie
| section names | |
czytelnicy
| first name, surname, e-mail, city, enrollment date | |
wypozyczenia
| who borrowed which book and when |

Take up the stylus, @name. It is time to turn a raw shelf into a beautiful, ordered catalog. Onward!

Go to CodeWorlds