Selaa lähdekoodia

Bestanden uploaden naar ''

master
vincent-janssens 2 vuotta sitten
vanhempi
commit
713f6b57ed
5 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  1. 2
    0
      Exercise_1.1.sql
  2. 2
    0
      Exercise_1.2.sql
  3. 1
    0
      Exercise_1.3.sql
  4. 3
    0
      Exercise_1.4.sql
  5. 3
    0
      Exercise_1.5.sql

+ 2
- 0
Exercise_1.1.sql Näytä tiedosto

@@ -0,0 +1,2 @@
SELECT product_code, product_name, list_price, discount_percent FROM products;
SELECT product_code, product_name, list_price, discount_percent FROM products ORDER BY list_price DESC;

+ 2
- 0
Exercise_1.2.sql Näytä tiedosto

@@ -0,0 +1,2 @@
SELECT CONCAT(last_name, ', ', first_name) AS full_name FROM customers
WHERE last_name REGEXP '^[M-Z]' ORDER BY last_name ASC;

+ 1
- 0
Exercise_1.3.sql Näytä tiedosto

@@ -0,0 +1 @@
SELECT product_name, list_price, date_added FROM products WHERE list_price > 500 and list_price < 2000 ORDER BY date_added DESC;

+ 3
- 0
Exercise_1.4.sql Näytä tiedosto

@@ -0,0 +1,3 @@
SELECT product_name, list_price, discount_percent, ROUND((list_price * discount_percent / 100),2) AS discount_amount ,
ROUND((list_price - (list_price * discount_percent/100)),2) AS discount_price
FROM products ORDER BY (list_price - (list_price*discount_percent/100)) DESC LIMIT 5;

+ 3
- 0
Exercise_1.5.sql Näytä tiedosto

@@ -0,0 +1,3 @@
SELECT item_id, item_price, discount_amount, quantity, (item_price*quantity) AS price_total, (discount_amount*quantity) AS discount_total, ((item_price - discount_amount)-quantity) AS item_total
FROM order_items WHERE ((item_price - discount_amount)-quantity) > 500
ORDER BY item_total DESC;

Loading…
Peruuta
Tallenna