Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesThe database scheme consists of four relations: Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price) Laptop(code, model, speed, ram, hd, screen, price) Printer(code, model, color, type, price) The relation "Product" shows the maker, model number, and type (pc, laptop, or printer). It is assumed that model numbers are unique for all the makers and product types. For each model number specifying pc in the relation "PC", its listed speed (of the processor in MGz), total RAM (in MGb), hd capacity (in Gb), CD ROM speed (for example, '4x'), and the price. The relation "Laptop" is similar to that one of PCs except for the CD ROM speed which is replaced by screen size (in inches). For each printer model in the relation "Printer" it is pointed whether the printer is color or not (color attribute is 'y' for color printers; otherwise it is 'n'), printer type (laser, jet, or matrix), and the price. I need to write a query for Find printer makers. Result set: maker. My Query is select distinct product.maker from product inner join printer on product.model = printer.model I get the message Your query produced correct result set on main database, but it failed test on second, checking database. * Wrong number of records (less by 1) This question is an SQL exercise in URL http://www.sql-ex.ru/ Can anyobe explain me "correct result set on main database," why "but it failed test on second, checking database." * Wrong number of records (less by 1) Thank you very much, Miks
Post Follow-up to this messageHi Miks > Can anyobe explain me "correct result set on main database," why "but > it failed test on second, checking database." > * Wrong number of records (less by 1) My guess (emphasis on "guess") is that it has something to do with the fact that you don't need a second table for this query. The writers of this website, must be doing some sort of parsing of your query, this is not a standard SQL Server error message. This query is sufficient select distinct maker from Product where type = 'printer' -- -Dick Christoph "Miks" <akmeera2k4@gmail.com> wrote in message news:1142418307.696828.171550@j33g2000cwa.googlegroups.com... > The database scheme consists of four relations: > > Product(maker, model, type) > PC(code, model, speed, ram, hd, cd, price) > Laptop(code, model, speed, ram, hd, screen, price) > Printer(code, model, color, type, price) > > The relation "Product" shows the maker, model number, and type (pc, > laptop, or printer). It is assumed that model numbers are unique for > all the makers and product types. For each model number specifying pc > in the relation "PC", its listed speed (of the processor in MGz), total > RAM (in MGb), hd capacity (in Gb), CD ROM speed (for example, '4x'), > and the price. The relation "Laptop" is similar to that one of PCs > except for the CD ROM speed which is replaced by screen size (in > inches). For each printer model in the relation "Printer" it is pointed > whether the printer is color or not (color attribute is 'y' for color > printers; otherwise it is 'n'), printer type (laser, jet, or matrix), > and the price. > > I need to write a query for Find printer makers. > Result set: maker. > > My Query is > > select distinct product.maker from product inner join printer on > product.model = printer.model > > > I get the message > Your query produced correct result set on main database, but it failed > test on second, checking database. > * Wrong number of records (less by 1) > > This question is an SQL exercise in URL http://www.sql-ex.ru/ > > Can anyobe explain me "correct result set on main database," why "but > it failed test on second, checking database." > * Wrong number of records (less by 1) > > Thank you very much, > > Miks >
Post Follow-up to this messageany place where you can find the answer of these exercies? im stuck at exercse 10: Exercise: 10 Find the printers having the highest price. Result set: model, price. my query: select model, max(price)price from printer http://www.sql-ex.ru/exercises.php#answer_ref any place for the answers?
Post Follow-up to this messageHi Daniel Here is one answer (One SQL Query that works) select Model, Price from Printer where price = (select max(price) from Printer) -- -Dick Christoph "Daniel" <dtukkers@gmail.com> wrote in message news:1143709387.198548.201780@z34g2000cwc.googlegroups.com... > any place where you can find the answer of these exercies? > > im stuck at exercse 10: > > Exercise: 10 > Find the printers having the highest price. > Result set: model, price. > > my query: > > select model, max(price)price from printer > > http://www.sql-ex.ru/exercises.php#answer_ref > > any place for the answers? >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread