Tuesday, June 27, 2023

Database Basics and Schema: Quiz

 What is a primary key in a database table?

a. A unique identifier for a row in a table

b. A field that can store multiple values

c. A column used for sorting data

d. A foreign key in another table


Answer: a. A unique identifier for a row in a table


Which SQL statement is used to create a new table?

a. INSERT

b. CREATE

c. UPDATE

d. SELECT


Answer: b. CREATE


What is a foreign key in a database table?

a. A unique identifier for a row in a table

b. A field that can store multiple values

c. A column used for sorting data

d. A reference to a primary key in another table


Answer: d. A reference to a primary key in another table


Which of the following is NOT a database object?

a. Table

b. Query

c. Schema

d. Index


Answer: b. Query


Which SQL keyword is used to retrieve data from a database table?

a. GET

b. FETCH

c. SELECT

d. SEARCH


Answer: c. SELECT


What is the purpose of an index in a database?

a. To enforce data integrity rules

b. To define relationships between tables

c. To improve the speed of data retrieval

d. To group related data together


Answer: c. To improve the speed of data retrieval


Which SQL statement is used to update data in a database table?

a. INSERT

b. CREATE

c. UPDATE

d. DELETE


Answer: c. UPDATE


What does ACID stand for in the context of database transactions?

a. Atomicity, Consistency, Isolation, Durability

b. Analysis, Concurrency, Integrity, Development

c. Association, Constraints, Indexing, Data

d. Access, Control, Integration, Deployment


Answer: a. Atomicity, Consistency, Isolation, Durability


Which SQL statement is used to delete data from a database table?

a. INSERT

b. CREATE

c. UPDATE

d. DELETE


Answer: d. DELETE


What is the purpose of a database schema?

a. To store data in tables

b. To define the structure of a database

c. To manage database users and permissions

d. To generate reports and analytics


Answer: b. To define the structure of a database

No comments:

Post a Comment

If you have any doubts. Please let me know

How can you create an alias for a table in a SQL query?

In SQL, you can create an alias for a table in a query to give the table a temporary, alternative name that you can use in the query. Table ...