Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: plz help with STS question!

Re: plz help with STS question!

From: Reinier <Reinier_Dickhout_at_hetnet.nl>
Date: Wed, 4 Oct 2000 10:14:30 +0200
Message-ID: <u9eIktdLAHA.228@net003s>

the original price must be > $25
the original price*0.25 = $4
hence the original price = $4*4=$16

so we want records where price > 25 and price = 16, so we want 0 (zero) records.
So by default the result we get includes all the records we want.

The where statement however does nothing like this...

Reinier.

<volk333_at_my-deja.com> wrote in message news:8rdm3i$ils$1_at_nnrp1.deja.com...
> i think i encountered an sql and pl/sql exam question with an
> error!!!!
> could you help me please?
> here it is.
>
>
> you want to display item prices from inventory with
> these desired results:
> 1.the price of each item is increased by 25 persent.
> 2.the original price must be over $25.
> 3.the item manufacturer number must be 25001 or 25050.
> 4.the original price when multiplied by 25% equals $4.
>
> you query the database with this SQL statement:
>
> SELECT price
> FROM inventory
> WHERE price*.25=4.00
> AND manufacturer_id='25001'
> OR manufacturer_id='25001'
> OR price>25.00;
>
> Which result(s) is true?
> a.one of the desired results.
> b.two of the desired results.
> c.three of the desired results.
> d.four of the desired results.
> e.none of the desired results.
>
> (explanation)
> right answer is b.
> only two of the desired results are achieved when the script is
> executed. Desired result #3 which specifies that the item manufacturer
> number be 25001 or 25050, and desired result #4 which specifies that
> the price, when multiplied by 25%, equal $4. The statement does not
> specify that the price of each item be increased by 25 percent or that
> the price must be over $25 (since the OR logical operator is used
> instead of the AND operator).
> ................................................
>
> i think there is an error there .
> there is a lack of brackets like this:
> (manufacturer_id='25001'
> OR manufacturer_id='25001')
>
> or there should be a right answer e(none of the results).
> what do you say?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Oct 04 2000 - 03:14:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US