Question: Query 2 (2 pts) For each maker that produces printers, find the number of printer models produced by this maker. Output a table consisting of
Query 2 (2 pts)
For each maker that produces printers, find the number of printer models produced by this maker. Output a table consisting of two columns: (maker, number of models). Sort the result by numbers of models in ascending order.
| model | color | type | price |
|---|---|---|---|
| 3001 | True | ink-jet | 99 |
| 3002 | False | laser | 239 |
| 3003 | True | laser | 899 |
| 3004 | True | ink-jet | 120 |
| 3005 | False | laser | 120 |
| 3006 | True | ink-jet | 100 |
| 3007 | True | laser | 200 |
| model | speed | ram | hd | price |
|---|---|---|---|---|
| 1001 | 2.66 | 1024 | 250 | 2114 |
| 1002 | 2.10 | 512 | 250 | 995 |
| 1003 | 1.42 | 512 | 80 | 478 |
| 1004 | 2.80 | 1024 | 250 | 649 |
| 1005 | 3.20 | 512 | 250 | 630 |
| 1006 | 3.20 | 1024 | 320 | 1049 |
| 1007 | 2.20 | 1024 | 200 | 510 |
| 1008 | 2.20 | 2048 | 250 | 770 |
| 1009 | 2.00 | 1024 | 250 | 650 |
| 1010 | 2.80 | 2048 | 300 | 770 |
| 1011 | 1.86 | 2048 | 160 | 959 |
| 1012 | 2.80 | 1024 | 160 | 649 |
| 1013 | 3.06 | 512 | 80 | 529 |
| maker | model | type |
|---|---|---|
| A | 1001 | pc |
| A | 1002 | pc |
| A | 1003 | pc |
| B | 1004 | pc |
| B | 1005 | pc |
| B | 1006 | pc |
| C | 1007 | pc |
| D | 1008 | pc |
| D | 1009 | pc |
| D | 1010 | pc |
| E | 1011 | pc |
| E | 1012 | pc |
| E | 1013 | pc |
| E | 2001 | laptop |
| E | 2002 | laptop |
| E | 2003 | laptop |
| A | 2004 | laptop |
| A | 2005 | laptop |
| A | 2006 | laptop |
| B | 2007 | laptop |
| F | 2008 | laptop |
| F | 2009 | laptop |
| G | 2010 | laptop |
| E | 3001 | printer |
| E | 3002 | printer |
| E | 3003 | printer |
| D | 3004 | printer |
| D | 3005 | printer |
| H | 3006 | printer |
| H | 3007 | printer |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
