Practice PCPP2 Database Access questions with full explanations on every answer.
Start practicing
Database Access — choose a session length
Free · No account required
Click any question to see the full explanation and answer options, or start a focused practice session above.
In a PyMongo application, what happens when you use 'insert_many' with 'ordered=False'?
2When using SQLAlchemy Declarative Base, how do you define a table name that differs from the class name?
3In SQLAlchemy, what is the difference between 'lazy='select'' and 'lazy='joined'' loading strategies?
4You are using SQLAlchemy with an asynchronous driver (asyncio). Which object must be used to perform database operations asynchronously?
5You are developing an application using SQLAlchemy and need to retrieve a single object by its primary key. Which method is preferred for this operation?
6You are using sqlite3 in Python and need to ensure that data integrity is maintained when performing multiple related INSERT operations. Which method should you call on the connection object to commit your changes?
7When using the sqlite3 module, what is the primary purpose of using a context manager (the 'with' statement) on a connection object?
8When connecting to a MongoDB instance using PyMongo, what is the role of the 'MongoClient' object?
9Which of the following best describes the benefit of using parameterized queries in sqlite3?
10In SQLAlchemy, what does the 'metadata.create_all(engine)' command do?
11In sqlite3, how do you handle a database error such as a constraint violation?
12When performing bulk inserts in PyMongo, which method is the most efficient?
13Which PyMongo method should be used to update a single document if you want to modify specific fields without replacing the entire document?
14Which object in SQLAlchemy is responsible for maintaining a collection of loaded objects and managing their lifecycle?
15When using the MongoDB aggregation framework in PyMongo, which stage should be used to filter documents based on a condition?
16You are using SQLAlchemy's relationship() function. What does 'back_populates' achieve?
17Which Python library is the standard built-in interface for SQLite databases?
18Which command-line tool is typically used to inspect the contents of a SQLite database file?
19What is the purpose of the 'upsert=True' option in MongoDB update operations?
20When configuring a connection pool in SQLAlchemy, what does the 'pool_size' parameter define?
21In SQL, which clause is used to filter results based on a condition after grouping?
22In SQLAlchemy, how do you prevent an object from being saved to the database during a session.commit()?
23How do you retrieve the number of documents matched by a PyMongo 'find' operation without fetching all documents into memory?
24Which TWO of the following are valid ways to execute a raw SQL query in SQLAlchemy?
25You are implementing a custom type in SQLAlchemy. Which method must be overridden to convert data from the database type back to a Python object?
26Which THREE operations are supported by the PyMongo 'bulk_write' method?
27Which THREE features are provided by SQLAlchemy's Unit of Work pattern?
28Which TWO are common pitfalls when working with SQLite databases in a multi-threaded environment?
29Which THREE are characteristics of BSON (Binary JSON) as used by MongoDB?
30Which THREE of these are valid relationship loading strategies in SQLAlchemy?
31Which TWO of these are valid parameters for the MongoClient constructor?
32Which THREE methods are part of the PEP 249 Python DB-API 2.0 interface?
33Which THREE are valid cascade options in SQLAlchemy?
34Which TWO are common methods to handle BSON Date objects in PyMongo?
The Database Access domain covers the key concepts tested in this area of the PCPP2 exam blueprint published by Python Institute. Courseiva provides free domain-focused practice, mock exams, missed-question review, and readiness tracking across all PCPP2 domains — no account required.
The Courseiva PCPP2 question bank contains 34 questions in the Database Access domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Database Access domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included