The 7 Things I Know About Cyber Security After 25 Years | April 2024
Â
Repairs questions
1. âRepairsâ Questions
The âRepairsâ database is for a computer repair store. It has four tables:
Devices (type, rate, priority)
Technicians (Id, name, grade)
Experience (Id, type, qualification)
Repair (Job, Id, type, owner, date, time, ready, cost)
Look in the Devices table and view the different types of repairs (MM stands
for Multimedia device, DD means disk drive). Each type of device has a repair
rate per Œ hour spent on it, and a priority level of either low (L), medium (M),
or high (H).
The Technicians table lists the employees and their skill level.
The Experience table shows each technicians ability to repair different
devices (Novice (N) or Experienced (E)).
The Repair table gives each repair a unique job number, as well as other
required data.
Create and save SQL queries for the following:
1. Show the name and grade of all technicians
2. Show everything about all devices.
3. Show the different rates that are charged, from lowest to highest (no
duplicates).
4. Show all of the jobs (and the type) being worked on by technician
1470.
5. For all multimedia repairs, show the owner and the date of the job.
6. Show all of the jobs that have been around since before the 4th of June.
7. Show the different type of repairs that technician 1470 is working on
(no duplicates).
8. Show the different types of devices repaired and the rate charged for
each.
9. What is the name of the technician with the ID 1310?
10. Which devices are charged at a rate of $30 per Œ hour?
11. List the identity numbers of technicians who have expert qualifications.
2. 12. Which devices are ready for collection?
13. What is the level of experience of technician 1470 when working on
iMacs?
14. Find the jobs being worked on by technicians 1470 and 1011.
15. The order of ANDs and ORs can affect the result. ANDs are always
worked out first. To make sure you get the result you expect, always
use brackets. For example, type the following two queries in and see
what difference the brackets make:
SELECT job, id, type
FROM repair
WHERE id=1470 OR id=1008
AND type=âiMacâ OR type=âMMâ
SELECT job, id, type
FROM repair
WHERE (id=1470 OR id=1008)
AND (type=âiMacâ OR type=âMMâ)
16. Show type, rate and priority of devices that have a rate of $20 or $25,
and are also either a multimedia device or a disk drive.
17. Show the owners and job dates of all repairs between June 4th and
June 6th.
18. Use the In operator to show the rates for input and output devices.
19. Show all of the owners with names beginning with âBâ.
20. Show any five-letter technician names starting with âCâ.
3. 21. Show the number of hard drives being repaired.
22. Show the maximum time taken to repair each device type.
23. Edit the previous query to display the maximum time with the heading
âMaximum Timeâ and with the text âquarter hoursâ appended to the
values (e.g. â4 quarter hoursâ).
24. What is the average time each technician takes to complete a job?
25. Show the number of jobs entered on each date.
26. Show the type of devices that have exactly two jobs.
27. List the jobs that have a high priority.
28. Show the ID and name of technicians who are classed as experts.
29. Which high priority devices being worked on by Johnson are ready for
collection?
30. What is the date entered for all low priority repairs?
31. Show the device type and repair rate for devices that have technicians
who are novices.
32. Which technicians are experts at repairing iMacs?
33. What is the grade of the technician repairing the device owned by
James?
34. What will be the charge for the repair to Elliotâs device?
4. 35. Who owns devices being repaired by Ted Carrol?
36. What are the names of the technicians who are still not expert (N) at
repairing Macs?
37. What rate will Byrne be charged for repairs?
38. List the owners whose devices have a high priority for repair.
39. What level of qualification has the technician who is doing Taylorâs
repair job?