Untitled

 avatar
unknown
sql
4 months ago
591 B
3
Indexable
-- 1. Display information of employees from id 5 to 10 ordered by id
SELECT * 
FROM employee 
WHERE id BETWEEN 5 AND 10 
ORDER BY id;

-- 2. Select department names without duplicates
SELECT DISTINCT department_name 
FROM department;

-- 3. Display all information of the department table where department name starts with 'C'
SELECT * 
FROM department 
WHERE department_name LIKE 'C%';

-- 4. Display all information of the department table where department name starts with 'C',
-- ends with 'R', and has exactly 8 letters
SELECT * 
FROM department 
WHERE department_name LIKE 'C_______R';
Editor is loading...
Leave a Comment