PRACTICAL: Question 4 (Marks: 10)
Create a PL/SQL query to display the customer’s name and the pet that was purchased. In your solution only display the pet sale quantity greater than 1.
Sample Output
---------------------------------------------------
CUSTOMER NAME: Barry Goodwin
PET TYPE: Dog - Jack Russel
SALE QUANTITY 2
---------------------------------------------------
CUSTOMER NAME: Steven Hewson
PET TYPE: Bird - Budgie
SALE QUANTITY 3
---------------------------------------------------
create table sale(customerName varchar(40) not NULL, petType varchar(50) not null,saleQuantity int not null );
INSERT INTO public.sale(customername, pettype, salequantity)VALUES ('Barry Goodwin', 'Dog - Jack Russel', 2);
INSERT INTO public.sale(customername, pettype, salequantity)VALUES ('Steven Hewson', 'Bird - Budgie', 3);
select * from sale where salequantity>1;
Output:
Comments
Leave a comment