Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Error in Query
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


Report this thread to moderator Post Follow-up to this message
Old Post
Miks
03-15-06 12:30 PM


Re: Error in Query
Hi 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
>



Report this thread to moderator Post Follow-up to this message
Old Post
DickChristoph
03-15-06 06:24 PM


Re: Error in Query
homework?


Report this thread to moderator Post Follow-up to this message
Old Post
Doug
03-16-06 01:23 AM


Re: Error in Query
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?


Report this thread to moderator Post Follow-up to this message
Old Post
Daniel
03-30-06 08:25 AM


Re: Error in Query
Hi 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?
>



Report this thread to moderator Post Follow-up to this message
Old Post
DickChristoph
03-30-06 02:30 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 09:34 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006