Quiz: DBA / Database
DBA / Database questions from real interviews as a quiz, with an explanation for every option.
Try it: 5 questions
Loading…
Sample questions
A primary uses asynchronous WAL replication. What can happen if it fails before some WAL records reach the replicas?
- Acknowledged transactions may be lost when a replica is promoted.
- Only transactions the primary did not acknowledge to the client can be lost.
- Replicas will automatically recover the missing WAL after the primary fails.
- No data can be lost because WAL is first written to the primary.
Which statements about heap and append-optimized (AO) tables in Greenplum are correct? Select three.
- Heap stores rows in physical key order and maintains that order as rows are inserted.
- AO is generally preferable to heap for frequent random updates and deletes.
- Heap is generally more suitable for frequent small inserts, updates, and deletes.
- AO can use either a row-oriented or column-oriented format, and can use compression.
- AO is optimized for sequential loading and analytical reads over large data volumes.
How are operators and tasks related in Airflow?
- An operator describes a type of work, while a task is its configured instance in a DAG, with parameters and dependencies.
- An operator is one execution of a task, while a task is a reusable template that can be run repeatedly.
- A task describes a type of work, while an operator is its configured instance in a DAG, with parameters and dependencies.
- An operator schedules the DAG, while a task specifies the order in which operators run.
What is the main difference between Always On Availability Groups and transactional replication in SQL Server?
- AGs provide database availability and failover between replicas, while transactional replication distributes data changes.
- Both technologies work the same way and differ only in whether transfer is synchronous or asynchronous.
- AGs replicate only selected tables, while transactional replication copies an entire SQL Server instance.
- AGs distribute changes to selected tables for integration, while transactional replication switches an entire database after a failure.
What is the main difference between system-defined and user-defined exceptions in PL/SQL?
- System exceptions are declared in
DECLARE, while user-defined ones are declared only inEXCEPTION. - System exceptions usually arise automatically from runtime errors, while user-defined exceptions are declared and raised in code.
- System exceptions are handled before the block runs, while user-defined ones are handled after it finishes.
- System exceptions can only be caught with
WHEN OTHERS, while user-defined ones are caught by name.
- System exceptions are declared in
In SQL, how can you roll back only the changes made after a specific point in a transaction while keeping earlier changes?
- Run
ROLLBACKwithout any additional commands - Run
COMMITafter each operation - Create a
SAVEPOINT, then runROLLBACK TO SAVEPOINT - Use
BEGINinside the current transaction
- Run
Which descriptions of Python libraries are accurate? Select three options.
- NumPy provides multidimensional arrays and mathematical functions for computation.
- PySpark lets Python applications use Apache Spark for distributed data processing.
- pandas provides
DataFrameandSeriesfor working with tabular data. - SQLAlchemy is an HTTP client for sending GET and POST requests.
- requests parses YAML, while PyYAML sends HTTP requests.
Which description of operators, hooks, and XCom in Airflow is correct?
- An operator connects to an external system, a hook defines a task type in a DAG, and XCom stores files between runs.
- An operator passes data between tasks, a hook stores DAG state, and XCom manages database connections.
- Both operators and hooks define DAG tasks, while XCom replaces a shared database for storing results.
- An operator defines a task type in a DAG, a hook connects to an external system, and XCom passes small values between tasks.
Which statement correctly describes table partitioning in Greenplum?
- It places a copy of every row on every segment to improve availability.
- It splits rows across segments by hash and thereby defines the table’s logical partitions.
- It divides a table logically by a key; distribution across segments is configured separately.
- It creates an index for every column and replaces the distribution of rows across segments.
Which statement correctly describes the difference between a primary key and a foreign key?
- Both keys uniquely identify rows, but a primary key can contain
NULL. - A primary key uniquely identifies a row in its table; a foreign key refers to a key in another table.
- A primary key refers to another table; a foreign key uniquely identifies a row in its own table.
- A primary key links tables; a foreign key ensures rows are unique within a table.
- Both keys uniquely identify rows, but a primary key can contain