Question
Create views to display for the following information. - For each sub question below, submit: o create view statements o Select from the view and
Create views to display for the following information.
- For each sub question below, submit:
o create view statements o Select from the view and print a screen of the results.
1.1. Create a view (view_CA_customer_credit) to display the customer name, the average credit limit for all the customer in California, add a column with credit limits under 20000 showing the text 'low', credit limits below 70000 showing as 'medium low', credit limits below 120000 as 'medium' and above that as 'high'; 1.2. Select from the view and print a screen of the results.
1.3. create a view (view_product_sales) to display each product name, and the total quantity sold, the total number of product, the customer ordered, and the total amount the customer paid please name this last column: 'your initias+total_amount_paid'. 1.4. Select from the view and print a screen of the results.
Part 2: Triggers
2.1 Create a trigger which automatic update the Product quantityInStock after an order being placed. Write a comment with you full name above the SQL statement
o Submit the create trigger statements
2.2 Test scenario to test if the trigger works:
o Submit the test scenario (such as the query results of the product table before and after an order)
Part 3. Constraints
3.1 List all the constraints on table Product (you should have PK defined) - Submit the following:
o All constraints
o The select constraints statement, Any add constraints statement
3.2 List all the constraints on order table (both PK and FKs should be defined) - Submit:
o All constraints
o The select constraints statement, Any add constraints statement
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