ExamVeda
Login
Home
11
How can you fetch data from a result set obtained through an execute() command?
Discuss
Answer & Solution
Answer: Option C
Solution:
Data from a result set is typically fetched by iterating through the result set using loops.
12
What does the commit() method do in the context of database transactions?
Discuss
Answer & Solution
Answer: Option C
Solution:
The commit() method saves the changes made during a database transaction.
13
What is an ORM (Object-Relational Mapping) in database connectivity?
Discuss
Answer & Solution
Answer: Option C
Solution:
ORM is a technique that maps database tables to object-oriented programming classes, simplifying database interactions.
14
Which ORM library is popular for Python database connectivity?
Discuss
Answer & Solution
Answer: Option C
Solution:
SQLAlchemy is a widely used ORM library for Python, supporting various database management systems.
15
How do you define a class that maps to a database table using SQLAlchemy?
Discuss
Answer & Solution
Answer: Option C
Solution:
In SQLAlchemy, you inherit from the Base class and define attributes to map a class to a database table.
16
What is a primary key in a database table?
Discuss
Answer & Solution
Answer: Option B
Solution:
A primary key is a unique identifier for each row in a database table.
17
What is the role of a foreign key in a relational database?
Discuss
Answer & Solution
Answer: Option B
Solution:
A foreign key is used to establish relationships between tables, ensuring data integrity and referential integrity.
18
What does the term "CRUD" stand for in the context of databases?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
19
How can you update data in a database table using SQL?
Discuss
Answer & Solution
Answer: Option A
Solution:
The UPDATE statement is used to modify data in a database table.
20
What is the purpose of a stored procedure in a database?
Discuss
Answer & Solution
Answer: Option C
Solution:
A stored procedure is a precompiled collection of SQL statements that can be reused and executed in a database.