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 are the three basic steps in query processing?
Parsing, compilation, and execution
Parsing and translation, optimization, and evaluation
Analysis, synthesis, and implementation
Input, processing, and output
Question 2 of 60
Quiz ID: q2
During the parsing and translation step, what does the parser check?
Only syntax errors
Only semantic errors
Syntax and verifies relations
Performance optimization opportunities
Question 3 of 60
Quiz ID: q3
What is the internal form that queries are translated into during parsing?
SQL format
Machine code
Relational algebra
Assembly language
Question 4 of 60
Quiz ID: q4
What does the query-execution engine do during the evaluation step?
Optimizes the query syntax
Takes a query-evaluation plan, executes it, and returns answers
Translates SQL to relational algebra
Checks for syntax errors
Question 5 of 60
Quiz ID: q5
Consider the query 'select balance from account where balance<2500'. Which of the following relational algebra expressions are equivalent?
σbalance<2500(πbalance(account)) and πbalance(σbalance<2500(account))
Only σbalance<2500(πbalance(account))
Only πbalance(σbalance<2500(account))
They are not equivalent
Question 6 of 60
Quiz ID: q6
What is an evaluation plan?
A SQL query statement
An annotated expression specifying detailed evaluation strategy
A database schema design
A user interface specification
Question 7 of 60
Quiz ID: q7
For finding accounts with balance < 2500, which evaluation strategies are mentioned?
Only using an index on balance
Only performing complete relation scan
Using an index on balance OR performing complete relation scan and discarding inappropriate records
Creating a new temporary table
Question 8 of 60
Quiz ID: q8
What is the primary goal of query optimization?
To make queries shorter
To choose the evaluation plan with lowest cost among all equivalent plans
To eliminate all SQL syntax errors
To increase database storage capacity
Question 9 of 60
Quiz ID: q9
How is cost estimated during query optimization?
By measuring actual execution time
Using statistical information from the database catalog
By counting the number of SQL statements
Through user feedback surveys
Question 10 of 60
Quiz ID: q10
Query cost is generally measured as:
Number of SQL lines
Database storage space used
Total elapsed time for answering query
Number of users accessing the database
Question 11 of 60
Quiz ID: q11
Which factors contribute to query time cost?
Only disk accesses
Only CPU usage
Disk accesses, CPU, and network communication
Only network communication
Question 12 of 60
Quiz ID: q12
What is typically the predominant cost factor in query execution?
CPU processing
Memory usage
Disk access
Network latency
Question 13 of 60
Quiz ID: q13
How is disk access cost measured?
Only by counting total disk operations
Number of seeks × average-seek-cost + Number of blocks read × average-block-read-cost + Number of blocks written × average-block-write-cost
Only by measuring seek time
Only by counting read operations
Question 14 of 60
Quiz ID: q14
Why is the cost to write a block greater than the cost to read a block?
Write operations are more complex
Data is read back after being written to ensure that the write was successful
Write operations require more CPU power
Disk heads move slower during write operations
Question 15 of 60
Quiz ID: q15
What can make the cost difference between evaluation plans for a query?
Minimal - usually within milliseconds
Moderate - usually within minutes
Enormous - can be seconds vs. days in some cases
Negligible - all plans perform similarly
Question 16 of 60
Quiz ID: q16
What are the three steps in cost-based query optimization?
Parse, execute, return results
Generate logically equivalent expressions using equivalence rules, annotate resultant expressions to get alternative query plans, choose the cheapest plan based on estimated cost
Analyze syntax, optimize performance, execute query
Read input, process data, write output
Question 17 of 60
Quiz ID: q17
What statistical information about relations is used for cost estimation?
Only table names
Number of tuples and number of distinct values for an attribute
Only data types used
Only primary key information
Question 18 of 60
Quiz ID: q18
Why are statistics estimation for intermediate results important?
To reduce storage requirements
To compute cost of complex expressions
To improve user interface design
To enhance security measures
Question 19 of 60
Quiz ID: q19
How are cost formulae for algorithms computed?
Using random estimates
Using statistics
Using user preferences
Using hardware specifications only
Question 20 of 60
Quiz ID: q20
What is a transaction in database systems?
A single SQL statement
A unit of program execution that accesses and possibly updates various data items
A database backup operation
A user login session
Question 21 of 60
Quiz ID: q21
What must a transaction see when it begins execution?
An empty database
A consistent database
A backup database
A temporary database
Question 22 of 60
Quiz ID: q22
What can happen to the database during transaction execution?
It must always remain consistent
It may be temporarily inconsistent
It becomes permanently corrupted
It gets automatically backed up
Question 23 of 60
Quiz ID: q23
What must be true when a transaction completes successfully?
The database may remain inconsistent
The database must be consistent
The database is deleted
The database is locked permanently
Question 24 of 60
Quiz ID: q24
What happens to changes made by a committed transaction?
They are automatically rolled back
They persist even if there are system failures
They are lost during system restart
They are saved only temporarily
Question 25 of 60
Quiz ID: q25
Can multiple transactions execute in parallel?
No, transactions must always run sequentially
Yes, multiple transactions can execute in parallel
Only if they access different databases
Only during off-peak hours
Question 26 of 60
Quiz ID: q26
What are the two main issues to deal with in transaction processing?
Speed and accuracy
Failures of various kinds and concurrent execution of multiple transactions
Storage and retrieval
Input and output operations
Question 27 of 60
Quiz ID: q27
What does the 'A' in ACID properties stand for?
Accuracy
Atomicity
Authentication
Authorization
Question 28 of 60
Quiz ID: q28
What does Atomicity ensure in transactions?
Transactions execute quickly
Either all operations of the transaction are properly reflected in the database or none are
Transactions use minimum storage
Transactions are encrypted
Question 29 of 60
Quiz ID: q29
What does Consistency mean in ACID properties?
Data is stored in the same format
Execution of a transaction in isolation preserves the consistency of the database
All transactions take the same time
Database size remains constant
Question 30 of 60
Quiz ID: q30
What does Isolation ensure in transaction processing?
Transactions are stored separately
Each transaction must be unaware of other concurrently executing transactions
Transactions cannot access the same data
Transactions execute on different servers
Question 31 of 60
Quiz ID: q31
According to the Isolation property, what must be hidden from concurrently executed transactions?
Final transaction results
Intermediate transaction results
Transaction identifiers
Database schema information
Question 32 of 60
Quiz ID: q32
For any pair of transactions Ti and Tj under Isolation, how should they appear to each other?
They should be aware of each other's progress
It should appear to Ti that either Tj finished execution before Ti started, or Tj started execution after Ti finished
They should execute simultaneously
They should share intermediate results
Question 33 of 60
Quiz ID: q33
What does Durability ensure in ACID properties?
Transactions execute for a long time
After a transaction completes successfully, the changes persist even if there are system failures
Database hardware lasts longer
Transactions are resistant to user errors
Question 34 of 60
Quiz ID: q34
In the fund transfer example, what is the sequence of operations to transfer $50 from account A to account B?
read(A), A := A + 50, write(A), read(B), B := B - 50, write(B)
read(A), A := A - 50, write(A), read(B), B := B + 50, write(B)
write(A), read(A), write(B), read(B)
read(B), B := B + 50, write(B), read(A), A := A - 50, write(A)
Question 35 of 60
Quiz ID: q35
What does the Atomicity requirement ensure in the fund transfer example?
The transfer happens quickly
If the transaction fails after step 3 and before step 6, the system should ensure that updates are not reflected in the database
Both accounts are updated simultaneously
The transfer amount is validated
Question 36 of 60
Quiz ID: q36
What does the Consistency requirement ensure in the fund transfer example?
Account balances are always positive
The sum of A and B is unchanged by the execution of the transaction
Transfer amounts are rounded to nearest dollar
Account numbers remain the same
Question 37 of 60
Quiz ID: q37
What problem does the Isolation requirement address in the fund transfer example?
Prevents unauthorized access to accounts
If between steps 3 and 6, another transaction accesses the partially updated database, it will see an inconsistent database
Ensures transfer amounts are correct
Prevents account overdrafts
Question 38 of 60
Quiz ID: q38
How can Isolation be ensured trivially?
By using faster processors
By running transactions serially, that is one after the other
By using more memory
By encrypting all data
Question 39 of 60
Quiz ID: q39
Why is executing multiple transactions concurrently beneficial despite isolation challenges?
It uses less memory
It has significant benefits as mentioned in the document
It reduces disk usage
It simplifies programming
Question 40 of 60
Quiz ID: q40
What does the Durability requirement ensure in the fund transfer example?
The transfer can be reversed later
Once the user has been notified that the transaction has completed, the updates must persist despite failures
The accounts are locked during transfer
Transfer history is maintained indefinitely
Question 41 of 60
Quiz ID: q41
What is the initial state of a transaction called?
Started
Active
Beginning
Initiated
Question 42 of 60
Quiz ID: q42
When does a transaction enter the 'Partially committed' state?
When it starts executing
After the final statement has been executed
When it encounters an error
When it is rolled back
Question 43 of 60
Quiz ID: q43
When does a transaction enter the 'Failed' state?
When it starts executing
After the discovery that normal execution can no longer proceed
When it completes successfully
When it is partially committed
Question 44 of 60
Quiz ID: q44
What happens when a transaction is in the 'Aborted' state?
It continues executing
The transaction has been rolled back and the database restored to its state prior to the start of the transaction
It waits for user input
It commits automatically
Question 45 of 60
Quiz ID: q45
What are the two options available after a transaction has been aborted?
Commit or rollback
Restart the transaction or kill the transaction
Save or delete
Continue or pause
Question 46 of 60
Quiz ID: q46
When can a transaction be restarted after being aborted?
Always
Only if no internal logical error occurred
Never
Only with user permission
Question 47 of 60
Quiz ID: q47
When does a transaction enter the 'Committed' state?
When it starts executing
After successful completion
When it encounters an error
When it is partially committed
Question 48 of 60
Quiz ID: q48
Which query processing step involves checking syntax and verifying relations?
Optimization
Parsing and translation
Evaluation
Execution
Question 49 of 60
Quiz ID: q49
What type of algorithms can be used for each relational algebra operation?
Only one specific algorithm per operation
Several different algorithms
Only sorting algorithms
Only searching algorithms
Question 50 of 60
Quiz ID: q50
In what ways can a relational-algebra expression be evaluated?
Only one way
Two ways maximum
Many ways
Three specific ways
Question 51 of 60
Quiz ID: q51
What defines exactly what algorithm is used for each operation in query execution?
SQL statement
Evaluation plan
Database schema
User preferences
Question 52 of 60
Quiz ID: q52
Besides statistical information about relations, what else is needed for cost estimation?
User feedback
Statistics estimation for intermediate results and cost formulae for algorithms
Hardware specifications only
Network speed measurements
Question 53 of 60
Quiz ID: q53
What fundamental requirement must be preserved by the database system?
Fast query execution
Integrity of data
Minimum storage usage
Maximum user capacity
Question 54 of 60
Quiz ID: q54
During concurrent transaction execution, what creates the need for isolation?
Hardware limitations
The possibility of seeing inconsistent intermediate states
Storage constraints
Network delays
Question 55 of 60
Quiz ID: q55
In the transaction state diagram, which states can lead to the Aborted state?
Only Active
Only Failed
Both Active and Failed states
Only Partially committed
Question 56 of 60
Quiz ID: q56
What is the primary reason disk access is considered the predominant cost factor?
It's the most expensive hardware component
It's the slowest operation and relatively easy to estimate
It uses the most electricity
It generates the most heat
Question 57 of 60
Quiz ID: q57
What happens to a transaction that moves from Partially Committed to Committed state?
It gets rolled back
Its changes are made permanent and durable
It enters a waiting state
It is marked for deletion
Question 58 of 60
Quiz ID: q58
Why might equivalent relational algebra expressions have different execution costs?
They produce different results
Different algorithms and execution strategies can be used for the same logical operation
They use different SQL syntax
They access different tables
Question 59 of 60
Quiz ID: q59
What is the relationship between transaction isolation and serial execution?
They are completely different concepts
Serial execution is one way to achieve perfect isolation, but concurrent execution with proper controls can also maintain isolation
Isolation is impossible with serial execution
Serial execution prevents isolation
Question 60 of 60
Quiz ID: q60
In the context of cost-based optimization, what is the ultimate goal of generating multiple equivalent expressions?
To confuse the query processor
To provide backup options in case of failures
To find the expression that can be executed with minimum cost
To demonstrate different SQL syntax options
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