Ch 30: SQL JOIN Operations (Inner, Left, Right, Full)

9 Questions9 MCQs0 Short Questions0 Long Questions
🎯 Exam Practice Papers
SEMESTER PASS

CS403 - Database Management Systems Examination Practice

Timed practice exam simulation for CS403 - Database Management Systems.

📘 VU MID TERM EXAMLectures 1 to 22
⏱️ 60 Mins

Mid Term Examination

Covers syllabus of Lectures 1 to 22 with 30 high-yield MCQs in a timed exam environment.

📝30 MCQs
⏱️60 Minutes
📗 VU FINAL TERM EXAMLectures 23 to 45
⏱️ 90 Mins

Final Term Examination

Comprehensive semester exam preparation with 45 MCQs covering Lectures 23 to 45 with complete course coverage.

📝45 MCQs
⏱️90 Minutes
Showing 1 – 9 of 9 Questions
Page 1 of 1
Q1
❓ MCQ📘 CS403📑 Lec 30🏷️ 30.2. Aggregate Functions in SQL (SUM, AVG, COUNT, MIN, MAX)Hard🔁⭐💡🌟📄🎓VU🏛️VU
Consider an 'employees' table containing the following records: - emp_id: '001', salary: 62000, dept_id: 500 - emp_id: '002', salary: 57500, dept_id: 500 - emp_id: '003', salary: 71000, dept_id: 501 - emp_id: '004', salary: 42000, dept_id: 501 What will be the numeric output of executing the following SQL command? SELECT COUNT(DISTINCT dept_id) AS total FROM employees WHERE salary > 50000;
💻 sql Snippet
SELECT COUNT(DISTINCT dept_id) AS total 
FROM employees 
WHERE salary > 50000;
  1. A.1
  2. B.2
  3. C.3
  4. D.4
Q2
❓ MCQ📘 CS403📑 Lec 30🏷️ 30.4. HAVING ClauseMedium🔁⭐💡🌟📄🎓VU🏛️VU
Which of the following SQL clauses is used in combination with the GROUP BY clause to filter aggregate groups in a SELECT statement?
💻 sql Snippet
SELECT department, COUNT (*) as "Number of employees"
FROM employees
WHERE salary > 25000
GROUP BY department
HAVING COUNT (*) > 10;
  1. A.LIKE
  2. B.JOIN
  3. C.HAVING
  4. D.ORDER BY
Q3
❓ MCQ📘 CS403📑 Lec 30🏷️ 30.2. Aggregate Functions in SQL (SUM, AVG, COUNT, MIN, MAX)Easy🔁⭐💡📄🎓VU🏛️VU
What does the SQL aggregate COUNT() function return when executed on a database table?
💻 sql Snippet
SELECT COUNT(*) FROM student;
  1. A.The largest numerical value present in the designated column
  2. B.The calculated mathematical average value of the specified column's dataset
  3. C.The smallest numerical value present in the designated column
  4. D.The total number of rows matching the query criteria
Q4
❓ MCQ📘 CS403📑 Lec 30🏷️ 30.2. Aggregate Functions in SQL (SUM, AVG, COUNT, MIN, MAX)Easy🔁⭐💡📄🎓VU🏛️VU
Under standard relational database guidelines, how many values are returned by a single SQL aggregate function (such as SUM, AVG, COUNT, MIN, or MAX) when executed over a set of rows?
💻 sql Snippet
SELECT SUM(salary) FROM employees;
  1. A.A NULL value
  2. B.An infinite set of values
  3. C.A single scalar value
  4. D.Twice the number of input values
Q5
🧠 Long Problem📘 CS403📑 Lec 30🏷️ 30.1. ORDER BY ClauseMedium🔁⭐💡📄🎓VU🏛️VU
Consider a table named COMPANY with fields COMPANY_NAME, DESCRIPTION, ORDER_NUMBER. Write an SQL statement to display company names in reverse alphabetical order.
💻 sql Snippet
SELECT COMPANY_NAME FROM COMPANY ORDER BY COMPANY_NAME DESC;
Q6
❓ MCQ📘 CS403📑 Lec 30🏷️ 30.2. Aggregate Functions in SQL (SUM, AVG, COUNT, MIN, MAX)Easy🔁⭐💡📄🎓VU🏛️VU
Which SQL query correctly counts the total number of distinct courses taught in the 'Class' table under standard database guidelines?
💻 sql Snippet
SELECT COUNT(DISTINCT CourseCode) AS TotalCourses FROM Class;
  1. A.SELECT COUNT(DISTINCT CourseCode) AS TotalCourses FROM Class;
  2. B.SELECT COUNT(CourseCode DISTINCT) AS TotalCourses FROM Class;
  3. C.SELECT DISTINCT COUNT(CourseCode) AS TotalCourses FROM Class;
  4. D.SELECT SUM(DISTINCT CourseCode) AS TotalCourses FROM Class;
Q7
🧠 Long Problem📘 CS403📑 Lec 30🏷️ 30.1. ORDER BY ClauseMedium🔁⭐💡📄🎓VU🏛️VU
Consider a database table named 'COMPANY' with the attributes 'COMPANY_NAME' (varchar), 'DESCRIPTION' (varchar), and 'ORDER_NUMBER' (integer). Write a standard SQL query to display all company names in reverse alphabetical order, and explain the syntactical structure and execution order of the query clauses.
💻 sql Snippet
SELECT COMPANY_NAME FROM COMPANY ORDER BY COMPANY_NAME DESC;
Q8
📝 Short Q📘 CS403📑 Lec 30🏷️ 30.3. GROUP BY ClauseMedium🔁⭐💡🌟📄🎓VU🏛️VU
Consider a database relation representing class schedules. Write an SQL query using the MIN aggregate function and the GROUP BY clause to find the earliest (minimum) start time of classes for each unique course code.
💻 sql Snippet
SELECT CourseCode, MIN(StartTime) AS Earliest_Class 
FROM Class 
GROUP BY CourseCode;
Q9
🧠 Long Problem📘 CS403📑 Lec 30🏷️ 30.1. ORDER BY ClauseMedium🔁⭐💡📄🎓VU🏛️VU
Consider a database table named 'COMPANY' with the fields 'COMPANY_NAME' (VARCHAR), 'DESCRIPTION' (VARCHAR), and 'ORDER_NUMBER' (INT). Write a standard SQL query to display all company names in reverse alphabetical order, and explain the syntactical structure and execution order of the query clauses.
💻 sql Snippet
SELECT COMPANY_NAME FROM COMPANY ORDER BY COMPANY_NAME DESC;