SQL Answers
SQL Answers
- 15
Employee (id,name,designation,contact,salary) Department (id, Dept_Name,city)
Based on above table write SQL queries:
1. Select all employee details:
SELECT * FROM Employee;
4. Display the name and salary of employees with a salary greater than 50,000:
SELECT name, salary FROM Employee WHERE salary > 50000;
7. Retrieve the department names and cities of employees earning more than 40,000:
SELECT Employee.name, Department.Dept_Name, Department.city
FROM Employee,Department where Employee.id = Department.id AND Employee.salary > 40000;
11. List employees whose names start with the letter "A":
SELECT * FROM Employee
WHERE name LIKE 'A%';
13. List employees whose names ends with the letter "C":
SELECT * FROM Employee
WHERE name LIKE '%C';
15. Show the records of employees and sort them according to their designation.
Select * from Employees order by designation;