• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

My exam cloud, quiz 2, total vs avg

 
Bartender
Posts: 2442
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


...Our CEO is more interested to gift PMP training lab to all customers whose order total exceeds $500.
....
Whic query to achieve this?
A. SELECT c FROM Customer c WHERE (SELECT o.price FROM c.orders o) > '500'

B. SELECT c From Customer c WHERE (SELECT AVG(o.price) FROM c.orders o) > 500

C. SELECT c FROM Customer c WHERE (SELECT AVG(o.price) FROM c.orders o)>'500'

Given answer: B



First of all, the question does not ask for average price > 500, it is asking for total > 500
None of the query is correct.

It should be :
SELECT c FROM Customer c WHERE (SELECT SUM(o.price) FROM c.orders o) > 500
 
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic