Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Calculate Discounted Prices | Numeric Functions
Functions in SQL

bookChallenge: Calculate Discounted Prices

Aufgabe

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, and discount from the products table.
  • Calculate the discounted price as price - discount for each product.
  • Round the discounted price to two decimal places.
  • Include the calculated value as a column named discounted_price in the result set.
  • Return one row for each product.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: Calculate Discounted Prices

Swipe um das Menü anzuzeigen

Aufgabe

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, and discount from the products table.
  • Calculate the discounted price as price - discount for each product.
  • Round the discounted price to two decimal places.
  • Include the calculated value as a column named discounted_price in the result set.
  • Return one row for each product.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

some-alt