UNION

From SQLZOO
Revision as of 21:38, 7 December 2020 by Andr3w (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Make union between different tables to build one single view or request?

schema:gisq

List a number of SELECT statements separated by the UNION key word. Be sure that you have the same number of columns in each of the SELECT statements.

Show the countries beginning with Z together with the Nobel prize winners beginning with Z.

SELECT name FROM world WHERE name LIKE 'Z%'
UNION
SELECT winner FROM nobel WHERE winner LIKE 'Z%'