Database
Aptitude · Reasoning · English · CS — Corporate & Campus Interview Prep
19 Questions 10 Topics Take Test
Advertisement
Showing 11–19 of 19 questions
Q.11 Easy SQL Basics
Which SQL 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 rows where join condition is satisfied in both tables. Other JOINs include non-matching rows.

Take Test
Q.12 Easy SQL Basics
What will be the result of: SELECT 10 % 3; in SQL?
A 3
B 1
C 3.33
D Error
Correct Answer:  B. 1
Explanation:

The modulus operator (%) returns remainder after division. 10 divided by 3 gives remainder 1.

Take Test
Q.13 Easy SQL Basics
What is the result of: SELECT CASE WHEN 1=1 THEN 'A' WHEN 2=2 THEN 'B' ELSE 'C' END;?
A 'B'
B 'A'
C 'C'
D NULL
Correct Answer:  B. 'A'
Explanation:

CASE statement evaluates conditions sequentially and returns value for first TRUE condition. 1=1 is TRUE, so 'A' is returned.

Take Test
Q.14 Easy SQL Basics
Which SQL command is used to remove all records from a table without removing the table structure?
A DELETE
B TRUNCATE
C DROP
D REMOVE
Correct Answer:  B. TRUNCATE
Explanation:

TRUNCATE removes all rows but keeps the table structure. DELETE removes rows one by one and can be rolled back. DROP removes the entire table.

Take Test
Q.15 Easy SQL Basics
In a student enrollment database, you need to find students enrolled in multiple courses. Which JOIN type should be used to match course_id from enrollment table with course table?
A INNER JOIN
B LEFT JOIN
C RIGHT JOIN
D CROSS JOIN
Correct Answer:  A. INNER JOIN
Explanation:

INNER JOIN returns only matching records from both tables, perfect for finding students with matching course enrollments.

Take Test
Advertisement
Q.16 Easy SQL Basics
What is the default sort order for ORDER BY clause in SQL?
A Ascending
B Descending
C Random
D Alphabetical
Correct Answer:  A. Ascending
Explanation:

ORDER BY sorts in ascending order by default. Use DESC keyword for descending order.

Take Test
Q.17 Easy SQL Basics
Which aggregate function ignores NULL values in SQL?
A COUNT(*)
B COUNT(column_name)
C SUM()
D Both B and C
Correct Answer:  D. Both B and C
Explanation:

COUNT(column_name), SUM(), AVG(), MAX(), and MIN() all ignore NULL values. COUNT(*) counts all rows including NULLs.

Take Test
Q.18 Easy SQL Basics
Which SQL statement is used to add a new column to existing table?
A ADD COLUMN
B ALTER TABLE ... ADD
C INSERT COLUMN
D UPDATE TABLE ... ADD
Correct Answer:  B. ALTER TABLE ... ADD
Explanation:

ALTER TABLE ... ADD COLUMN syntax is correct for adding columns. Other options are invalid SQL syntax.

Take Test
Q.19 Easy SQL Basics
Which feature of SQL allows preventing duplicate values in a column?
A PRIMARY KEY constraint
B UNIQUE constraint
C NOT NULL constraint
D FOREIGN KEY constraint
Correct Answer:  B. UNIQUE constraint
Explanation:

UNIQUE constraint prevents duplicate values. PRIMARY KEY is unique + NOT NULL. NOT NULL only prevents nulls. FOREIGN KEY maintains referential integrity.

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