Search Header Logo

M12 - SQL Query

Authored by ALI SUROJAYA

Geography

University

Used 3+ times

M12 - SQL Query
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

FILL IN THE BLANKS QUESTION

30 sec • 1 pt

To find the average salary for each department, you would use the following SQL query:

SELECT Department, AVG(Salary)
FROM Employees
GROUP BY (a)   ;

2.

FILL IN THE BLANKS QUESTION

30 sec • 1 pt

To get students who have a GPA greater than 3.5 and are majoring in 'Engineering', you would use the following SQL query:

SELECT *

FROM Students

WHERE GPA > 3.5 (a)   Major = 'Engineering';

3.

FILL IN THE BLANKS QUESTION

30 sec • 1 pt

To find the maximum order amount for each customer, you would use the following SQL query:
SELECT CustomerID, MAX(OrderAmount)

FROM Orders

GROUP BY (a)   ;

4.

FILL IN THE BLANKS QUESTION

30 sec • 1 pt

Retrieve employee names and their corresponding department names from the employees and departments tables:

SELECT employees.name, departments.department_name

FROM employees

(a)   departments

ON employees.department_id = departments.id;

5.

FILL IN THE BLANKS QUESTION

30 sec • 1 pt

Find the total number of hours worked by each employee from the timesheets table:

SELECT employee_id, (a)   (hours) AS total_hours_worked

FROM timesheets

GROUP BY employee_id;

6.

FILL IN THE BLANKS QUESTION

30 sec • 1 pt

Retrieve the name and highest score of students from the scores table:

SELECT name, (a)   (score) FROM scores;

7.

FILL IN THE BLANKS QUESTION

30 sec • 1 pt

List all employees and their respective managers' names from the employees table (assuming the table has a manager_id field):

SELECT e1.name AS employee_name, e2.name AS manager_name

FROM employees e1 (a)   employees e2 ON e1.manager_id = e2.id;

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?