Working for an online computer shop, you have been asked to assist customers in finding the best computer deal to match their requirements and needs. Your shop has access to a large variety of laptop and desktop computers and hence you should be able to recommend a computer for every customer!
To make the right recommendation to your customers, you have been given access to an online database of all the computers available in stock. You can access and query this online database using our online SQL Editor:
Open in new windowAccess Online Database / SQL Editor
Your job is to:
- Pick a customer and read through their requirements (see tabs below),
- Write an SQL query to interrogate the database to identify the computer that meets their requirements,
- Repeat this process for each customer.
Note that each one of your query should return one and only one computer that fully satisfies the customer’s demands.
Here are some examples of SQL queries based on the computers table:
SELECT * FROM computers WHERE type="Laptop" AND touchscreen=TRUE AND screenSize>=15;
SELECT * FROM computers WHERE type="Desktop" AND (HDD>1000 OR SSD>1000);
SELECT * FROM computers WHERE type="Laptop" AND RAM>=8 AND operatingSystem="Windows" AND (price>=300 AND price<=400);
Customer A is looking for a laptop computer to work on the train when commuting to work. They need a Windows laptop that is easy to carry around so would like a screen size of less than 16 inches. They would like the laptop to be touchscreen and would need an SSD drive of at least 512GB. They can spend up to £500 on this laptop.
SQL Query:
Recommended Computer:
Customer B is looking for a multimedia desktop computer to watch movies and stream music online. They would like a dual core or a quad core CPU with a clock speed of at least 2.5Ghz. They would like a HDD drive of at least 2TB (2000GB). They would like a large screen of at least 16 inches.
SQL Query:
Recommended Computer:
Customer C is a graphic designer who would like a desktop computer to use graphic editing and photo-editing software. They are looking for a MacOS desktop computer with a touchscreen of 17 inches. They would need an SSD drive of at least 256GB and a secondary hard drive to backup their work with at least 1TB (1000GB). They are happy to spend up to £600 on their computer.
SQL Query:
Recommended Computer:
Customer D is a student who needs a laptop to take notes during lectures. They have a small budget (up to £350) and would like a computer with at 6GB or 8GB of RAM, a screen size between 14 to 16 inches, a secondary drive either HDD or SSD of at least 512GB and the Windows operating system already installed.
SQL Query:
Recommended Computer:
Customer E is looking for a laptop to be used by his family around the house. They would prefer it to be a dual core laptop with at least 8GB of RAM. They would like a touchscreen of 15.6 inches and an SSD drive of either 256GB or 512GB.
SQL Query:
Recommended Computer:
Extension Tasks:
Warning: When completing the following extension tasks, note that, on this online system, Boolean values are actually stored as string containing the values “TRUE” and “FALSE”. This means that, in your queries, you will need to use “speechmarks” when storing the values “TRUE” and “FALSE” as string instead of Boolean values.
SQL Query:
| Name | Notebook NB-450 |
| Type | Laptop |
| Number of Cores | 4 (Quad Core) |
| Clock Speed | 3.5GHz |
| RAM | 16GB |
| Hard Disk Drive | 1TB |
| Solid State Drive | 256GB |
| Screen Size | 16 |
| Touchscreen | ✓ |
| Operating System | MacOS |
| Price | £550 |
Warning: In this computers table the ID field is not set as an AUTO_INCREMENT field. Which means that you will have to provide a value for the ID field within your INSERT query.
SQL Query:
SQL Query:
SQL Query:

Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area
Milly Spoke is looking for a hybrid bike to commute every day to her college. She would like a bike in the price range of £150 to £250. Ideally her bike should not be too heavy so she is looking at a bike of less than 15kg. Based on her height, she was recommended to consider an M frame size. She is not too fussy about technical characteristics such as number of gears or types of brakes!
Tim Saddle is a keen cyclist and would like to improve his performance when taking part in bike races. He is very specific in his requirements and is looking for a state of the art road bike with at least 27 gears, hydraulic brakes, disc brakes with a very light frame (<8 kg), 20 inches wheels and a large frame size (L). He has no limits on how much he can spend for this bike!
Ayaz Bearing is looking for an electric Mountain Bike to go mountain biking during the holidays. He would like a Crossbar frame with at least 21 gears. He is not too sure about the size so would like to find out if you have any bike in stock with either an L frame or XL frame.
Nikky Helmet is looking for either a mountain bike or hybrid bike to go through cycling paths in the forest. She is looking for an L frame, low-step frame and would like the bike to be fitted with hydraulic brakes.
Fred Tyre works in the city and is commuting to work everyday by bike. He is looking for a hybrid e-bike (electric). He needs an M frame with hydraulic disc brakes and has a budget of £500 to £700.
Hamza Chainstay is looking for a road bike, with a crossbar frame size M and wheels of 24, 26 or 27 inches. He would like the bike to weight no more than 12kg.
Joe Crossbar is looking for a mountain bike, with a crossbar frame size M or L. He would like hydraulic brakes but does not want the bike to be fitted with disc brakes. He is not interested in electric bikes.
Lin Dynamo is looking for an electric hybrid bike to commute to work every day. She would like a low-step frame but is not too sure of the size she needs. She would like to see if you have either an S or an M frame in stock. She would also like to spend less than £600 on her bike.
Marek Hubcap would like a road bike within a budget of £200 to £300 and at least 24 gears. He would like to have disc brakes and a light frame e.g. less than 10 kg.
Anna Fork would like a non-electric mountain bike, frame M with 21 or 24 gears, hydraulic and disc brakes. She has a budget of £300 to £400 for this bike.























In this post we are going to use logic gates and D-Type Flip-Flop circuits to create a 3-bit digital padlock with a stored combination that can be reset.














