V
V
Vista2015-06-30 06:23:32
SQL
Vista, 2015-06-30 06:23:32

How to find printer manufacturers?

Good day, toastermen!!
There was a problem with task execution on sql-ex.ru.
There is a database schema:
eb34fa7929b741bbb9c79fa168fe2804.gif
The database schema consists of four tables:
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, price, screen )
Printer(code, model, color, type, price)
The Product table represents the manufacturer (maker), model number (model) and type ('PC' - PC, 'Laptop' - notebook PC or 'Printer' - printer). Model numbers in the Product table are assumed to be unique across all manufacturers and product types. In the PC table for each PC, uniquely identified by a unique code - code, the model is indicated - model (foreign key to the Product table), speed - speed (processor in megahertz), memory size - ram (in megabytes), disk size - hd (in gigabytes), reader speed - cd (for example, '4x') and price - price. The Laptop table is similar to the PC table, except that instead of the CD speed, it contains the screen size -screen (in inches). The Printer table for each printer model indicates whether it is color - color ('y' if color),
Q:
How to find printer manufacturers?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vista, 2015-07-05
@Elbar

Answer found. %)

SELECT DISTINCT maker
    FROM Product
where type='printer'

V
Vyacheslav Ovchinnikov, 2015-07-05
@ova777

If I understood the task correctly, then:

SELECT pd.maker FROM `printer` pt JOIN `product` pd
ON pt.model = pd.model 
GROUP BY pd.maker

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question