Database
Aptitude · Reasoning · English · CS — Corporate & Campus Interview Prep
57 Questions 10 Topics Take Test
Advertisement
Showing 1–10 of 57 questions
Q.1 Easy SQL Basics
Which SQL command is used to retrieve data from a database?
A SELECT
B RETRIEVE
C GET
D FETCH
Correct Answer:  A. SELECT
Explanation:

SELECT is the standard SQL command used to retrieve or query data from one or more tables in a database.

Take Test
Q.2 Easy SQL Basics
What does the WHERE clause do in SQL?
A Sorts the results
B Filters rows based on specified conditions
C Groups the data
D Joins multiple tables
Correct Answer:  B. Filters rows based on specified conditions
Explanation:

The WHERE clause is used to filter records that meet specified conditions in a SQL query.

Take Test
Q.3 Easy SQL Basics
Which keyword is used to eliminate duplicate rows in SQL results?
A UNIQUE
B DISTINCT
C DIFFERENT
D EXCLUDE
Correct Answer:  B. DISTINCT
Explanation:

The DISTINCT keyword removes duplicate rows from the result set of a query.

Take Test
Q.4 Easy SQL Basics
What is the correct syntax for inserting data into a table?
A INSERT INTO table_name VALUES (value1, value2, value3);
B INSERT table_name (value1, value2, value3);
C ADD INTO table_name VALUES (value1, value2, value3);
D INSERT VALUES table_name (value1, value2, value3);
Correct Answer:  A. INSERT INTO table_name VALUES (value1, value2, value3);
Explanation:

INSERT INTO is the correct SQL syntax for inserting new records into a table, followed by the table name and VALUES clause.

Take Test
Q.5 Easy SQL Basics
Which SQL aggregate function returns the total sum of a numeric column?
A TOTAL()
B ADD()
C SUM()
D COUNT()
Correct Answer:  C. SUM()
Explanation:

The SUM() function calculates the total sum of all values in a numeric column.

Take Test
Advertisement
Q.6 Medium SQL Basics
What is the purpose of the JOIN clause in SQL?
A To combine rows from two or more tables based on related columns
B To delete records from a table
C To update multiple rows at once
D To create a backup of a table
Correct Answer:  A. To combine rows from two or more tables based on related columns
Explanation:

JOIN combines rows from two or more tables based on a relationship between the columns (usually foreign key relationship).

Take Test
Q.7 Medium SQL Basics
Which type of JOIN returns only matching rows from both tables?
A LEFT JOIN
B RIGHT JOIN
C INNER JOIN
D FULL OUTER JOIN
Correct Answer:  C. INNER JOIN
Explanation:

INNER JOIN returns only the rows that have matching values in both tables being joined.

Take Test
Q.8 Easy SQL Basics
What will be the output of: SELECT COUNT(*) FROM employees;
A The number of columns in the employees table
B The total number of rows in the employees table
C The names of all employees
D An error message
Correct Answer:  B. The total number of rows in the employees table
Explanation:

COUNT(*) returns the total number of rows in the specified table, including NULL values.

Take Test
Q.9 Medium SQL Basics
Which SQL clause is used to sort the result set in ascending or descending order?
A WHERE
B ORDER BY
C GROUP BY
D HAVING
Correct Answer:  B. ORDER BY
Explanation:

The ORDER BY clause sorts the result set in ascending (ASC) or descending (DESC) order. Default is ascending.

Take Test
Q.10 Medium SQL Basics
What is the difference between WHERE and HAVING clauses?
A WHERE filters rows before grouping; HAVING filters groups after grouping
B HAVING filters rows; WHERE filters groups
C They are identical and interchangeable
D WHERE is used with JOIN; HAVING is used with SELECT
Correct Answer:  A. WHERE filters rows before grouping; HAVING filters groups after grouping
Explanation:

WHERE filters individual rows before GROUP BY is applied, while HAVING filters the grouped results after GROUP BY is applied.

Take Test
IGET
IGET AI
Online · Exam prep assistant
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips