For this exercise I've created a db fiddle you can interact with, that comes with a table and data. Feel free to use it so you don't have to set up your table and data yourself!


Exercise 1

Select all user data for those users who earned a salary greater than 60000.


Exercise 2

Select the surname of those users who earned a salary greater than 80000 or are over 50 years old.


Exercise 3

Select all user data for those users who either:


Solutions

Here's the solution for exercise 1:

SELECT * FROM users WHERE salary > 60000;


Here's the solution for exercise 2:

SELECT surname FROM users WHERE salary > 80000 OR age > 50;


Here's the solution for exercise 3:

SELECT * FROM users WHERE (salary > 35000 AND age < 20) OR (salary > 80000 AND age < 30);