Challenge: Calculate Discounted Prices
Oppgave
Swipe to start coding
Write a query to calculate the discounted price for each product. The discounted price should be the original price minus the discount, rounded to two decimal places.
- Select the columns
product_id,name,price, anddiscountfrom theproductstable. - Calculate the discounted price as
price - discountfor each product. - Round the discounted price to two decimal places.
- Include the calculated value as a column named
discounted_pricein the result set. - Return one row for each product.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 2
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 2.86
Challenge: Calculate Discounted Prices
Sveip for å vise menyen
Oppgave
Swipe to start coding
Write a query to calculate the discounted price for each product. The discounted price should be the original price minus the discount, rounded to two decimal places.
- Select the columns
product_id,name,price, anddiscountfrom theproductstable. - Calculate the discounted price as
price - discountfor each product. - Round the discounted price to two decimal places.
- Include the calculated value as a column named
discounted_pricein the result set. - Return one row for each product.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 2
single