Question: Write a an SQL statement to create a table named Customer with the following fields. Customer_ID (99999) First_name (30) Last_ name( 40) Cust_Iocality (45) Order_total

Write a an SQL statement to create a table named Customer with the following fields.

Customer_ID (99999)

First_name (30)

Last_ name( 40)

Cust_Iocality (45)

Order_total (99999.99)

Choose the appropriate variable form and type for each column.

a) Write separate statements to insert five (5) records into the above table.

b) Write a statement to change the last_name and the customer_id of one of the records in the your table.

c) 'Write anotller statement to list the customer_id, first name and the last_name columns of cust-omers whose first name is JOHN and whose Order total is more than GHC5000.00 (Five thousand Ghana cedis).

d) Write a statement to give a discount of 2% of the Order total to all customers living at SANTASE.

e) Give another statement to remove from the table all customers with the last name POKUA

and living at AHODWO.

f) Write another SQL statement to list all fields for customers from ASOKWA, BOMSO and MANlIYIA whose Order total is less that GHC200.00 (Two hundred Ghana cedis) .

g) Give another statement to reverse all the changes you made after creating and populating the customer table .

. h) Write a statement to remove the Customer table from the database.

i) Finally write a statement to make all what you have done so far permanent.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!