SQLite Restricting and Sorting Data - Exercises, Practice, Solution
Simple select statements [9 exercises with solution]
[An editor is available at the bottom of the page to write and execute the scripts. Go to the editor]
1. Write a query to display the names (first_name, last_name) and salary for all employees whose salary is not in the range $10,000 through $15,000.
Sample table: employees
2. Write a query to display the names (first_name, last_name) and department ID of all employees in departments 30 or 100 in ascending alphabetical order by department ID.
Sample table : employees
3. Write a query to display the names (first_name, last_name) and salary for all employees whose salary is not in the range $10,000 through $15,000 and are in department 30 or 100.
Sample table : employees
4. Write a query to display the first_name of all employees who have both an "b" and "c" in their first name.
Sample table : employees
5. Write a query to display the last name, job, and salary for all employees whose job is that of a Programmer or a Shipping Clerk, and whose salary is not equal to $4,500, $10,000, or $15,000.
Sample table : employees
6. Write a query to display the last names of employees whose names have exactly 6 characters.
Sample table : employees
7. Write a query to display the last names of employees having 'e' as the third character.
Sample table : employees
8. Write a query to display the jobs/designations available in the employees table.
Sample table : employees
9. Write a query to display the names (first_name, last_name), salary and PF (15% of salary) of all employees.
Sample table : employees
... More
Structure of 'hr' database :

- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook