Database — SQL Basics
Aptitude · Reasoning · English · CS — Corporate & Campus Interview Prep
19 Questions 10 Topics Take Test
Advertisement
Showing 1–10 of 19 questions in SQL Basics
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 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.7 Easy SQL Basics
Which statement is used to modify existing data in a table?
A MODIFY
B CHANGE
C UPDATE
D ALTER
Correct Answer:  C. UPDATE
Explanation:

The UPDATE statement is used to modify existing records in a table.

Take Test
Q.8 Easy SQL Basics
In SQL, which clause is used to filter groups based on aggregate function results?
A HAVING
B WHERE
C GROUP BY
D FILTER
Correct Answer:  A. HAVING
Explanation:

HAVING clause filters groups created by GROUP BY, while WHERE filters individual rows before grouping.

Take Test
Q.9 Easy SQL Basics
Which data type in SQL is used to store large text documents or binary data?
A VARCHAR
B TEXT
C BLOB
D CLOB
Correct Answer:  C. BLOB
Explanation:

BLOB (Binary Large Object) stores large binary data. CLOB stores large text. TEXT is limited compared to BLOB/CLOB.

Take Test
Q.10 Easy SQL Basics
What is the purpose of the DISTINCT keyword in SQL?
A To sort results in ascending order
B To remove duplicate rows from results
C To limit the number of rows returned
D To group rows by column values
Correct Answer:  B. To remove duplicate rows from results
Explanation:

DISTINCT eliminates duplicate rows from query results, ensuring each unique combination appears only once.

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