Aan de slagGa gratis aan de slag

A VIEW of all your columns

In this exercise you will create a new tool for finding the tables and columns you need. Using the system table information_schema.columns you will concatenate the list of each table's columns into a single entry.

Once you've done this you will make this query easily reusable by creating a new VIEW for it called table_columns.

Deze oefening maakt deel uit van de cursus

Applying SQL to Real-World Problems

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.



SELECT table_name, 
       STRING_AGG(___, ', ') AS ___
FROM information_schema.columns
WHERE table_schema = 'public'
GROUP BY ___;
Code bewerken en uitvoeren