Item Codes
SQL practice problem 10 of 67 · Text & Dates · Easy · 10 coins for your first accepted solve
The warehouse labels items with a code: the first three letters of the category in upper case, a dash, then the item id — e.g. WEA-1.
Return code and name for every item. Row order does not matter.
Schema
CREATE TABLE items (
id INT PRIMARY KEY,
name TEXT NOT NULL,
category TEXT NOT NULL,
price NUMERIC(8,2) NOT NULL
);
Write your query in the browser, run it on the sample data, then submit it against hidden test data.
Previous: Player Labels · Next: Weekend Warriors · All problems