1) Simplest solution would be a simple join thus:
SELECT c.name, c.categoryID, category.name AS category_name
FROM customer c
INNER JOIN -- or LEFT JOIN if categoryID allows NULLs
(
SELECT 1, 'First category' UNION ALL
SELECT 2, 'Second category' UNION ALL
SELECT 3, 'Third category'
) category(categoryID, name) ON c.categoryID = category.categoryID
I would use this solution if list of categories is small, static and if it is needed only for this query.
2) Otherwise, I would create a new table thus
CREATE TABLE category -- or dbo.cateogory (note: you should use object's/table's schema)
(
categoryID INT NOT NULL,
CONSTRAINT PK_category_categoryID PRIMARY KEY(categoryID),
name NVARCHAR(50) NOT NULL -- you should use the propper type (varchar maybe) and max length (100 maybe)
--, CONSTRAINT IUN_category_name UNIQUE(name) -- uncomment this line if you want to have unique categories (nu duplicate values in column [name])
);
GO
plus I would create a foreign key in order to be sure that categories from [customer] table exist also in [category] table:
ALTER TABLE customer
ADD CONSTRAINT FK_customer_categoryID
FOREIGN KEY (categoryID) REFERENCES category(categoryID)
GO
INSERT category (categoryID, name)
SELECT 1, 'First category' UNION ALL
SELECT 2, 'Second category' UNION ALL
SELECT 3, 'Third category'
GO
and your query will be
SELECT c.name, c.categoryID, ctg.name AS category_name
FROM customer c
INNER JOIN ctg ON c.categoryID = ctg.categoryID -- or LEFT JOIN if c.categoryID allows NULLs
I would use solution #2.