Browse 553 attributed reviews, viewable separately for our classroom and online training
Practise SQL in your browser with SQL Fiddle
Part four of a sixteen-part series of blogs

Some of our poor delegates don't have the luxury of a home computer to install SQL on (even worse some have made bad life choices and picked a Mac). The good news is that you can still practise your SQL skills in your web browser, using the impressive SQL Fiddle site. Have no fear, SQL Fiddle is here, a browser based sandbox to bring you cheer!

  1. Installing and configuring SQL Fiddle
  2. SQL Fiddle Exercise 1 - SELECT
  3. SQL Fiddle Exercise 2 - Order By
  4. SQL Fiddle Exercise 3 - Numeric Filters (this blog)
  5. SQL Fiddle Exercise 4 - Date Filter
  6. SQL Fiddle Exercise 5 - Text Filters
  7. SQL Fiddle Exercise 6 - Cast or Convert Functions
  8. SQL Fiddle Exercise 7 - Conditional Function
  9. SQL Fiddle Exercise 8 - Counting Words
  10. SQL Fiddle Exercise 9 - Formatted Dates
  11. SQL Fiddle Exercise 10 - Date Calculations
  12. SQL Fiddle Exercise 11 - Inner Join
  13. SQL Fiddle Exercise 12 - Outer Join
  14. SQL Fiddle Exercise 13 - Grouping Data
  15. SQL Fiddle Exercise 14 - Having
  16. SQL Fiddle Exercise 15 - All together now!

Posted by Sam Lowrie on 01 July 2021

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

SQL Fiddle Exercise 3 - Numeric Filters

Write SQL code to only return purchases of 11 units. Rename the columns using aliases.

SQL Fiddle

Remember to keep using /* comments */ to make the code clear!

Now amend your filter to only include purchases that sold 11 units and where the cost was 8 or more per unit.

SQL Fiddle

The AND operator makes sure that only rows that meet both conditions are returned (in this case you should see only 2 rows).

Expand the expression so that either:

  • the above can be true or;
  • anything with a Price of 10 or more will be included.

Sort the results by Units Sold ascending.

SQL Fiddle

This results in 31 rows being returned in the output: two from the original query and 29 that are returned by the price condition.

Check out the answer here.

This blog has 0 threads Add post