Skip to content

Instantly share code, notes, and snippets.

@benadaba
Created May 8, 2016 04:33
Show Gist options
  • Save benadaba/ec1adb611789a7afdb0a193526bf2db5 to your computer and use it in GitHub Desktop.
Save benadaba/ec1adb611789a7afdb0a193526bf2db5 to your computer and use it in GitHub Desktop.
Ex 5 Teradata Dillard.sql
/*(a) rows in the trsnact table that have “0” in their orgprice column (how could the
--original price be 0?), */
SELECT *
FROM TRNSACT
WHERE ORGPRICE = 0;
-- (b) rows in the skstinfo table where both the cost and retail price are listed as 0.00,
SELECT *
FROM SKSTINFO
WHERE COST =0.00 AND RETAIL = 0.00;
/* (c) rows in the skstinfo table where the cost is greater than the retail price (although
occasionally retailers will sell an item at a loss for strategic reasons, it is very
unlikely that a manufacturer would provide a suggested retail price that is lower
than the cost of the item).*/
SELECT *
FROM SKSTINFO
WHERE COST > RETAIL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment