Question
INSTRUCTORS(instID, first_name, last_name, salary, course_code, department_id) Which SQL statement will display instructors who earn more than $2000 in each department but it only includes departments
INSTRUCTORS(instID, first_name, last_name, salary, course_code, department_id) Which SQL statement will display instructors who earn more than $2000 in each department but it only includes departments with average salary of $3500?
Select one:
a.SELECT first_name FROM instructors WHERE salary>2000 HAVING avg(salary) = 3500 GROUP BY department_id;
b.SELECT first_name FROM instructors WHERE avg(salary) = 3500 HAVING salary>2000 GROUP BY department_id;
c.SELECT first_name FROM instructors WHERE salary>2000 and avg(salary) = 3500 GROUP BY department_id;
d.SELECT first_name FROM instructors WHERE avg(salary)>2000 GROUP BY department_id;
INSTRUCTORS(instID, first_name, last_name, salary, course_code, department_id) Which SQL statement will display instructors who earn more than $2000 in each department but it only includes departments with average salary of $3500?
Select one:
a.SELECT first_name FROM instructors WHERE salary>2000 HAVING avg(salary) = 3500 GROUP BY department_id;
b.SELECT first_name FROM instructors WHERE avg(salary) = 3500 HAVING salary>2000 GROUP BY department_id;
c.SELECT first_name FROM instructors WHERE salary>2000 and avg(salary) = 3500 GROUP BY department_id;
d.SELECT first_name FROM instructors WHERE avg(salary)>2000 GROUP BY department_id;
STUDENTCOURSE(stdID, course_code, grade) Which SQL statement will find the summation of maximum grade in each course?
Select one:
a.SELECT max(sum(grade)) FROM studentcourse GROUP BY course_code;
b.SELECT sum(grade) FROM studentcourse GROUP BY course_code;
c.SELECT max(grade) FROM studentcourse GROUP BY course_code;
d.SELECT sum(max(grade)) FROM studentcourse GROUP BY course_code;
Employees(employee_id, first_name, last_name, salary, hire_date, job_title, manager_id) Which of the following queries will display the last name and job title of employees who get more than the average salary?
Select one:
a.SELECT last_name, job_title FROM employees WHERE salary > (SELECT avg(salary) FROM employees);
b.SELECT last_name, job_title FROM employees WHERE salary >(SELECT count(salary) FROM employees);
c.SELECT last_name, job_title FROM employees WHERE salary >(SELECT max(salary) FROM employees);
d.SELECT last_name, job_title FROM employees WHERE salary >(SELECT sum(salary) FROM employees);
Which of the following operators is used to compare value that its equal to one of the values returned by the subquery?
Select one:
a.All
b.Exists
c.IN
d.Any
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started