Smart Savings: Exclusive Smartwatch Discounts!:

Question:

Discover all smartwatches that are currently on sale with a discount. Display the 'product_id', 'product_name', 'brand', and 'discount' percentage for each smartwatch offer.

Sample Input Tables:

Products Table:

product_id product_name category brand price stock_quantity discount
8 Watch Series 6 Smartwatch Apple 399 50 5
15 Mi Band 5 Smartwatch Xiaomi 45 60 0
21 Galaxy Watch 3 Smartwatch Samsung 400 30 10

Sample Output:

product_id product_name brand discount
8 Watch Series 6 Apple 5
21 Galaxy Watch 3 Samsung 10

This output is just for illustrative purposes. The actual output could be different from the one you see above.

SELECT product_id, product_name, brand, discount
FROM Products
WHERE category = 'Smartwatch' AND discount > 0;

English:

  1. FROM: "Selecting the Data Source"
    • Initiates by pulling information from the Products table, targeting specifics about smartwatches.
  2. WHERE: "Applying Filters"
    • Emphasizes smartwatches in the 'Smartwatch' category that are marked with a discount, ensuring the focus is on items that offer savings.
  3. SELECT: "Choosing the Output"
    • Specifies 'product_id', 'product_name', 'brand', and 'discount' for display, reflecting precisely the details required for smartwatch deals.

Hinglish:

  1. FROM: "Selecting the Data Source"
    • Products table se jankari pull karna shuru karte hain, smartwatches ke bare me specifics target karke.
  2. WHERE: "Applying Filters"
    • 'Smartwatch' category mein aane wale smartwatches ko emphasize karte hain jo discount ke sath marked hain, savings offer karne wale items par dhyan dene ko sunishchit karte hain.
  3. SELECT: "Choosing the Output"
    • 'product_id', 'product_name', 'brand', aur 'discount' ko display ke liye specify karte hain, smartwatch deals ke liye zaroori details ko bilkul sahi dikhate hain.


  Submit Answer


GIF Image