โ† All CPP Flashcard Decks

Database Programming & SQL Flashcards

7 cards from real CPP practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Database Programming & SQL flashcards as text
  1. What is the primary benefit of using a stored procedure in a database application?

    Answer: It encapsulates SQL logic on the server, reducing network traffic

    Stored procedures reside on the database server, so complex SQL logic executes server-side, reducing the amount of data and round-trips over the network.

  2. A database VIEW is best described as:

    Answer: A named, saved SQL query that behaves like a virtual table

    A view is a stored query that presents data from one or more underlying tables as if it were a table itself, without storing the data redundantly.

  3. Which database isolation level prevents dirty reads but still allows non-repeatable reads?

    Answer: READ COMMITTED

    READ COMMITTED ensures a transaction only reads data that has been committed, preventing dirty reads, but another transaction can still modify and commit rows between reads within the same transaction.

  4. What does an ORM (Object-Relational Mapper) primarily accomplish in application development?

    Answer: Maps database tables to programming language objects, eliminating manual SQL

    An ORM bridges the gap between object-oriented code and relational databases by automatically translating between objects/classes and database rows/tables.

  5. Which SQL statement type is classified as DDL (Data Definition Language)?

    Answer: CREATE TABLE

    DDL statements define or modify database structure; CREATE TABLE creates a new table schema and is therefore DDL, whereas SELECT/INSERT/UPDATE are DML.

  6. When using a database connection pool, what happens when all connections in the pool are in use and a new request arrives?

    Answer: The request waits in a queue until a connection becomes available

    Connection pools have a maximum size; when all connections are busy, incoming requests are queued and wait until a connection is released back to the pool.

  7. A correlated subquery differs from a regular subquery in that it:

    Answer: References a column from the outer query and re-executes for each outer row

    A correlated subquery references a column from the outer query, causing it to be re-evaluated once per row of the outer query rather than once total.

Database Programming & SQL Flashcards โ€” CPP Study Cards with Answers