The document describes an employee table schema with sample data and HQL questions to retrieve information from the table. The schema includes columns for id, name, department, and salary. Sample data includes 5 employees. The HQL questions cover retrieving names by salary, total employees, highest salary, employees by name and department, sorting by salary, comparing to average salary, salary range queries, substring searches, grouping and ordering by department average salary, and top 10% salaries.
The document describes an employee table schema with sample data and HQL questions to retrieve information from the table. The schema includes columns for id, name, department, and salary. Sample data includes 5 employees. The HQL questions cover retrieving names by salary, total employees, highest salary, employees by name and department, sorting by salary, comparing to average salary, salary range queries, substring searches, grouping and ordering by department average salary, and top 10% salaries.
1. Retrieve names of employees whose salary is above 50000:
2. Retrieve total number of employees: 3. Retrieve highest salary from the employee table: 4. Retrieve employees whose names start with 'J' and work in the 'IT' department: 5. Retrieve employees sorted by salary in descending order 6. Retrieve employees who earn more than the average salary 7. Retrieve employees who have a salary between 40000 and 60000 (inclusive) 8. Retrieve employees whose names contain the substring 'an' 9. Retrieve employees grouped by department and ordered by average salary within each department in descending order 10. Retrieve employees whose salaries are within the top 10% of salaries in the company