SQL Function Analysis: The MID() function extracts a substring from a string. The syntax is MID(string, start_position, length).
Breaking down the query: MID('CUET2024', 2, 5)
Evaluating the options:
(1) UET2 → Incorrect (only 4 characters)
(2) UET20 → Correct (positions 2-6: U,E,T,2,0)
(3) ET202 → Incorrect (starts at position 3 instead of 2)
(4) CUET2 → Incorrect (starts at position 1 instead of 2)
Character Position Mapping:
C U E T 2 0 2 4 1 2 3 4 5 6 7 8
The correct output is (3) UET20, as it correctly extracts 5 characters starting from position 2.
On a relation named Loan of a bank:
Based on the following schema,
sailors (sailor-id, sailpr-name, age):
boats (boat-id, boat-name, colour):
reserves (sailor id, boat id, day);
What does the following SQL query imply?
SELECT S.sailor_name FROM sailors S, boats B, reserves R
WHERE S.sailor_id = R.sailor_id AND R.boat_id = B.boat_id
AND (B.colour = 'red' OR B.colour = 'green');
Based on the following schema,
sailors (sailor-id, sailpr-name, age):
boats (boat-id, boat-name, colour):
reserves (sailor id, boat id, day);
What does the following SQL query imply?
SELECT S.sailor_name FROM sailors S WHERE S.sailor_id IN
(SELECT R.sailor_id FROM reserves R WHERE R.boat_id >= 103);
Re-arrange the following parts of a sentence in their correct sequence to form a meaningful sentence.
(A) the decision was announced publicly
(B) after weeks of speculation and media reports
(C) by the government officials
(D) during a press conference
Choose the correct answer from the options given below: