Answer to Question #250465 in Databases | SQL | Oracle | MS Access for BossyGurl

Question #250465

PRACTICAL: Question 6 (Marks: 10)

Create a PL/SQL query to display the customer name and total amount spent by each customer. In your solution determine the customer rating. If the total amount spent is greater than or equal to R 1000, the customer receives a star rating, otherwise no star rating applies.

Sample Output

FIRST NAME: Patrick

SURNAME: Smith

AMOUNT: R 700

----------------------------------------------------

FIRST NAME: Steven

SURNAME: Hewson

AMOUNT: R 570

----------------------------------------------------

FIRST NAME: Barry

SURNAME: Goodwin

AMOUNT: R 2500 (***)

----------------------------------------------------


1
Expert's answer
2021-10-12T15:42:11-0400
create table customer(firstName varchar(40) not NULL, SIRNAME varchar(50) not null,AMOUNT int not null );
insert into customer values ('Patrick','Smith',700);
insert into customer values ('Steven','Hewson',570);
insert into customer values ('Barry','Goodwin',2500);


select firstname,amount from customer where amount>1000;

Output:


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS