Question: Problem 5 ( 1 5 points ) : Write an SQL query to create a trigger that ensures no employee spends more than 5 0
Problem points:
Write an SQL query to create a trigger that ensures no employee spends more than hours a week on a particular project.
Additionally, write an INSERT statement where you try to add more than hours a week for a particular project for an employee, and display the error message that you would receive.
Problem points:
Using the Store database, create a view that extracts all the information all attributes from the customers table about customers who live in NY state. The view should always include data regarding customers who live in NY If a user attempts to insert or update the state to anything other than NY the DBMS should throw an error. Dont use triggers for this question Additionally, write an insert statement for the view where you try to insert a new customer with a state other than NY and provide a screenshot of the error message you receive from this attempted insert.
Problem points:
Using the Store database, write a query that ensures that if a customer is deleted from the customers table, the corresponding orders associated with this customer are also deleted.
Modify the structure of the existing tables where needed; do not create new tables
Additionally, write an SQL query to delete the customer with customerID Then, display the customers and orders tables to show that the deletion was automatically propagated in both tables.
Problem points:
Using the Store database, write a query that displays the total number of customers registered in each month of the year and display the output in descending order based on the TotalRegisteredCustomers column.
Display the following columns: Month and TotalRegisteredCustomers.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
