DBI202 Practice Questions with 100% Correct
Answers
In SQL, what is the primary advantage of using stored procedures?
A. They allow for the creation of tables
B. They enhance security by restricting access to data
C. They provide a way to encapsulate and reuse a set of SQL statements
D. They are more efficient than regular SQL queries
C. They provide a way to encapsulate and reuse a set of SQL statements
Which type of user-defined function in SQL returns a single value?
A. Scalar function
B. Table-valued function
C. Inline function
D. Aggregate function
A. Scalar function
Two concurrent executing transactions T1 and T2 are allowed to update the same
record in an uncontrolled manner. In such a scenario. The following problem may not
occur if database system has no concurrency module and allows concurrent execution of
above two transactions.Which of the following is correct in this case?
A. Transaction failure
B. Dirty read problem
C. Lost update problem
D. Inconsistent database state
C. Lost update problem
,What is the main disadvantage of having too many indexes on a table?
A. Improved query performance
B. Increased storage space
C. Enhanced data integrity
D. Fast data modification operations
B. Increased storage space
Given table A with n rows and table B with m rows. How many rows of table result by
Cartesian product on AxB?
A. m*n rows
B. m*n +1 rows
C. m*n-1 rows
D. m+n rows
A. m*n rows
Which of the following is NOT the binary operation in the relational Algebra?
A. Project
B. Cartesian product
C. Union
D. Set difference
A. Project
A key:
A. must always be composed of two or more columns.
B. can only be one column.
C. identifies a row.
D. identifies a column.
,C. identifies a row.
This simple SQL queries, uses the three keywords that characterize SQL is ____ ?
A. Count, Sum and Avg
B. Insert, Update and Delete
C. Select, From, and Where
D. And, Or, and Not
C. Select, From, and Where
In the relational model, how are relationships represented between tables?
A. By adding attributes to each table
B. By creating a new table for each relationship
C. By adding foreign keys to related tables
D. By creating a primary key in each table
C. By adding foreign keys to related tables
What is a weak entity in an ERD?
A. An entity with no attributes
B. An entity that participates in a one-to-many relationship
C. An entity that cannot exist without being related to another entity
D. An entity with a composite key
C. An entity that cannot exist without being related to another entity
A primary key is combined with a foreign key creates:
A. Parent-Child relationship between the tables that connect them.
B. Many to many relationship between the tables that connect them.
, C. Network model between the tables that connect them.
D. None of the mentioned.
A. Parent-Child relationship between the tables that connect them.
The key for a weak entity set is_____?
A. Zero or more attributes
B. The set of attributes of supporting relationships
C. It is possible for an entity set's key to be composed of attributes, some or all of which
belong to another entity set
D. The set of attributes of supporting entity sets
C. It is possible for an entity set's key to be composed of attributes, some or all of which
belong to another entity set
What are some benefits of normalization when converting an ERD to a relational
model?
A. Increased storage space efficiency
B. Reduced update anomalies
C. Simplified database queries
D. Enhanced data security
B. Reduced update anomalies
_____ returns a relation instance containing all tuples that occur in both R and S
A. Intersection
B. Set-difference
C. Union
D. Cross-product
Answers
In SQL, what is the primary advantage of using stored procedures?
A. They allow for the creation of tables
B. They enhance security by restricting access to data
C. They provide a way to encapsulate and reuse a set of SQL statements
D. They are more efficient than regular SQL queries
C. They provide a way to encapsulate and reuse a set of SQL statements
Which type of user-defined function in SQL returns a single value?
A. Scalar function
B. Table-valued function
C. Inline function
D. Aggregate function
A. Scalar function
Two concurrent executing transactions T1 and T2 are allowed to update the same
record in an uncontrolled manner. In such a scenario. The following problem may not
occur if database system has no concurrency module and allows concurrent execution of
above two transactions.Which of the following is correct in this case?
A. Transaction failure
B. Dirty read problem
C. Lost update problem
D. Inconsistent database state
C. Lost update problem
,What is the main disadvantage of having too many indexes on a table?
A. Improved query performance
B. Increased storage space
C. Enhanced data integrity
D. Fast data modification operations
B. Increased storage space
Given table A with n rows and table B with m rows. How many rows of table result by
Cartesian product on AxB?
A. m*n rows
B. m*n +1 rows
C. m*n-1 rows
D. m+n rows
A. m*n rows
Which of the following is NOT the binary operation in the relational Algebra?
A. Project
B. Cartesian product
C. Union
D. Set difference
A. Project
A key:
A. must always be composed of two or more columns.
B. can only be one column.
C. identifies a row.
D. identifies a column.
,C. identifies a row.
This simple SQL queries, uses the three keywords that characterize SQL is ____ ?
A. Count, Sum and Avg
B. Insert, Update and Delete
C. Select, From, and Where
D. And, Or, and Not
C. Select, From, and Where
In the relational model, how are relationships represented between tables?
A. By adding attributes to each table
B. By creating a new table for each relationship
C. By adding foreign keys to related tables
D. By creating a primary key in each table
C. By adding foreign keys to related tables
What is a weak entity in an ERD?
A. An entity with no attributes
B. An entity that participates in a one-to-many relationship
C. An entity that cannot exist without being related to another entity
D. An entity with a composite key
C. An entity that cannot exist without being related to another entity
A primary key is combined with a foreign key creates:
A. Parent-Child relationship between the tables that connect them.
B. Many to many relationship between the tables that connect them.
, C. Network model between the tables that connect them.
D. None of the mentioned.
A. Parent-Child relationship between the tables that connect them.
The key for a weak entity set is_____?
A. Zero or more attributes
B. The set of attributes of supporting relationships
C. It is possible for an entity set's key to be composed of attributes, some or all of which
belong to another entity set
D. The set of attributes of supporting entity sets
C. It is possible for an entity set's key to be composed of attributes, some or all of which
belong to another entity set
What are some benefits of normalization when converting an ERD to a relational
model?
A. Increased storage space efficiency
B. Reduced update anomalies
C. Simplified database queries
D. Enhanced data security
B. Reduced update anomalies
_____ returns a relation instance containing all tuples that occur in both R and S
A. Intersection
B. Set-difference
C. Union
D. Cross-product