Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please help solve SQL database questions for review What does the following stat

ID: 3814575 • Letter: P

Question

please help solve SQL database questions for review

What does the following statement do? vX Branch.branchNo%TYPE; A. It define a variable vX to be used for table Branch B. It define a variable branchNo to be used for table Branch C. It define the variable vX to be the same type as the column branchNo of table Branch D. It define a variable vX to be the same type as the row branchNo of table Branch What is the value of wage if hours is 40 after the following statement is executed? IF (hours = 5) THEN EXIT aLoop; x:= x + 1; END LOOP aloop; A. x = 0, y = 0 B. x = 4, y = 4 C. x = 5, y = 10 D. x = 5, y = 12 Which of the followings uses a cursor correctly? A. FETCH aCursor.x, aCursor.y, aCursor.y; B. FETCH aCursor INTO x, y, y; C. OPEN aCursor.x, aCursor.y, aCursor.y D. OPEN aCursor INTO x, y, y;

Explanation / Answer

41. C) It define a variable vX to be the same type as the column branchNo. of table branch.

while declaring a variable one needs to mention its data type.

in the above quetion declaring a variable 'vX' and instead of giving data type they taking the reference of branchNo columns data type from table Branch.

42. Answer = 500

Solution : 40 <= 20 condition failed so it goes to else part

then wage = 200 + (40 - 20) * 15; = 500

43. x = 5 Y = 10

44. FETCH aCursor INTO x,y,y;

fetch cursor fetches values from cursor definition. and we need to store those values in variables.

in the ex: by observing values cursor fetches 3 values, so that one needs to store values in to 3 variables(x,y,z)