0
0
MySQLquery~10 mins

Querying from views in MySQL - 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'.

MySQL
SELECT * FROM [1];
Drag options to blanks, or click blank then click option'
Aemployee
Bemployees
Cemployee_view
Dview_employee
Attempts:
3 left
💡 Hint
Common Mistakes
Using the base table name instead of the view name.
Misspelling the view name.
2fill in blank
medium

Complete the code to select the 'name' column from the view 'department_view'.

MySQL
SELECT [1] FROM department_view;
Drag options to blanks, or click blank then click option'
A*
Bdepartment
Cdept_name
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting the whole view with '*' when only one column is needed.
Using a wrong column name.
3fill in blank
hard

Fix the error in the query to select all from the view 'sales_view'.

MySQL
SELECT * FROM [1];
Drag options to blanks, or click blank then click option'
Asales_view
Bsalesview
Csales view
Dsales-view
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces or dashes in the view name.
Omitting underscores.
4fill in blank
hard

Fill both blanks to select the 'employee_id' and 'salary' columns from the view 'payroll_view'.

MySQL
SELECT [1], [2] FROM payroll_view;
Drag options to blanks, or click blank then click option'
Aemployee_id
Bsalary
Cemp_id
Dwage
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or abbreviated column names.
Mixing column names from other tables.
5fill in blank
hard

Fill all three blanks to select 'product_name', 'price', and 'stock' columns from the view 'inventory_view'.

MySQL
SELECT [1], [2], [3] FROM inventory_view;
Drag options to blanks, or click blank then click option'
Aproduct_name
Bprice
Cstock
Dquantity
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong column names or synonyms.
Forgetting commas between column names.