Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB QL question from exam latest

 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • 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
 
Mahesh Subramanian
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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%
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic