Connecting to a SQL Database in Python
In Python, what is the primary object used to represent a connection to a SQL database when using an object-relational mapper like SQLModel or SQLAlchemy?
- Session
- Connector
- Cursor
- Document
- Sesion
Understanding Primary Keys
Why is it important to define a primary key in a relational database table?
- It uniquely identifies each row in the table
- It increases the storage required for each row
- It ensures all data in the column is encrypted
- It automates JOIN operations between tables
- It disables indexes for the table
Basic Data Model with SQLModel
What does a SQLModel class in Python typically represent when modeling a relational database?
- A table in the database
- A Python dictionary
- A database index
- A database view
- A chain of key-value pairs
Performing a CRUD Operation (Create) in NoSQL
When working with a document-based NoSQL database using Python, which method would you typically use to add a single new document to a collection?
- insert_one
- put_item
- append_document
- addRow
- isert_one
Data Relationships in Graph Databases
In a graph database, what term is used for the connections that define relationships between nodes?
- Edges
- Columns
- Keys
- Tuples
- Bridges
Updating Data in a Document Database
Which Python method would you typically use to modify all documents in a collection that match a certain condition in a NoSQL document database?
- update_many
- modify_all
- updateRows
- set_all
- updat_many
Efficient Complex Relationship Queries
For which scenario would a graph database provide better performance than a traditional relational database?
- Finding paths connecting many related entities with unknown depth
- Performing simple numerical aggregation on a single table
- Storing unstructured JSON documents
- Enforcing strict data types on a single field
- Updating the same field in every row of one table
Querying Data from a Relational Database
Which SQL statement is used to retrieve specific rows from a table based on defined criteria?
- SELECT
- GET
- RETRIEVE
- EXTRACT
- SELLECT
Flexible Schema Handling
Why are NoSQL databases often considered more flexible than traditional relational databases?
- They allow data models to evolve dynamically without a fixed schema
- They require all data to use the same format
- They enforce stricter constraints on column data types
- They only support storing binary data
- They process transactions in a fixed order
Python Data Retrieval in a Document Database
In Python, which method retrieves all documents that match a specified condition from a collection in a document-oriented NoSQL database?
- find
- search
- locate
- get_all
- fnd