Computer Science, asked by avsrikanth015, 2 months ago

Consider the table Product given below:

P_ID ProductName Manufacturer Price Discount
1001 Talcum Powder LAK 40
1005 Face Wash ABC 45 5
1007 Bath Soap ABC 55
1012 Shampoo XYZ 120 10
1022 Face Wash XYZ 95

Sumita has given the following command to obtain the highest price
SELECT MAXIMUM(Price) from Product;
But she is not the desired result. Help her by writing the correct command. 1
SELECT MAX(Price) from Product;
SELECT ProductName, MAX(Price) Product;
SELECT AVG(Price) from Product;
SELECT MIN(Price) Product;

State the command to display the average price of all the product from the manufacturer ABC.
SELECT ProductName, AVG(Price) FROM Product;
SELECT AVERAGE(Price) from Product WHERE manufacture = ‘ABC’;
SELECT AVG(Price) from Product WHERE manufacturer = ‘ABC’;
SELECT ProductName, AVG(Price) from Product ORDER BY MANUFACTURER;

Help Sumita to write the command to display the lowest price of the product.
SELECT ProductName, MIN(Price) from Product;
SELECT MAX(Price) from Product WHERE ProductName = ‘ABC’;
SELECT MIN(Price) from Product WHERE ProductName = ‘ABC’;
SELECT Minimum(Price) from Product;

To display the cardinality of the table staff.
SELECT SUM(P_ID) FROM STAFF;
SELECT COUNT(DISCOUNT) FROM STAFF;
SELECT SUM(DISCOUNT) FROM STAFF;
SELECT COUNT(*) FROM STAFF;

DO NOT GIVE ME SH** ANSWERS LIKE SO LONG OR I WILL REPORT YOUR ACCOUNT.

Answers

Answered by allysia
1

Answer:

Here you go scary human,

To obtain the highest price only she should use:

SELECT MAX(Price) from Product

To display the average price of all the product from the manufacturer ABC.

SELECT AVG(Price) from Product WHERE manufacturer = ‘ABC’;

To obtain the lowest price of ABC product name company only she should use

(I think none of them is the correct answer here since no product is named ABC here but a manufacturer is, but if I had to chose with like a gun pressed to my forehead I'll go with)

SELECT MIN(Price) from Product WHERE ProductName = ‘ABC',

And what is think should be correct option after a bit of correction of this option is:

SELECT MIN(Price) from Product;

(this will chose the lowest price of all the product regardless of who the manufacturer is but if you want it from a specific manufacturer just add WHERE manufacturer ="name_of_the_company")

To display the cardinality of the table staff.

SELECT COUNT(*) FROM STAFF

I didn't use SELECT COUNT(DISCOUNT) FROM STAFF c=because sometimes they keep discount = null :(

Answered by sourasghotekar123
0

Answer:

She should only use the following to get the best deal:

SELECT MAX(Price) from Product

to show the average cost of every item made by ABC's manufacturer.

SELECT AVG(Price) from Product WHERE manufacturer = ‘ABC’;

She should use the ABC product name company's website to get the lowest pricing

SELECT MIN(Price) from Product WHERE ProductName = ‘ABC',

SELECT MIN(Price) from Product;

(this will chose the lowest price of all the product regardless of who the manufacturer is but if you want it from a specific manufacturer just add WHERE manufacturer ="name_of_the_company")

To display the cardinality of the table staff.

SELECT COUNT(*) FROM STAFF

See more:

https://brainly.in/question/33135907

#SPJ2

Similar questions