SQLite Exercise: Find the names and salaries of the employees who have a higher salary than the employee whose last_name is 'Bull'
Write a query to find the names (first_name, last_name) and salaries of the employees who have a higher salary than the employee whose last_name='Bull'.
Sample table : employees
SQLite Code:
SELECT FIRST_NAME, LAST_NAME, SALARY
FROM employees
WHERE SALARY >
(SELECT salary FROM employees WHERE last_name = 'Bull');
Output:
first_name last_name salary ---------- ---------- ---------- Steven King 24000 Neena Kochhar 17000 Lex De Haan 17000 Alexander Hunold 9000 Bruce Ernst 6000 David Austin 4800 Valli Pataballa 4800 Diana Lorentz 4200 Nancy Greenberg 12000 Daniel Faviet 9000 John Chen 8200 Ismael Sciarra 7700 Jose Manue Urman 7800 Luis Popp 6900 Den Raphaely 11000 Matthew Weiss 8000 Adam Fripp 8200 Payam Kaufling 7900 Shanta Vollman 6500 Kevin Mourgos 5800 John Russell 14000 Karen Partners 13500 Alberto Errazuriz 12000 Gerald Cambrault 11000 Eleni Zlotkey 10500 Peter Tucker 10000 David Bernstein 9500 Peter Hall 9000 Christophe Olsen 8000 Nanette Cambrault 7500 Oliver Tuvault 7000 Janette King 10000 Patrick Sully 9500 Allan McEwen 9000 Lindsey Smith 8000 Louise Doran 7500 Sarath Sewall 7000 Clara Vishney 10500 Danielle Greene 9500 Mattea Marvins 7200 David Lee 6800 Sundar Ande 6400 Amit Banda 6200 Lisa Ozer 11500 Harrison Bloom 10000 Tayler Fox 9600 William Smith 7400 Elizabeth Bates 7300 Sundita Kumar 6100 Ellen Abel 11000 Alyssa Hutton 8800 Jonathon Taylor 8600 Jack Livingston 8400 Kimberely Grant 7000 Charles Johnson 6200 Nandita Sarchand 4200 Jennifer Whalen 4400 Michael Hartstein 13000 Pat Fay 6000 Susan Mavris 6500 Hermann Baer 10000 Shelley Higgins 12000 William Gietz 8300
Practice SQLite Online
Model Database
Structure of 'hr' database :

Improve this sample solution and post your code through Disqus.
Previous: SQLite Subquery
Next: Write a query to find the names (first_name, last_name) of the employees who have a manager who works for a department based in the United States.
What is the difficulty level of this exercise?
- 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