wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CS10337 - Lecture # 9

Total questions: 10

Worksheet time: 4mins

Name
Class
Date
1.

Dynamic SQL statements are constructed and executed at runtime rather than being hard-coded.

a)

True

b)

False

2.

Static SQL provides greater flexibility than Dynamic SQL because it can adapt to user input.

a)

True

b)

False

3.

Dynamic SQL is typically implemented in MySQL using the PREPARE, EXECUTE, and DEALLOCATE PREPARE statements.

a)

True

b)

False

4.

Parameterization is one of the most effective defenses against SQL injection in dynamic SQL.

a)

True

b)

False

5.

Using dynamic SQL automatically protects against SQL injection if the syntax is correct.

a)

True

b)

False

6.

Which of the following best describes Dynamic SQL?

a)

SQL code stored permanently in the database.

b)

SQL that is constructed and executed at runtime.

c)

SQL used only for read-only operations.

d)

SQL that cannot include variables.

7.

Which of the following are common use cases for dynamic SQL?

a)

Hardcoding static reports

b)

Fixed database schemas

c)

Generating reports with variable filters

d)

Creating indexes during database installation only

8.

Which of these statements is NOT true about static SQL?

a)

It is hardcoded and known at compile time.

b)

It provides predictable performance.

c)

It can automatically adapt to runtime variables.

d)

It is easier to maintain.

9.

In MySQL, which sequence correctly represents the steps to execute Dynamic SQL?

a)

PREPARE → EXECUTE → COMMIT

b)

PREPARE → EXECUTE → DEALLOCATE PREPARE

c)

PREPARE → EXECUTE → DEALLOCATE

d)

CREATE → EXECUTE → CLOSE

10.

Which of the following is a recommended security measure for using dynamic SQL safely?

a)

Concatenating user input directly into SQL strings

b)

Allowing full DBA privileges to all users

c)

Using parameterized queries and input validation

d)

Storing dynamic SQL inside system tables