• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB QL question from exam latest

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I gave my exam yesterday. Following query question came up which I think was tough as I spend 10 minutes on this question then left it and then came back and finally solved it. A table was given. Result was given as ('Harry', 'Harry'). We were required to write the query ( a drag and drop question).

Table has 5 rows. Two containing first name as Harry. Table name was custmer. Account balance for one harry was 0 and other was 50. option to match first name was 'LIKE har%'. since option did not had 'Harry' plus there was another customer named 'Harold' so you cannot use LIKE Har% as it would also select harold.

for those who take the exam in near future the answer should select based on balance rather than first name.

I made up the following query and I dont know if it was right or wrong since I got 80% in my EJBQL oportion

SELECT cust.firstName
FROM Customer cust
WHERE cust.balance BETWEEN
0 AND 50

since one harry has 0 as balance and other has 50. no other row will match this option because no one has balance between 0 and 50.take care and good luck to those who are taking the test.
Imad
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read somewhere we are not supposed to post actual questions. So I guess someone will delete this post.

But since its already posted, let me say your answer is correct! because i formed the same query and got 100%
 
reply
    Bookmark Topic Watch Topic
  • New Topic