hamburger

Database Questions and Answers

By BYJU'S Exam Prep

Updated on: September 25th, 2023

Database Questions and Answers are provided here for candidates who are actively preparing for the GATE CSE exam 2023. Database questions and answers can provide a quick overview of the types of questions to be expected in the exam on this topic.

The database will be better understood by using objective-based MCQ questions and answers. Five specially picked questions are mentioned here based on the recent exam pattern. Attempt and get the detailed solution to each database questions and answers mentioned in this article. 

Database Question 1

Which of the following is a group of one or more attributes that uniquely identifies a row?

  1. Key
  2. Determinant
  3. Tuple
  4. Relation

Answer: A. Key

Solution

A determinant is the set of attributes on the left side of the functional dependency. A row of the relation is referred to as a tuple. In the Relational database, a table is referred to as a relation. A key is used to identify a row uniquely. A key is defined as an attribute or set of attributes that can be used to identify a row uniquely. So option A is correct.

Database Question 2

The primary key is selected from the:

  1. Composite keys.
  2. Determinants.
  3. Candidate keys.
  4. Foreign keys.

Answer: C. Candidate keys

Solution

One of the candidate keys is selected as a primary key for the relation. The reason we select a candidate key to be the primary key is that a candidate key allows only unique and no-null values. A composite key and a foreign key may allow null values. So clearly, we can eliminate options A, B, and D.

Database Question 3

You can add a row using SQL in a database with which of the following?

  1. ADD
  2. CREATE
  3. INSERT
  4. MAKE

Answer: C. INSERT

Solution

The ADD command is used to add a column to the existing table. To add or insert a new row in a database relation, we use the SQL command INSERT of the DML(Data Manipulation Language). CREATE is a DDL language command of SQL, which is used to create a database. So the correct answer is option C.

Database Question 4

The command to remove rows from a table ‘CUSTOMER’ is:

  1. REMOVE FROM CUSTOMER …
  2. DROP FROM CUSTOMER …
  3. DELETE FROM CUSTOMER WHERE …
  4. UPDATE FROM CUSTOMER …

Answer: C. DELETE FROM CUSTOMER WHERE …

Solution:

The command used to remove the rows from a particular table is DELETE. If the complete table is required to be deleted, the command used is: DELETE FROM table name; else, if only rows based on some condition need to be deleted, then the command: DELETE FROM TABLE WHERE condition; is used. For table customers, the command will be: DELETE FROM CUSTOMER WHERE condition, so option C is the correct answer to the question.

Database Question 5

Which of the following is the original purpose of SQL?

  1. To specify the syntax and semantics of SQL data definition language.
  2. To specify the syntax and semantics of SQL manipulation language.
  3. To define the data structures.
  4. All of the above.

Answer: D. All of the above.

Solution:

The SQL is further divided into three types that is DDL or Data Definition Language, DML or Data Manipulation Language, and DCL or Data Control Language, which help the user to create, manipulate and control data efficiently. Therefore D is the correct answer to the question.

☛ Related Questions:

Our Apps Playstore
POPULAR EXAMS
SSC and Bank
Other Exams
GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com
Home Practice Test Series Premium