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;
Ch 30: SQL JOIN Operations (Inner, Left, Right, Full)
In-depth multi-table querying in SQL, handling unmatched dangling tuples with NULL padding in outer joins, and joining a table to itself.
9 Questions9 MCQs0 Short Questions0 Long Questions
SEMESTER PASS
CS403 - Database Management Systems Examination Practice
Timed practice exam simulation for CS403 - Database Management Systems.
Showing 1 – 9 of 9 Questions
Page 1 of 1
Which of the following SQL clauses is used in combination with the GROUP BY clause to filter aggregate groups in a SELECT statement?
What does the SQL aggregate COUNT() function return when executed on a database table?
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?
Consider a table named COMPANY with fields COMPANY_NAME, DESCRIPTION, ORDER_NUMBER. Write an SQL statement to display company names in reverse alphabetical order.
Which SQL query correctly counts the total number of distinct courses taught in the 'Class' table under standard database guidelines?
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.
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.
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.