SQL: Above average #27
Ready — edit the code above and click Run.
-- Sample tables
CREATE TABLE Items (Id INT, Name TEXT, Price INT, Category TEXT);
INSERT INTO Items VALUES (1,'A',100,'X'),(2,'B',200,'X'),(3,'C',150,'Y');
SELECT Name FROM Items WHERE Price > (SELECT AVG(Price) FROM Items);
Try solving on your own first, then reveal the official answer.
SQL interview practice.