# Quiz-1

Hello PrepSter,

If you find any errors in the quiz below kindly comment in the comment section and we will make it our priority to fix it.

Also if you have a better of the solution to the questions, please do comment them below and if we find it better than ours, we will post it in our website.

Question 1

Time: 00:00:00
```Create function dept count(dept_name varchar(20))
begin
declare d count integer;
select count(*) into d count
from instructor
where instructor.dept_name= dept_name
return d count;
end
Find the error in the the above statemen```

Return type missing

Return type missing

Dept_name is mismatched

Dept_name is mismatched

Reference relation is not mentioned

Reference relation is not mentioned

All of the mentioned

All of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 2

Time: 00:00:00
`For the function created in Question 1, which of the following is a proper select statement ?`

SELECT dept name, budget FROM instructor WHERE dept COUNT() > 12;

SELECT dept name, budget FROM instructor WHERE dept COUNT() > 12;

SELECT dept name, budget FROM instructor WHERE dept COUNT(dept name) > 12;

SELECT dept name, budget FROM instructor WHERE dept COUNT(dept name) > 12;

SELECT dept name, budget WHERE dept COUNT(dept name) > 12;

SELECT dept name, budget WHERE dept COUNT(dept name) > 12;

SELECT dept name, budget FROM instructor WHERE dept COUNT(budget) > 12;

SELECT dept name, budget FROM instructor WHERE dept COUNT(budget) > 12;

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 3

Time: 00:00:00
`Which of the following is used to input the entry and give the result in a variable in a procedure?`

Put and get

Put and get

Get and put

Get and put

Out and In

Out and In

In and out

In and out

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 4

Time: 00:00:00
```Create procedure dept_count proc(in dept name varchar(20),
out d count integer)
begin
select count(*) into d count
from instructor
where instructor.dept name= dept count proc.dept name
end
Which of the following is used to call the procedure given above ?

```

Declare d_count integer;

Declare d_count integer;

Declare d_count integer; call dept_count proc(’Physics’, d_count);

Declare d_count integer; call dept_count proc(’Physics’, d_count);

Declare d_count integer; call dept_count proc(’Physics’);

Declare d_count integer; call dept_count proc(’Physics’);

Declare d_count; call dept_count proc(’Physics’, d_count);

Declare d_count; call dept_count proc(’Physics’, d_count);

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 5

Time: 00:00:00
`The format for compound statement is`

Begin ……. end

Begin ……. end

Begin atomic……. end

Begin atomic……. end

Begin ……. repeat

Begin ……. repeat

Both Begin ……. end and Begin atomic……. end

Both Begin ……. end and Begin atomic……. end

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 6

Time: 00:00:00
```Repeat
sequence of statements;
__________________
end repeat
Fill in the correct option :

```

While Condition

While Condition

Until variable

Until variable

Until boolean expression

Until boolean expression

Until 0

Until 0

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 7

Time: 00:00:00
`Which of the following is the correct format for if statement?`

If boolean expression then statement or compound statement elseif boolean expression then statement or compound statement else statement or compound statement end if

If boolean expression then statement or compound statement elseif boolean expression then statement or compound statement else statement or compound statement end if

If boolean expression then statement or compound statement elsif boolean expression then statement or compound statement else statement or compound statement end if

If boolean expression then statement or compound statement elsif boolean expression then statement or compound statement else statement or compound statement end if

If boolean expression then statement or compound statement elif boolean expression then statement or compound statement else statement or compound statement end if

If boolean expression then statement or compound statement elif boolean expression then statement or compound statement else statement or compound statement end if

If boolean expression then statement or compound statement else statement or compound statement else statement or compound statement end if

If boolean expression then statement or compound statement else statement or compound statement else statement or compound statement end if

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 8

Time: 00:00:00
`A stored procedure in SQL is a__________`

Block of functions

Block of functions

Group of Transact-SQL statements compiled into a single execution plan.

Group of Transact-SQL statements compiled into a single execution plan.

Group of distinct SQL statements

Group of distinct SQL statements

None of the mentioned

None of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 9

Time: 00:00:00
`Temporary stored procedures are stored in _________ database.`

Master

Master

Model

Model

User specific

User specific

Tempdb

Tempdb

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 10

Time: 00:00:00
```Declare out of classroom seats condition

DECLARE exit handler FOR OUT OF classroom seats BEGIN SEQUENCE OF statements END
The above statements are used for

```

Calling procedures

Calling procedures

Handling Exception

Handling Exception

Handling procedures

Handling procedures

All of the mentioned

All of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.