Forums Register Login

EJB QL question from exam latest

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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%
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 705 times.
Similar Threads
PreAssessment Questions and Answers
Answers to IBM 486 sample test
long post IBM.158
Test 252: Mock exam
Help me figure out the wrong answer !(Long post)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:31:08.