0
0
SQLquery~10 mins

Querying through views in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select all columns from the view named 'employee_view'.

SQL
SELECT [1] FROM employee_view;
Drag options to blanks, or click blank then click option'
A*
BALL
Ccolumns
Deverything
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ALL' instead of '*'
Using 'columns' or 'everything' which are not valid SQL keywords
2fill in blank
medium

Complete the code to select only the 'name' column from the view 'employee_view'.

SQL
SELECT [1] FROM employee_view;
Drag options to blanks, or click blank then click option'
Aage
Bname
Csalary
Ddepartment
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting the wrong column like 'age' or 'salary'
Using '*' instead of a column name
3fill in blank
hard

Fix the error in the query to select employees with salary greater than 50000 from the view 'employee_view'.

SQL
SELECT * FROM employee_view WHERE salary [1] 50000;
Drag options to blanks, or click blank then click option'
A=
B<
C<=
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' which checks for equality
Using '<' or '<=' which check for less than
4fill in blank
hard

Fill both blanks to select 'name' and 'department' columns from 'employee_view' where department is 'Sales'.

SQL
SELECT [1], [2] FROM employee_view WHERE department = 'Sales';
Drag options to blanks, or click blank then click option'
Aname
Bsalary
Cdepartment
Dage
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting columns not related to the filter like 'salary' or 'age'
Mixing up the order of columns
5fill in blank
hard

Fill all three blanks to select 'name' and 'salary' from 'employee_view' where salary is greater than 60000.

SQL
SELECT [1], [2] FROM employee_view WHERE salary [3] 60000;
Drag options to blanks, or click blank then click option'
Aname
Bsalary
C>
Ddepartment
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong columns like 'department' instead of 'salary'
Using '=' or '<' instead of '>' in the WHERE clause