Mock Quiz Hub
Dark
Mock Quiz Hub
1
Recent Updates
Added: OS Mid 1 Quiz
Added: OS Mid 2 Quiz
Added: OS Lab 1 Quiz
Check back for more updates!
Time: 00:00
Quiz
Navigate through questions using the controls below
0%
Question 1 of 60
Quiz ID: q1
What does JDBC stand for?
Java Database Connection
Java Database Connectivity
Java Data Base Control
Java Database Communication
Question 2 of 60
Quiz ID: q2
Which of the following is NOT a typical step in the JDBC model for communicating with a database?
Open a connection
Create a statement object
Compile SQL statements
Execute queries using the Statement object
Question 3 of 60
Quiz ID: q3
In JDBC, which method is used to execute INSERT, UPDATE, or DELETE statements?
executeQuery()
executeUpdate()
execute()
executeBatch()
Question 4 of 60
Quiz ID: q4
In JDBC, which method returns a ResultSet object?
executeUpdate()
executeQuery()
execute()
executeBatch()
Question 5 of 60
Quiz ID: q5
What are the two equivalent ways to get a field value from a ResultSet?
resultSet.getString("field_name") and resultSet.getString(index)
resultSet.getField("field_name") and resultSet.getField(index)
resultSet.getValue("field_name") and resultSet.getValue(index)
resultSet.fetchString("field_name") and resultSet.fetchString(index)
Question 6 of 60
Quiz ID: q6
What symbol is used as a parameter placeholder in PreparedStatement?
%
@
?
#
Question 7 of 60
Quiz ID: q7
Why should you always use PreparedStatement when taking user input?
It executes faster
It uses less memory
To prevent SQL injection attacks
It provides better error handling
Question 8 of 60
Quiz ID: q8
What problem occurs if a user enters "D'Souza" as input when using string concatenation to build SQL queries?
Memory overflow
Syntax error due to the single quote
Character encoding issues
Database connection timeout
Question 9 of 60
Quiz ID: q9
In the SQL injection example, if a user enters "X' or 'Y' = 'Y" what does the resulting query become?
select * from instructor where name = 'X' or 'Y' = 'Y'
select * from instructor where name = 'X\' or \'Y\' = \'Y'
select * from instructor where name = "X' or 'Y' = 'Y"
The query will fail with a syntax error
Question 10 of 60
Quiz ID: q10
By default, how does JDBC handle transaction commits?
Manually - you must call commit() for each statement
Each SQL statement is treated as a separate transaction that is committed automatically
All statements in a session are committed together
Transactions are never committed automatically
Question 11 of 60
Quiz ID: q11
To manually control transactions in JDBC, you should first call:
conn.setTransaction(false)
conn.setAutoCommit(false)
conn.beginTransaction()
conn.disableAutoCommit()
Question 12 of 60
Quiz ID: q12
Which JDBC method is used to handle large binary objects?
getLargeObject()
getBinaryData()
getBlob()
getLOB()
Question 13 of 60
Quiz ID: q13
What does ODBC stand for?
Object Database Connectivity
Open Database Connection
Open Database Connectivity
Oracle Database Connection
Question 14 of 60
Quiz ID: q14
Which programming languages does ODBC work with?
Only Java
Only C and C++
C, C++, C#, and Visual Basic
All programming languages
Question 15 of 60
Quiz ID: q15
In embedded SQL, what keyword is used to identify SQL statements to the preprocessor?
SQL
EXEC SQL
EMBED SQL
BEGIN SQL
Question 16 of 60
Quiz ID: q16
What is the main advantage of SQLJ over JDBC?
SQLJ is faster at runtime
SQLJ uses less memory
SQLJ can catch errors at compile time rather than runtime
SQLJ supports more database systems
Question 17 of 60
Quiz ID: q17
In SQLJ, what syntax is used to embed SQL statements?
EXEC SQL { ... }
#SQL { ... }
SQL { ... }
EMBED SQL { ... }
Question 18 of 60
Quiz ID: q18
What are stored procedures in SQL?
Procedures stored in application memory
Procedures that can be stored in the database and executed using the call statement
Procedures that are automatically executed on startup
Procedures that handle database backup
Question 19 of 60
Quiz ID: q19
Which SQL standard first supported functions and procedures?
SQL:1992
SQL:1999
SQL:2003
SQL:2006
Question 20 of 60
Quiz ID: q20
In the function creation example, what does the 'returns integer' clause specify?
The number of parameters the function accepts
The data type of the value returned by the function
The maximum value the function can return
The number of rows the function processes
Question 21 of 60
Quiz ID: q21
What type of SQL construct was introduced in SQL:2003 for functions?
Scalar functions only
Table functions that return a relation
Aggregate functions only
Window functions only
Question 22 of 60
Quiz ID: q22
What is the main difference between SQL functions and procedures?
Functions are faster than procedures
Procedures can have output parameters while functions return values directly
Functions can only be called from embedded SQL
Procedures cannot access the database
Question 23 of 60
Quiz ID: q23
What does SQL:1999 allow regarding function and procedure names?
Names must be unique across the database
Names can be overloaded as long as the number or types of arguments differ
Names can only contain letters and numbers
Names must start with a specific prefix
Question 24 of 60
Quiz ID: q24
In the while loop example, what is the initial value of variable n?
1
0
10
null
Question 25 of 60
Quiz ID: q25
What does the 'for' loop in SQL procedural constructs allow?
Iteration over a fixed range of numbers
Iteration over all results of a query
Iteration over array elements
Iteration over file contents
Question 26 of 60
Quiz ID: q26
What is a benefit of using external language functions in SQL?
They are more secure than SQL functions
They are more efficient and have more expressive power
They are easier to write
They require less memory
Question 27 of 60
Quiz ID: q27
What is a major security risk of external language functions?
They can access unauthorized data
They consume too much memory
They are slower than SQL functions
They cannot be debugged
Question 28 of 60
Quiz ID: q28
What is a trigger in SQL?
A function that runs on a schedule
A statement executed automatically as a side effect of database modification
A constraint that prevents data modification
A backup mechanism for data recovery
Question 29 of 60
Quiz ID: q29
Which SQL standard first introduced triggers?
SQL:1992
SQL:1999
SQL:2003
Triggers were supported before any standard
Question 30 of 60
Quiz ID: q30
What are the three triggering events that can activate a trigger?
create, alter, drop
select, update, delete
insert, delete, update
commit, rollback, savepoint
Question 31 of 60
Quiz ID: q31
When using 'referencing old row as orow', what type of operations can access this reference?
Only insert operations
Only select operations
Delete and update operations
Only update operations
Question 32 of 60
Quiz ID: q32
What does 'for each statement' mean in trigger context?
The trigger fires once per SQL statement
The trigger fires once per affected row
The trigger fires once per transaction
The trigger fires once per session
Question 33 of 60
Quiz ID: q33
Which of the following is NOT a recommended use case for triggers?
Enforcing complex integrity constraints
Maintaining summary data
Logging changes for audit purposes
Converting data types during insertion
Question 34 of 60
Quiz ID: q34
What is a risk of cascading trigger execution?
Improved performance
Better data integrity
Unintended chain reactions and potential system failure
Simplified database maintenance
Question 35 of 60
Quiz ID: q35
What does the rank() function do in SQL?
Sorts the result set
Assigns ranks to rows based on specified ordering with possible gaps
Counts the number of rows
Finds the maximum value
Question 36 of 60
Quiz ID: q36
What is the difference between rank() and dense_rank()?
rank() is faster than dense_rank()
dense_rank() does not leave gaps in ranking while rank() does
rank() works with numbers only while dense_rank() works with all data types
There is no difference
Question 37 of 60
Quiz ID: q37
What is the primary purpose of window functions in SQL?
To create database windows
To smooth out random variations by computing over a range of rows
To display query results in windows
To partition large tables
Question 38 of 60
Quiz ID: q38
In the windowing example, what does 'between rows 1 preceding and 1 following' specify?
The current row plus the previous and next rows
Only the previous row
Only the next row
The first and last rows of the table
Question 39 of 60
Quiz ID: q39
Which of the following is NOT a form of authorization on database data?
Read
Insert
Update
Compile
Question 40 of 60
Quiz ID: q40
Which authorization allows creation and deletion of indices?
Index
Resources
Alteration
Drop
Question 41 of 60
Quiz ID: q41
What SQL statement is used to confer authorization?
give
allow
grant
permit
Question 42 of 60
Quiz ID: q42
What does 'public' mean in the context of granting privileges?
Only administrators can use it
It allows all valid users the privilege granted
It makes the data publicly visible on the internet
It creates a public backup of the data
Question 43 of 60
Quiz ID: q43
Which statement is used to remove authorization in SQL?
remove
revoke
delete
deny
Question 44 of 60
Quiz ID: q44
What is a role in SQL authorization?
A type of user account
A named collection of privileges that can be granted to users
A database table containing user information
A backup administrator position
Question 45 of 60
Quiz ID: q45
What happens when you grant a role to another role?
An error occurs
The receiving role inherits all privileges of the granted role
Both roles are deleted
The roles are merged into one
Question 46 of 60
Quiz ID: q46
What does 'with grant option' allow?
The grantee to revoke the privilege from others
The grantee to grant the privilege to other users
The grantee to modify the privilege
The grantee to rename the privilege
Question 47 of 60
Quiz ID: q47
In OLAP, what are measure attributes?
Attributes that define dimensions
Attributes that measure some value and can be aggregated
Attributes that store metadata
Attributes that control access permissions
Question 48 of 60
Quiz ID: q48
What are dimension attributes in OLAP?
Attributes that can be aggregated
Attributes that measure values
Attributes that define the dimensions on which measure attributes are viewed
Attributes that store user preferences
Question 49 of 60
Quiz ID: q49
What is a cross-tabulation (cross-tab) also referred to as?
Data cube
Pivot table
Summary table
Aggregate table
Question 50 of 60
Quiz ID: q50
What is a data cube?
A three-dimensional database table
A multidimensional generalization of a cross-tab
A backup storage format
A type of index structure
Question 51 of 60
Quiz ID: q51
What does 'drill down' mean in OLAP operations?
Moving from finer-granularity to coarser-granularity data
Moving from coarser-granularity to finer-granularity data
Creating a new dimension
Deleting unnecessary data
Question 52 of 60
Quiz ID: q52
What does 'rollup' mean in OLAP operations?
Moving from coarser-granularity to finer-granularity data
Moving from finer-granularity to coarser-granularity data
Rotating the data display
Archiving old data
Question 53 of 60
Quiz ID: q53
What does the cube operation in SQL compute?
The volume of a data cube
Union of group by's on every subset of specified attributes
The intersection of multiple tables
A three-dimensional view of the data
Question 54 of 60
Quiz ID: q54
In the cube example with (item_name, color, size), how many different groupings are computed?
3
6
8
12
Question 55 of 60
Quiz ID: q55
What does the grouping() function return when applied to an attribute?
The group number for that attribute
1 if the value represents 'all', 0 otherwise
The total number of groups
The attribute's data type
Question 56 of 60
Quiz ID: q56
What does the rollup construct generate?
Union on every subset of specified attributes
Union on every prefix of specified list of attributes
Cross product of all attributes
Intersection of all groupings
Question 57 of 60
Quiz ID: q57
What does MOLAP stand for?
Multiple Online Analytical Processing
Multidimensional Online Analytical Processing
Modern Online Analytical Processing
Memory Online Analytical Processing
Question 58 of 60
Quiz ID: q58
What is ROLAP?
Relational Online Analytical Processing using only relational database features
Real-time Online Analytical Processing
Remote Online Analytical Processing
Rapid Online Analytical Processing
Question 59 of 60
Quiz ID: q59
What type of handler is shown in the exception handling example?
continue
exit
retry
ignore
Question 60 of 60
Quiz ID: q60
What is the purpose of the signal statement in exception handling?
To catch an exception
To define an exception condition
To raise/trigger an exception condition
To ignore an exception
Quiz Summary
Review your answers before submitting
60
Total Questions
0
Answered
60
Remaining
00:00
Time Spent
Submit Quiz
Back to Questions
Previous
Question 1 of 60
Next
!
Confirm Submission
Cancel
Submit Quiz