1/14
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Q: Which Python module is commonly used to interact with SQLite databases?
sqlite3
Q: What SQL command is used to retrieve data from a database table?
SELECT
Q: In the Python sqlite3 module, which method is called on the connection object to run a SQL command?
cursor().execute()
Q: After executing an INSERT, UPDATE, or DELETE statement in Python using sqlite3, what method must be called on the connection object to save the changes to the database file?
commit()
Q: Which SQL command is used to add new rows of data into a table?
INSERT
Q: To prevent SQL injection vulnerabilities when inserting or querying data using Python's sqlite3, what technique should be used?
Parameterized queries (using ? placeholders)
Q: In Python's sqlite3 module, after executing a SELECT query, which cursor method retrieves only the next single row from the result set?
fetchone()
Q: Which SQL command modifies existing data within a table?
UPDATE
Q: In Python's sqlite3, after executing a SELECT query, which cursor method retrieves all remaining rows from the result set as a list of tuples (or Row objects)?
fetchall()
Q: What SQL command is used to remove rows from a database table?
DELETE
Q: Which of the following are considered CRUD operations in the context of database management?
Create, Read, Update, Delete
Q: In a Flask application using sqlite3, what does conn.row_factory = sqlite3.Row enable?
Access to row columns by name like a dictionary (e.g., row["name"])
Q: What is the purpose of the cursor() object in Python's sqlite3 module?
It allows you to execute SQL queries and fetch data from the database.
Q: True or False: SQLite requires a separate server process to run, similar to MySQL or PostgreSQL.
False
Q: In Flask, when handling a form submission (POST request) to add data to an SQLite database, where do you typically get the user-submitted data from?
request.form