Quiz 3

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/14

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

15 Terms

1
New cards

Q: Which Python module is commonly used to interact with SQLite databases?

sqlite3

2
New cards

Q: What SQL command is used to retrieve data from a database table?

SELECT

3
New cards

Q: In the Python sqlite3 module, which method is called on the connection object to run a SQL command?

cursor().execute()

4
New cards

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()

5
New cards

Q: Which SQL command is used to add new rows of data into a table?

INSERT

6
New cards

Q: To prevent SQL injection vulnerabilities when inserting or querying data using Python's sqlite3, what technique should be used?

Parameterized queries (using ? placeholders)

7
New cards

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()

8
New cards

Q: Which SQL command modifies existing data within a table?

UPDATE

9
New cards

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()

10
New cards

Q: What SQL command is used to remove rows from a database table?

DELETE

11
New cards

Q: Which of the following are considered CRUD operations in the context of database management?

Create, Read, Update, Delete

12
New cards

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"])

13
New cards

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.

14
New cards

Q: True or False: SQLite requires a separate server process to run, similar to MySQL or PostgreSQL.

False

15
New cards

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