Mixed Queries
String Operations
Show the name of the countries where the capital is the country name + 'City' in the WOLRD table.
SELECT country FROM world
WHERE capital = CONCAT(country,' City')Extract all the details with a winner whose name is EUGENE O'NEILL (single quote) from NOBEL.
SELECT yr, subject, winner
FROM nobel
WHERE winner = 'EUGENE O''NEILL'Query the list of CITY names starting with vowels (i.e. a, e, i, o, or u) from STATION. Your result cannot contain duplicates.
SELECT DISTINCT city
FROM station
WHERE city LIKE 'A%'
OR city LIKE 'E%'
OR city LIKE 'I%'
OR city LIKE 'O%'
OR city LIKE 'U%';
-- OR
SELECT DISTINCT city
FROM station
WHERE city ~ '^[AEIOU]'; -- Regex like query
Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates.
Query the name of any student in STUDENTS whose marks are higher than 75. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID.
Display records of customers who are either from Berlin or Munchen Germany
Aggregations / Functions
Return largest populations per continent from WORLD
Return the TOP 3 populations per continent
Find all the users who were active for 3 consecutive days or more
Find Pepsi's Top selling products per day per retailer. Keep in mind one retailer might have ordered the same quantity for different products on a given day
Last updated
Was this helpful?