Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 01 In this part you will learn how to create and use triggers: 1. Create a table called Customer_Archives that has the same columns

image text in transcribed

Part 01 In this part you will learn how to create and use triggers: 1. Create a table called Customer_Archives that has the same columns as customers table and it also has a column that is called "Deletion_Date" 2. Create a Trigger on table Customers so that every time a record is deleted from table customers this same record is inserted in table Customer_Archives with the current date as Deletion_Date 3. Now insert a new customer into table Customers and then delete it. Is the record inserted correctly into table Customers Archive? Part 02 In this part we will learn how to use functions: 1. Create a functions that has the Customer_id as input and returns a number that represents the total cost of orders for this customer. Notice that you will need to multiply the Order Qty from table order_details and the Unit Price from table items to get the total cost of each order. 2. Now use the function: Write a select statement that selects all the customers and the total cost of the orders they have ever made

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

Write short notes on departmentation.

Answered: 1 week ago

Question

What are the factors affecting organisation structure?

Answered: 1 week ago

Question

What are the features of Management?

Answered: 1 week ago

Question

Briefly explain the advantages of 'Management by Objectives'

Answered: 1 week ago