MEDIUM

Getting Started
How can I access the schemas, tables, and data used in the practice problems? Use livesql.oracle.com. All schemas and tables utilized in the current practice problem sets are readily available without the headache of software installation. Simply create an account and let the SQL mastering begin! For a subset of the problems, a script is required to be executed to create and subsequently populate the table referenced within the problem. Simply copy and paste the corresponding script provided in the Tables Requiring Script Execution section of the SQL PRACTICE PROBLEMS page.

Schema and Table Information
Information on the schemas, corresponding tables, and data used in the example problems can be found within the SQL PRACTICE PROBLEMS page. I recommend opening another browser window with this page pulled up for quick reference.

Problem 1
For each department/warehouse location, retrieve the location ID, street address, postal code, city, state/province, and country name. Ensure your result set represents all locations even if the country ID for the location does not match an existing country ID in the countries table.

Table(s) Required

hr.locations
hr.countries

Expected Output
LOCATION_IDSTREET_ADDRESSPOSTAL_CODECITYSTATE_PROVINCECOUNTRY_NAME
10001297 Via Cola di Rie00989RomaItaly
110093091 Calle della Testa10934VeniceItaly
12002017 Shinjuku-ku1689TokyoTokyo PrefectureJapan
13009450 Kamiya-cho6823HiroshimaJapan
14002014 Jabberwocky Rd26192SouthlakeTexasUnited States of America
15002011 Interiors Blvd99236South San FranciscoCaliforniaUnited States of America
16002007 Zagora St50090South BrunswickNew JerseyUnited States of America
17002004 Charade Rd98199SeattleWashingtonUnited States of America
1800147 Spadina AveM5V 2L7TorontoOntarioCanada
19006092 Boxwood StYSW 9T2WhitehorseYukonCanada
200040-5-12 Laogianggen190518BeijingChina
21001298 Vileparle (E)490231BombayMaharashtraIndia
220012-98 Victoria Street2901SydneyNew South WalesAustralia
2300198 Clementi North540198SingaporeSingapore
24008204 Arthur StLondonUnited Kingdom
2500Magdalen Centre, The Oxford Science ParkOX9 9ZBOxfordOxfordUnited Kingdom
26009702 Chester Road09629850293StretfordManchesterUnited Kingdom
2700Schwanthalerstr. 703180925MunichBavariaGermany
2800Rua Frei Caneca 1360 01307-002Sao PauloSao PauloBrazil
290020 Rue des Corps-Saints1730GenevaGeneveSwitzerland
3000Murtenstrasse 9213095BernBESwitzerland
3100Pieter Breughelstraat 8373029SKUtrechtUtrechtNetherlands
3200Mariano Escobedo 999111932Mexico CityDistrito Federal,Mexico
Solution
SELECT
    hr.locations.location_id,
    hr.locations.street_address,
    hr.locations.postal_code,
    hr.locations.city,
    hr.locations.state_province,
    hr.countries.country_name
FROM
    hr.locations
    LEFT JOIN
    hr.countries
    	ON hr.locations.country_id = hr.countries.country_id;

Problem 2
For each country ID, retrieve the location IDs, street addresses, postal codes, cities, states/provinces, and country names for department(s)/warehouse(s) that are tied to the respective country ID. Include country name data even if a department/warehouse is not currently located in the country.

Table(s) Required

hr.locations
hr.countries

Expected Output
LOCATION_IDSTREET_ADDRESSPOSTAL_CODECITYSTATE_PROVINCECOUNTRY_NAME
10001297 Via Cola di Rie00989RomaItaly
110093091 Calle della Testa10934VeniceItaly
12002017 Shinjuku-ku1689TokyoTokyo PrefectureJapan
13009450 Kamiya-cho6823HiroshimaJapan
14002014 Jabberwocky Rd26192SouthlakeTexasUnited States of America
15002011 Interiors Blvd99236South San FranciscoCaliforniaUnited States of America
16002007 Zagora St50090South BrunswickNew JerseyUnited States of America
17002004 Charade Rd98199SeattleWashingtonUnited States of America
1800147 Spadina AveM5V 2L7TorontoOntarioCanada
19006092 Boxwood StYSW 9T2WhitehorseYukonCanada
200040-5-12 Laogianggen190518BeijingChina
21001298 Vileparle (E)490231BombayMaharashtraIndia
220012-98 Victoria Street2901SydneyNew South WalesAustralia
2300198 Clementi North540198SingaporeSingapore
24008204 Arthur StLondonUnited Kingdom
2500Magdalen Centre, The Oxford Science ParkOX9 9ZBOxfordOxfordUnited Kingdom
26009702 Chester Road09629850293StretfordManchesterUnited Kingdom
2700Schwanthalerstr. 703180925MunichBavariaGermany
2800Rua Frei Caneca 1360 01307-002Sao PauloSao PauloBrazil
290020 Rue des Corps-Saints1730GenevaGeneveSwitzerland
3000Murtenstrasse 9213095BernBESwitzerland
3100Pieter Breughelstraat 8373029SKUtrechtUtrechtNetherlands
3200Mariano Escobedo 999111932Mexico CityDistrito Federal,Mexico
Zambia
Argentina
Nigeria
Egypt
Malaysia
Denmark
France
Israel
Zimbabwe
Kuwait
Belgium
Solution
SELECT
    hr.locations.location_id,
    hr.locations.street_address,
    hr.locations.postal_code,
    hr.locations.city,
    hr.locations.state_province,
    hr.countries.country_name
FROM
    hr.locations
    RIGHT JOIN
    hr.countries
    	ON hr.locations.country_id = hr.countries.country_id;

Problem 3
For each department, retrieve the department ID, department name, first name and last name of the manager heading the department, and the manager’s email address. In addition, include the street address, city, state/province, and country name for which the department is located. Sort/order the result set by department ID, ascending.

Table(s) Required

hr.departments
hr.employees
hr.locations
hr.countries

Expected Output
DEPARTMENT_IDDEPARTMENT_NAMEMANAGER_IDLOCATION_IDEMPLOYEE_IDFIRST_NAMELAST_NAMEEMAILSTREET_ADDRESSCITYSTATE_PROVINCECOUNTRY_IDCOUNTRY_NAME
10Administration2001700200JenniferWhalenJWHALEN2004 Charade RdSeattleWashingtonUSUnited States of America
20Marketing2011800201MichaelHartsteinMHARTSTE147 Spadina AveTorontoOntarioCACanada
30Purchasing1141700114DenRaphaelyDRAPHEAL2004 Charade RdSeattleWashingtonUSUnited States of America
40Human Resources2032400203SusanMavrisSMAVRIS8204 Arthur StLondonUKUnited Kingdom
50Shipping1211500121AdamFrippAFRIPP2011 Interiors BlvdSouth San FranciscoCaliforniaUSUnited States of America
60IT1031400103AlexanderHunoldAHUNOLD2014 Jabberwocky RdSouthlakeTexasUSUnited States of America
70Public Relations2042700204HermannBaerHBAERSchwanthalerstr. 7031MunichBavariaDEGermany
80Sales1452500145JohnRussellJRUSSELMagdalen Centre, The Oxford Science ParkOxfordOxfordUKUnited Kingdom
90Executive1001700100StevenKingSKING2004 Charade RdSeattleWashingtonUSUnited States of America
100Finance1081700108NancyGreenbergNGREENBE2004 Charade RdSeattleWashingtonUSUnited States of America
110Accounting2051700205ShelleyHigginsSHIGGINS2004 Charade RdSeattleWashingtonUSUnited States of America
Solution
SELECT
    hr.departments.department_id,
    hr.departments.department_name,
    hr.departments.manager_id,
    hr.departments.location_id,
    hr.employees.employee_id,
    hr.employees.first_name,
    hr.employees.last_name,
    hr.employees.email,
    hr.locations.street_address,
    hr.locations.city,
    hr.locations.state_province,
    hr.locations.country_id,
    hr.countries.country_name
FROM
    hr.departments
	INNER JOIN
    hr.employees
    	ON hr.departments.manager_id = hr.employees.employee_id
	INNER JOIN
    hr.locations
	    ON hr.departments.location_id = hr.locations.location_id
	INNER JOIN
    hr.countries
        ON hr.locations.country_id = hr.countries.country_id
ORDER BY
    hr.departments.department_id;

Problem 4
Retrieve the customer ID, customer first name, customer last name, order ID, order date, and order total for all orders. Only include customers that have made an order. Sort the result set by customer ID (ascending) and order date (ascending).

Table(s) Required

oe.customers
oe.orders

Expected Output
CUSTOMER_IDCUST_FIRST_NAMECUST_LAST_NAMEORDER_IDORDER_DATEORDER_TOTAL
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.6
101ConstantinWelles243002-OCT-07 06.18.36.663332 AM29669.9
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM48552
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.6
102HarrisonPacino243114-SEP-06 07.03.04.763452 AM5610.6
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.6
102HarrisonPacino243214-SEP-07 09.53.40.223345 AM10523
102HarrisonPacino239719-NOV-07 02.41.54.696211 PM42283.2
103ManishaTaylor241529-MAR-06 01.34.50.545196 PM310
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM13550
103ManishaTaylor243313-SEP-07 10.19.00.654279 AM78
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.4
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.5
104HarrisonSutherland241629-MAR-07 04.41.20.945676 PM384
104HarrisonSutherland243801-SEP-07 09.53.26.934626 AM5451
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM46257
105MatthiasMacGraw241720-MAR-07 05.49.10.974352 PM1926.6
105MatthiasMacGraw243931-AUG-07 10.19.37.811132 AM22150.1
105MatthiasMacGraw235808-JAN-08 05.03.12.654278 PM7826
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.8
106MatthiasHannah241820-MAR-04 04.18.21.862632 PM5546.6
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.1
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.6
106MatthiasHannah244101-AUG-08 11.22.48.734526 AM2075.2
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.9
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM31574
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.9
107MatthiasCruise236014-NOV-07 12.22.31.223344 PM990.4
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.4
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM3646
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM29750
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.3
109ChristianCage242112-MAR-07 09.53.54.562432 PM72836
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.2
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.4
109ChristianCage239410-FEB-08 09.22.35.564789 PM21863
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.4
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.8
116GeraldineMartin245304-OCT-07 09.53.34.362632 PM129
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.8
117GuillaumeEdwards245607-NOV-06 07.53.25.989889 PM3878.4
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.3
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM50125
117GuillaumeEdwards237027-JUN-08 12.22.11.647398 AM126
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.6
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.2
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.2
120DianeHiggins237327-FEB-08 01.34.51.220065 AM416
121DianneSen237427-FEB-08 02.41.45.109654 AM4797
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.4
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.2
141MaximilianHenner237707-JUN-07 07.03.01.001100 AM38017.8
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.3
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.6
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.8
144SivajiLandis243502-SEP-07 11.22.53.134567 PM62303
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.3
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.5
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173
145MammuttiPacino244818-JUN-07 04.41.49.262632 PM1388
145MammuttiPacino236428-AUG-07 06.18.45.942399 PM9500
145MammuttiPacino245520-SEP-07 11.34.11.456789 AM14087.5
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.7
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.7
146EliaFawcett237916-MAY-07 02.22.24.234567 AM17848.2
146EliaFawcett244913-JUN-07 05.49.07.162632 PM86
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.3
146EliaFawcett242421-NOV-07 10.22.33.263332 AM13824
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.1
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM34930
147IshwaryaRoberts242516-NOV-06 11.34.22.162552 PM1500.8
147IshwaryaRoberts245011-APR-07 06.18.10.362632 PM1636
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.4
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM295892
148GustavSteenburgen242617-NOV-06 12.22.11.262552 AM7200
148GustavSteenburgen240629-JUN-07 04.41.20.098765 AM2854.2
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.9
148GustavSteenburgen245117-DEC-07 05.03.52.562632 PM10474.6
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.8
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.9
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.8
149MarkusRampling245206-OCT-07 08.59.43.462632 PM12589
149MarkusRampling242710-NOV-07 01.34.22.362124 AM9055
149MarkusRampling236826-JUN-08 10.19.43.190089 PM60065
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.3
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM17620
152DieterMatthau239018-NOV-07 04.18.50.546851 PM7616.8
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.6
154FredericGrodin239221-JUL-07 08.59.57.571057 PM26632
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.9
156GoldieMontand239502-FEB-06 08.19.11.227550 PM68501
157SidneyCapshaw239819-NOV-07 09.22.53.224175 PM7110.3
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.3
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.4
160EddieStern240110-JUL-07 02.22.53.554822 AM969.2
161ErnestWeaver240202-JUL-07 03.34.44.665170 AM600
162ErnestGeorge240301-JUL-07 04.49.13.615512 PM220
163ErnestChandar240401-JUL-07 04.49.13.664085 PM510
164CharlotteKazan240501-JUL-07 04.49.13.678123 PM1233
165CharlotteFonda240729-JUN-07 07.03.21.526005 AM2519
166DheerajAlexander240829-JUN-07 08.59.31.333617 AM309
167GerardHershey240929-JUN-07 09.53.41.984501 AM48
168HemaVoight241024-MAY-08 10.19.51.985501 AM45175
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.5
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM66816
Solution
SELECT
	oe.customers.customer_id,
	oe.customers.cust_first_name,
	oe.customers.cust_last_name,
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total
FROM
	oe.customers
	INNER JOIN
	oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
ORDER BY
	oe.customers.customer_id,
	oe.orders.order_date;

Problem 5
Retrieve the customer ID, customer first name, customer last name for customers that have not made an order. Sort the result set by customer ID, ascending. Use a join in conjunction with a WHERE clause to achieve this. Do not use a subquery.

Table(s) Required

oe.customers
oe.orders

Expected Output
CUSTOMER_IDCUST_FIRST_NAMECUST_LAST_NAME
110CharlieSutherland
111CharliePacino
112GuillaumeJackson
113DanielCostner
114DianneDerek
115GeraldineSchneider
124DianeMason
125DianneAndrews
126CharlesField
127CharlesBroderick
128IsabellaReed
129LouisJackson
130LouisEdwards
131DorisDutt
132DorisSpacek
133KristinMalden
134SissyPuri
135DorisBel Geddes
136SissyWarden
137EliaBrando
138ManiFonda
139PlacidoKubrick
140ClaudiaKurosawa
171HemaPowell
172Harry MeanPeckinpah
173KathleenWalken
174BlakeSeignier
175ClaudePowell
176FayeGlenn
177GerhardSeignier
178GraceBelushi
179Harry deanForrest
180Harry deanCage
181LaurenHershey
182LaurenDench
183LaurenAltman
184Mary BethRoberts
185MatthewWright
186MeenaAlexander
187GraceDvrrie
188CharlotteBuckley
189GenaHarris
190GenaCurtis
191MaureenSanders
192SeanStockwell
193Harry deanKinski
194KathleenGarcia
195SeanOlin
196GerardDench
197GerardAltman
198Maureende Funes
199ClintChapman
200ClintGielgud
201EricPrashant
202IngridWelles
203IngridRampling
204CliffPuri
205EmilyPollack
206FritzHackman
207CybillLaughton
208CyndiGriem
209CyndiCollins
210CybillClapton
211LuchinoJordan
212LuchinoFalk
213LuchinoBradford
214RobinDanson
215OrsonPerkins
216OrsonKoirala
217BryanHuston
218BryanDvrrie
219AjaySen
220CarolJordan
221CarolBradford
222CaryStockwell
223CaryOlin
224ClaraKrige
225ClaraGanesan
226AjayAndrews
227KathyPrashant
228GrahamNeeson
229IanChapman
230DannyWright
231DannyRourke
232DonaldHunter
233GrahamSpielberg
234DanRoberts
235EdwardOates
236EdwardJulius
237FarrahQuinlan
238FarrahLange
239HalStockwell
240MalcolmKanth
241MalcolmBroderick
242MaryLemmon
243MaryCollins
244MattGueney
245Maxvon Sydow
246MaxSchell
247CyndaWhitcraft
248DonaldMinnelli
249HannahBroderick
250DanWilliams
251RaulWilder
252Shah RukhField
253SallyBogart
254BruceBates
255BrookeShepherd
256Bende Niro
257EmmetWalken
258EllenPalin
259Denholmvon Sydow
260EllenKhan
261EmmetGarcia
262FredReynolds
263FredLithgow
264GeorgeAdjani
265IreneLaughton
266PremCardinale
267PremWalken
268KyleSchneider
269KyleMartin
270MegDerek
271ShelleyPeckinpah
272PremGarcia
273BoHitchcock
274BobMcCarthy
275DomMcQueen
276DomHoskins
277DonSiegel
278GvtzBradford
279HollyKurosawa
280RobMacLaine
281DonBarkin
282KurtDanson
283KurtHeard
308GlendaDunaway
309GlendaBates
323GoetzFalk
326HalOlin
327HannahKanth
328HannahField
333MargretPowell
334Harry MeanTaylor
335MargritGarner
337MariaWarden
339MarilouLandis
341KeirGeorge
342MarlonLaughton
343KeirChandar
344MarlonGodard
345KeirWeaver
346MarlonClapton
347KellyQuinlan
348KellyLange
349KenGlenn
350KenChopra
351KenWenders
352KennethRedford
360HelmutCapshaw
361MarilouChapman
363KathyLambert
378MegSen
380MerylHolden
447RichardCoppola
448RichardWinters
449RickRomero
450RickLyon
451RidleyHackman
452RidleyCoyote
453RidleyYoung
454RobRussell
458Robertde Niro
463RobinAdjani
466RodolfoHershey
467RodolfoDench
468RodolfoAltman
470RogerMastroianni
473RolfAshby
474RomySharif
475RomyMcCarthy
476RosanneHopkins
477RosanneDouglas
478RosanneBaldwin
479RoxanneShepherd
480RoxanneMichalkow
481RoyHulce
482RoyDunaway
483RoyBates
487RufusDvrrie
488RufusBelushi
492SallyEdwards
496ScottJordan
605ShammiPacino
606SharmilaKazan
607SharmilaFonda
609ShelleyTaylor
615ShyamPlummer
621SilkKurosawa
627SivajiGielgud
712M. EmmetStockwell
713M. EmmetOlin
715MalcolmField
717MammuttiSutherland
719ManiKazan
721ManiBuckley
727MargaretUstinov
729MargauxKrige
731MargauxCapshaw
754KevinGoodman
755KevinCleveland
756KevinWilder
757KieferReynolds
766KlausYoung
767Klaus MariaRussell
768Klaus MariaMacLaine
769KrisHarris
770KrisCurtis
771Krisde Niro
772KristinSavage
782LaurenceSeignier
825AlainDreyfuss
826AlainBarkin
827AlainSiegel
828AlanMinnelli
829AlanHunter
830AlbertDutt
831AlbertBel Geddes
832AlbertSpacek
833AlecMoranis
834AlecIdle
835AlexanderEastwood
836AlexanderBerenger
837AlexanderStanton
838AlfredNicholson
839AlfredJohnson
840AliElliott
841AliBoyer
842AliStern
843AliceOates
844AliceJulius
845AllyFawcett
846AllyBrando
847AllyStreep
848AlonsoOlmos
849AlonsoKaurusmdki
850AmandaFinney
851AmandaBrown
852AmandaTanner
853AmrishPalin
905BillyHershey
906BillyDench
909BlakeMastroianni
911BoDickinson
912BoAshby
913BobSharif
916BrianDouglas
917BrianBaldwin
919BrookeMichalkow
920BruceHulce
921BruceDunaway
923BrunoSlater
924BrunoMontand
927BryanBelushi
928BurtSpielberg
929BurtNeeson
930BusterJackson
931BusterEdwards
932BusterBogart
934C. ThomasNolte
980DanielLoren
981DanielGueney
Solution
SELECT
	oe.customers.customer_id,
	oe.customers.cust_first_name,
	oe.customers.cust_last_name
FROM
	oe.customers 
	LEFT JOIN
	oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
WHERE
	oe.orders.order_id IS NULL
ORDER BY
	oe.customers.customer_id;

Problem 6
For each order, retrieve the order ID, order date, and line-item IDs associated with the order ID. In addition, for each of the line-items associated with an order ID, include the unit price, quantity, and the sale amount (unit price * quantity) for the line item. Provide the derived sale amount column with an alias of “sale_amount.” Sort the result set by order date (ascending), order ID (ascending), and line-item ID (ascending).

Table(s) Required

oe.orders
oe.order_items

Expected Output
ORDER_IDORDER_DATELINE_ITEM_IDUNIT_PRICEQUANTITYSALE_AMOUNT
241820-MAR-04 04.18.21.862632 PM175151125
241820-MAR-04 04.18.21.862632 PM2187122244
241820-MAR-04 04.18.21.862632 PM32.21328.6
241820-MAR-04 04.18.21.862632 PM44520900
241820-MAR-04 04.18.21.862632 PM52031620
241820-MAR-04 04.18.21.862632 PM61737629
235708-JAN-06 08.19.44.123456 PM13.3140462
235708-JAN-06 08.19.44.123456 PM24622612012
235708-JAN-06 08.19.44.123456 PM3788.72620506.2
235708-JAN-06 08.19.44.123456 PM4371.82910782.2
235708-JAN-06 08.19.44.123456 PM595292755
235708-JAN-06 08.19.44.123456 PM675322400
235708-JAN-06 08.19.44.123456 PM7236.5388987
235708-JAN-06 08.19.44.123456 PM848411968
235908-JAN-06 09.34.13.112233 PM1270.61270.6
235908-JAN-06 09.34.13.112233 PM22491249
235908-JAN-06 09.34.13.112233 PM391171547
235908-JAN-06 09.34.13.112233 PM4617102
235908-JAN-06 09.34.13.112233 PM596171632
235908-JAN-06 09.34.13.112233 PM65.51793.5
235908-JAN-06 09.34.13.112233 PM797171649
235526-JAN-06 09.22.51.962632 AM1462009200
235526-JAN-06 09.22.51.962632 AM25718510545
235526-JAN-06 09.22.51.962632 AM386.918816337.2
235526-JAN-06 09.22.51.962632 AM4191883572
235526-JAN-06 09.22.51.962632 AM5171903230
235526-JAN-06 09.22.51.962632 AM61.1192211.2
235526-JAN-06 09.22.51.962632 AM71.1197216.7
235526-JAN-06 09.22.51.962632 AM8251994975
235526-JAN-06 09.22.51.962632 AM9226.620446226.4
239602-FEB-06 01.34.56.345678 AM1441506600
239602-FEB-06 01.34.56.345678 AM276755700
239602-FEB-06 01.34.56.345678 AM344793476
239602-FEB-06 01.34.56.345678 AM4100838300
239602-FEB-06 01.34.56.345678 AM519931767
239602-FEB-06 01.34.56.345678 AM617931581
239602-FEB-06 01.34.56.345678 AM747984606
239602-FEB-06 01.34.56.345678 AM8291002900
239502-FEB-06 08.19.11.227550 PM13.3110363
239502-FEB-06 08.19.11.227550 PM2332.2278969.4
239502-FEB-06 08.19.11.227550 PM3788.73023661
239502-FEB-06 08.19.11.227550 PM4690.83423487.2
239502-FEB-06 08.19.11.227550 PM5199.1346769.4
239502-FEB-06 08.19.11.227550 PM671372627
239502-FEB-06 08.19.11.227550 PM764412624
239127-FEB-06 05.03.03.828330 PM11015505
239127-FEB-06 05.03.03.828330 PM2262.93788.7
239127-FEB-06 05.03.03.828330 PM334872436
239127-FEB-06 05.03.03.828330 PM4961.4109614
239127-FEB-06 05.03.03.828330 PM55515825
239127-FEB-06 05.03.03.828330 PM65218936
239127-FEB-06 05.03.03.828330 PM71433.32332965.9
241229-MAR-06 10.22.09.509801 AM1461707820
241229-MAR-06 10.22.09.509801 AM298686664
241229-MAR-06 10.22.09.509801 AM371.5684862
241229-MAR-06 10.22.09.509801 AM44927235424
241229-MAR-06 10.22.09.509801 AM518751350
241229-MAR-06 10.22.09.509801 AM620791580
241229-MAR-06 10.22.09.509801 AM716801280
241229-MAR-06 10.22.09.509801 AM830922760
241229-MAR-06 10.22.09.509801 AM954945076
241529-MAR-06 01.34.50.545196 PM1625310
244227-JUL-06 12.22.59.662632 PM1127263302
244227-JUL-06 12.22.59.662632 PM2350.9217368.9
244227-JUL-06 12.22.59.662632 PM360231380
244227-JUL-06 12.22.59.662632 PM4144253600
244227-JUL-06 12.22.59.662632 PM5173284844
244227-JUL-06 12.22.59.662632 PM6115.5303465
244227-JUL-06 12.22.59.662632 PM7624.84024992
244227-JUL-06 12.22.59.662632 PM880443520
244327-JUL-06 01.34.16.562632 PM1443132
244327-JUL-06 01.34.16.562632 PM21012202
244327-JUL-06 01.34.16.562632 PM3826492
244327-JUL-06 01.34.16.562632 PM42012240
244327-JUL-06 01.34.16.562632 PM51517255
244327-JUL-06 01.34.16.562632 PM61817306
244327-JUL-06 01.34.16.562632 PM74321903
244327-JUL-06 01.34.16.562632 PM836311116
244527-JUL-06 03.34.38.362632 PM1665330
244527-JUL-06 03.34.38.362632 PM2493147
244527-JUL-06 03.34.38.362632 PM397111067
244527-JUL-06 03.34.38.362632 PM472141008
244527-JUL-06 03.34.38.362632 PM595242280
244527-JUL-06 03.34.38.362632 PM62527675
244527-JUL-06 03.34.38.362632 PM71.12830.8
243701-SEP-06 08.59.15.826132 AM1838664
243701-SEP-06 08.59.15.826132 AM2157.34629.2
243701-SEP-06 08.59.15.826132 AM34.41774.8
243701-SEP-06 08.59.15.826132 AM476191444
243701-SEP-06 08.59.15.826132 AM564211344
243701-SEP-06 08.59.15.826132 AM6268.4359394
243114-SEP-06 07.03.04.763452 AM12.236.6
243114-SEP-06 07.03.04.763452 AM248148
243114-SEP-06 07.03.04.763452 AM31013303
243114-SEP-06 07.03.04.763452 AM4417287
243114-SEP-06 07.03.04.763452 AM549894482
243114-SEP-06 07.03.04.763452 AM64411484
245607-NOV-06 07.53.25.989889 PM1405200
245607-NOV-06 07.53.25.989889 PM2193.6193678.4
242516-NOV-06 11.34.22.162552 PM1492.831478.4
242516-NOV-06 11.34.22.162552 PM29218
242516-NOV-06 11.34.22.162552 PM31.144.4
242617-NOV-06 12.22.11.262552 AM12.2613.2
242617-NOV-06 12.22.11.262552 AM23011330
242617-NOV-06 12.22.11.262552 AM33418612
242617-NOV-06 12.22.11.262552 AM4212.3265519.8
242617-NOV-06 12.22.11.262552 AM52529725
237526-FEB-07 03.49.50.459233 AM1421405880
237526-FEB-07 03.49.50.459233 AM271845964
237526-FEB-07 03.49.50.459233 AM338853230
237526-FEB-07 03.49.50.459233 AM4488.48642002.4
237526-FEB-07 03.49.50.459233 AM545883960
237526-FEB-07 03.49.50.459233 AM617901530
237526-FEB-07 03.49.50.459233 AM715931395
237526-FEB-07 03.49.50.459233 AM817931581
237526-FEB-07 03.49.50.459233 AM945984410
237526-FEB-07 03.49.50.459233 AM1030992970
237526-FEB-07 03.49.50.459233 AM11361033708
237526-FEB-07 03.49.50.459233 AM1213210714124
237526-FEB-07 03.49.50.459233 AM1312010913080
237227-FEB-07 12.22.33.356789 AM1486288
237227-FEB-07 12.22.33.356789 AM2742148
237227-FEB-07 12.22.33.356789 AM3427294
237227-FEB-07 12.22.33.356789 AM48110810
237227-FEB-07 12.22.33.356789 AM5496136448
237227-FEB-07 12.22.33.356789 AM61717289
237227-FEB-07 12.22.33.356789 AM71521315
237227-FEB-07 12.22.33.356789 AM83030900
237227-FEB-07 12.22.33.356789 AM954321728
237227-FEB-07 12.22.33.356789 AM10145.2365227.2
238711-MAR-07 03.34.56.536966 PM13.352171.6
238711-MAR-07 03.34.56.536966 PM2332.2206644
238711-MAR-07 03.34.56.536966 PM34622210164
238711-MAR-07 03.34.56.536966 PM4788.72721294.9
238711-MAR-07 03.34.56.536966 PM5354.23211334.4
238711-MAR-07 03.34.56.536966 PM675423150
242112-MAR-07 09.53.54.562432 PM1461607360
242112-MAR-07 09.53.54.562432 PM27816012480
242112-MAR-07 09.53.54.562432 PM37216411808
242112-MAR-07 09.53.54.562432 PM4411656765
242112-MAR-07 09.53.54.562432 PM58016813440
242112-MAR-07 09.53.54.562432 PM6431727396
242112-MAR-07 09.53.54.562432 PM7151762640
242112-MAR-07 09.53.54.562432 PM8171762992
242112-MAR-07 09.53.54.562432 PM9431857955
242013-MAR-07 08.59.43.666320 PM1461105060
242013-MAR-07 08.59.43.666320 PM24611506
242013-MAR-07 08.59.43.666320 PM3101151515
242013-MAR-07 08.59.43.666320 PM479201580
242013-MAR-07 08.59.43.666320 PM54962210912
242013-MAR-07 08.59.43.666320 PM648291392
242013-MAR-07 08.59.43.666320 PM71934646
242013-MAR-07 08.59.43.666320 PM81539585
242013-MAR-07 08.59.43.666320 PM930451350
242013-MAR-07 08.59.43.666320 PM10132476204
241720-MAR-07 05.49.10.974352 PM14.4939.6
241720-MAR-07 05.49.10.974352 PM251371887
241920-MAR-07 07.03.32.764632 PM1461506900
241920-MAR-07 07.03.32.764632 PM299454455
241920-MAR-07 07.03.32.764632 PM371.5483432
241920-MAR-07 07.03.32.764632 PM443572451
241920-MAR-07 07.03.32.764632 PM545612745
241920-MAR-07 07.03.32.764632 PM617691173
241920-MAR-07 07.03.32.764632 PM747723384
241920-MAR-07 07.03.32.764632 PM835762660
241920-MAR-07 07.03.32.764632 PM954814374
241429-MAR-07 02.22.40.536996 PM11.188.8
241429-MAR-07 02.22.40.536996 PM2307210
241429-MAR-07 02.22.40.536996 PM3419369
241429-MAR-07 02.22.40.536996 PM43911429
241429-MAR-07 02.22.40.536996 PM5212.3183821.4
241429-MAR-07 02.22.40.536996 PM6206.8234756.4
241429-MAR-07 02.22.40.536996 PM750241200
241629-MAR-07 04.41.20.945676 PM14.41044
241629-MAR-07 04.41.20.945676 PM23401340
245011-APR-07 06.18.10.362632 PM11.144.4
245011-APR-07 06.18.10.362632 PM22.236.6
245011-APR-07 06.18.10.362632 PM3445220
245011-APR-07 06.18.10.362632 PM42911319
245011-APR-07 06.18.10.362632 PM54114574
245011-APR-07 06.18.10.362632 PM63216512
237116-MAY-07 01.34.56.113356 AM11576942
237116-MAY-07 01.34.56.113356 AM2968768
237116-MAY-07 01.34.56.113356 AM373151095
237116-MAY-07 01.34.56.113356 AM42121441
237116-MAY-07 01.34.56.113356 AM51724408
237116-MAY-07 01.34.56.113356 AM63.32685.8
237116-MAY-07 01.34.56.113356 AM72529725
237116-MAY-07 01.34.56.113356 AM82341.93274940.8
237916-MAY-07 02.22.24.234567 AM142923864
237916-MAY-07 02.22.24.234567 AM298141372
237916-MAY-07 02.22.24.234567 AM3488.42311233.2
237916-MAY-07 02.22.24.234567 AM42134714
237916-MAY-07 02.22.24.234567 AM51935665
238016-MAY-07 09.53.02.909090 AM142261092
238016-MAY-07 09.53.02.909090 AM275181350
238016-MAY-07 09.53.02.909090 AM33823874
238016-MAY-07 09.53.02.909090 AM4488.42411721.6
238016-MAY-07 09.53.02.909090 AM546281288
238016-MAY-07 09.53.02.909090 AM62030600
238016-MAY-07 09.53.02.909090 AM71531465
238016-MAY-07 09.53.02.909090 AM81733561
238016-MAY-07 09.53.02.909090 AM945331485
238016-MAY-07 09.53.02.909090 AM1032361152
238016-MAY-07 09.53.02.909090 AM1152371924
238016-MAY-07 09.53.02.909090 AM12113.3404532
238016-MAY-07 09.53.02.909090 AM132.24088
237824-MAY-07 08.59.10.010101 AM1113.3202266
237824-MAY-07 08.59.10.010101 AM2952190
237824-MAY-07 08.59.10.010101 AM3438.973072.3
237824-MAY-07 08.59.10.010101 AM42711297
237824-MAY-07 08.59.10.010101 AM57911869
237824-MAY-07 08.59.10.010101 AM6217.8153267
237824-MAY-07 08.59.10.010101 AM74.425110
237824-MAY-07 08.59.10.010101 AM8624.82515620
241124-MAY-07 11.22.10.548639 AM1812162
241124-MAY-07 11.22.10.548639 AM22082416
241124-MAY-07 11.22.10.548639 AM32.2613.2
241124-MAY-07 11.22.10.548639 AM43.3723.1
241124-MAY-07 11.22.10.548639 AM5738584
241124-MAY-07 11.22.10.548639 AM64511495
241124-MAY-07 11.22.10.548639 AM772171224
241124-MAY-07 11.22.10.548639 AM875171275
241124-MAY-07 11.22.10.548639 AM984171428
241124-MAY-07 11.22.10.548639 AM10488.4188791.2
241124-MAY-07 11.22.10.548639 AM114323989
241124-MAY-07 11.22.10.548639 AM121524360
238804-JUN-07 04.41.12.554435 PM1431506450
238804-JUN-07 04.41.12.554435 PM294908460
238804-JUN-07 04.41.12.554435 PM356965376
238804-JUN-07 04.41.12.554435 PM41.1105115.5
238804-JUN-07 04.41.12.554435 PM52341.9112262292.8
237607-JUN-07 06.18.08.883310 AM16014840
237607-JUN-07 06.18.08.883310 AM2236.54946
237607-JUN-07 06.18.08.883310 AM399131287
237607-JUN-07 06.18.08.883310 AM473171241
237607-JUN-07 06.18.08.883310 AM5133.1212795.1
237607-JUN-07 06.18.08.883310 AM695252375
237607-JUN-07 06.18.08.883310 AM72127567
237607-JUN-07 06.18.08.883310 AM82532800
237607-JUN-07 06.18.08.883310 AM91.13336.3
237607-JUN-07 06.18.08.883310 AM103.336118.8
237707-JUN-07 07.03.01.001100 AM1421305460
237707-JUN-07 07.03.01.001100 AM214711917493
237707-JUN-07 07.03.01.001100 AM39512111495
237707-JUN-07 07.03.01.001100 AM4251313275
237707-JUN-07 07.03.01.001100 AM51.1132145.2
237707-JUN-07 07.03.01.001100 AM61.1136149.6
244913-JUN-07 05.49.07.162632 PM143286
244818-JUN-07 04.41.49.262632 PM1443132
244818-JUN-07 04.41.49.262632 PM29900
244818-JUN-07 04.41.49.262632 PM34211462
244818-JUN-07 04.41.49.262632 PM41714238
244818-JUN-07 04.41.49.262632 PM52015300
244818-JUN-07 04.41.49.262632 PM61616256
236926-JUN-07 11.22.54.009932 PM118354
236926-JUN-07 11.22.54.009932 PM243143
236926-JUN-07 11.22.54.009932 PM3325160
236926-JUN-07 11.22.54.009932 PM43410340
236926-JUN-07 11.22.54.009932 PM5145.2243484.8
236926-JUN-07 11.22.54.009932 PM6113.3242719.2
236926-JUN-07 11.22.54.009932 PM72.22452.8
236926-JUN-07 11.22.54.009932 PM82.22861.6
236926-JUN-07 11.22.54.009932 PM9123344182
240629-JUN-07 04.41.20.098765 AM1855425
240629-JUN-07 04.41.20.098765 AM23.3413.2
240629-JUN-07 04.41.20.098765 AM32619494
240629-JUN-07 04.41.20.098765 AM462311922
240729-JUN-07 07.03.21.526005 AM1855425
240729-JUN-07 07.03.21.526005 AM286181548
240729-JUN-07 07.03.21.526005 AM32621546
240829-JUN-07 08.59.31.333617 AM1613183
240829-JUN-07 08.59.31.333617 AM226126
240829-JUN-07 08.59.31.333617 AM31010100
240929-JUN-07 09.53.41.984501 AM16848
240301-JUL-07 04.49.13.615512 PM1445220
240401-JUL-07 04.49.13.664085 PM1856510
240401-JUL-07 04.49.13.664085 PM20370
240501-JUL-07 04.49.13.678123 PM113791233
240202-JUL-07 03.34.44.665170 AM1758600
240010-JUL-07 01.34.29.559387 AM1524208
240010-JUL-07 01.34.29.559387 AM241141
240010-JUL-07 01.34.29.559387 AM31234492
240010-JUL-07 01.34.29.559387 AM48801614080
240010-JUL-07 01.34.29.559387 AM52866.61954465.4
240110-JUL-07 02.22.53.554822 AM1414164
240110-JUL-07 02.22.53.554822 AM2268.43805.2
239221-JUL-07 08.59.57.571057 PM143632709
239221-JUL-07 08.59.57.571057 PM273574161
239221-JUL-07 08.59.57.571057 PM338582204
239221-JUL-07 08.59.57.571057 PM477634851
239221-JUL-07 08.59.57.571057 PM545662970
239221-JUL-07 08.59.57.571057 PM621681428
239221-JUL-07 08.59.57.571057 PM718721296
239221-JUL-07 08.59.57.571057 PM849773773
239221-JUL-07 08.59.57.571057 PM940813240
244627-JUL-07 07.03.08.302945 AM148472256
244627-JUL-07 07.03.08.302945 AM21.13437.4
244627-JUL-07 07.03.08.302945 AM31.13639.6
244627-JUL-07 07.03.08.302945 AM4270.63710012.2
244627-JUL-07 07.03.08.302945 AM52341.93991334.1
244427-JUL-07 02.22.27.462632 PM1361103960
244427-JUL-07 02.22.27.462632 PM2488.48842979.2
244427-JUL-07 02.22.27.462632 PM343903870
244427-JUL-07 02.22.27.462632 PM421931953
244427-JUL-07 02.22.27.462632 PM519951805
244427-JUL-07 02.22.27.462632 PM615971455
244427-JUL-07 02.22.27.462632 PM7171001700
244427-JUL-07 02.22.27.462632 PM8431044472
244427-JUL-07 02.22.27.462632 PM9371124144
244427-JUL-07 02.22.27.462632 PM10371124144
244427-JUL-07 02.22.27.462632 PM11631157245
245816-AUG-07 03.34.12.234359 PM1381405320
245816-AUG-07 03.34.12.234359 PM2791128848
245816-AUG-07 03.34.12.234359 PM3488.411455677.6
245816-AUG-07 03.34.12.234359 PM4171151955
245816-AUG-07 03.34.12.234359 PM5151291935
245816-AUG-07 03.34.12.234359 PM6321424544
236428-AUG-07 06.18.45.942399 PM114684
236428-AUG-07 06.18.45.942399 PM2470.8209416
236528-AUG-07 07.03.34.003399 PM148924416
236528-AUG-07 07.03.34.003399 PM299282772
236528-AUG-07 07.03.34.003399 PM3133.1293859.9
236528-AUG-07 07.03.34.003399 PM456291624
236528-AUG-07 07.03.34.003399 PM595292755
236528-AUG-07 07.03.34.003399 PM62234748
236528-AUG-07 07.03.34.003399 PM72438912
236528-AUG-07 07.03.34.003399 PM81943817
236528-AUG-07 07.03.34.003399 PM91.14448.4
236528-AUG-07 07.03.34.003399 PM1097454365
236528-AUG-07 07.03.34.003399 PM1125501250
236528-AUG-07 07.03.34.003399 PM1272543888
236628-AUG-07 08.59.23.144778 PM1226.681812.8
236628-AUG-07 08.59.23.144778 PM26742
236628-AUG-07 08.59.23.144778 PM3804.1108041
236628-AUG-07 08.59.23.144778 PM4116.6111282.6
236628-AUG-07 08.59.23.144778 PM5120121440
236628-AUG-07 08.59.23.144778 PM6418166688
236628-AUG-07 08.59.23.144778 PM7195.8203916
236628-AUG-07 08.59.23.144778 PM8194.7224283.4
236628-AUG-07 08.59.23.144778 PM9339.9248157.6
236628-AUG-07 08.59.23.144778 PM1069241656
243931-AUG-07 10.19.37.811132 AM1316.892851.2
243931-AUG-07 10.19.37.811132 AM2454180
243931-AUG-07 10.19.37.811132 AM3549486
243931-AUG-07 10.19.37.811132 AM41433.31318632.9
244031-AUG-07 09.53.06.008765 PM14819912
244031-AUG-07 09.53.06.008765 PM2982196
244031-AUG-07 09.53.06.008765 PM31502300
244031-AUG-07 09.53.06.008765 PM486.97608.3
244031-AUG-07 09.53.06.008765 PM52310230
244031-AUG-07 09.53.06.008765 PM61.11314.3
244031-AUG-07 09.53.06.008765 PM73.31549.5
244031-AUG-07 09.53.06.008765 PM8270.6195141.4
244031-AUG-07 09.53.06.008765 PM92523575
244031-AUG-07 09.53.06.008765 PM102341.92456205.6
244031-AUG-07 09.53.06.008765 PM11226.6286344.8
243801-SEP-07 09.53.26.934626 AM1693207
243801-SEP-07 09.53.26.934626 AM2174835244
243602-SEP-07 06.18.04.378034 AM11.188.8
243602-SEP-07 06.18.04.378034 AM213226
243602-SEP-07 06.18.04.378034 AM330390
243602-SEP-07 06.18.04.378034 AM4326192
243602-SEP-07 06.18.04.378034 AM5214.5163432
243602-SEP-07 06.18.04.378034 AM62718486
243602-SEP-07 06.18.04.378034 AM73618648
243602-SEP-07 06.18.04.378034 AM863241512
243502-SEP-07 11.22.53.134567 PM148351680
243502-SEP-07 11.22.53.134567 PM2754300
243502-SEP-07 11.22.53.134567 PM386.98695.2
243502-SEP-07 11.22.53.134567 PM42110210
243502-SEP-07 11.22.53.134567 PM51812216
243502-SEP-07 11.22.53.134567 PM63.31446.2
243502-SEP-07 11.22.53.134567 PM72519475
243502-SEP-07 11.22.53.134567 PM82341.92456205.6
243502-SEP-07 11.22.53.134567 PM975332475
243413-SEP-07 05.49.30.647893 AM13.381267.3
243413-SEP-07 05.49.30.647893 AM2949.38479741.2
243413-SEP-07 05.49.30.647893 AM34628639732
243413-SEP-07 05.49.30.647893 AM4788.78768616.9
243413-SEP-07 05.49.30.647893 AM5408.19237545.2
243413-SEP-07 05.49.30.647893 AM6371.89434949.2
243413-SEP-07 05.49.30.647893 AM7751047800
243313-SEP-07 10.19.00.654279 AM113678
243214-SEP-07 09.53.40.223345 AM1493147
243214-SEP-07 09.53.40.223345 AM243286
243214-SEP-07 09.53.40.223345 AM31225610
243214-SEP-07 09.53.40.223345 AM4880119680
245520-SEP-07 11.34.11.456789 AM1482.931448.7
245520-SEP-07 11.34.11.456789 AM2268.4328588.8
245520-SEP-07 11.34.11.456789 AM375544050
243002-OCT-07 06.18.36.663332 AM169364158
243002-OCT-07 06.18.36.663332 AM2454.352271.5
243002-OCT-07 06.18.36.663332 AM3111101110
243002-OCT-07 06.18.36.663332 AM49410940
243002-OCT-07 06.18.36.663332 AM5492.84321190.4
245402-OCT-07 05.49.34.678340 PM1431205160
245402-OCT-07 05.49.34.678340 PM29900
245402-OCT-07 05.49.34.678340 PM3713213
245402-OCT-07 05.49.34.678340 PM45512660
245402-OCT-07 05.49.34.678340 PM52113273
245402-OCT-07 05.49.34.678340 PM61816288
245402-OCT-07 05.49.34.678340 PM73.31859.4
245304-OCT-07 09.53.34.362632 PM1433129
245206-OCT-07 08.59.43.462632 PM1381405320
245206-OCT-07 08.59.43.462632 PM22010200
245206-OCT-07 08.59.43.462632 PM31512180
245206-OCT-07 08.59.43.462632 PM41713221
245206-OCT-07 08.59.43.462632 PM54413572
245206-OCT-07 08.59.43.462632 PM63418612
245206-OCT-07 08.59.43.462632 PM7145.2202904
245206-OCT-07 08.59.43.462632 PM83720740
245206-OCT-07 08.59.43.462632 PM980231840
236323-OCT-07 05.49.56.346122 PM1199.191791.9
236323-OCT-07 05.49.56.346122 PM21297903
236323-OCT-07 05.49.56.346122 PM374251850
236323-OCT-07 05.49.56.346122 PM457261482
236323-OCT-07 05.49.56.346122 PM586.9292520.1
236323-OCT-07 05.49.56.346122 PM62431744
236323-OCT-07 05.49.56.346122 PM71834612
236323-OCT-07 05.49.56.346122 PM81.13740.7
236323-OCT-07 05.49.56.346122 PM93.342138.6
245731-OCT-07 11.22.16.162632 PM172362592
245731-OCT-07 11.22.16.162632 PM279141106
245731-OCT-07 11.22.16.162632 PM3488.4178302.8
245731-OCT-07 11.22.16.162632 PM41727459
245731-OCT-07 11.22.16.162632 PM544321408
245731-OCT-07 11.22.16.162632 PM6145.2426098.4
245731-OCT-07 11.22.16.162632 PM736451620
242710-NOV-07 01.34.22.362124 AM1173122076
242710-NOV-07 01.34.22.362124 AM21211121
242710-NOV-07 01.34.22.362124 AM34.4626.4
242710-NOV-07 01.34.22.362124 AM4666396
242710-NOV-07 01.34.22.362124 AM5766456
242710-NOV-07 01.34.22.362124 AM6268.4195099.6
242710-NOV-07 01.34.22.362124 AM74022880
242810-NOV-07 02.41.34.463567 AM1427294
242810-NOV-07 02.41.34.463567 AM276176
242810-NOV-07 02.41.34.463567 AM31015505
242810-NOV-07 02.41.34.463567 AM4416246
242810-NOV-07 02.41.34.463567 AM5808640
242810-NOV-07 02.41.34.463567 AM6498125976
242810-NOV-07 02.41.34.463567 AM74812576
242810-NOV-07 02.41.34.463567 AM81613208
242810-NOV-07 02.41.34.463567 AM91716272
242810-NOV-07 02.41.34.463567 AM10145.2243484.8
242810-NOV-07 02.41.34.463567 AM1186282408
242910-NOV-07 03.49.25.526321 AM1422008400
242910-NOV-07 03.49.25.526321 AM276403040
242910-NOV-07 03.49.25.526321 AM345431935
242910-NOV-07 03.49.25.526321 AM479463634
242910-NOV-07 03.49.25.526321 AM54974924353
242910-NOV-07 03.49.25.526321 AM646522392
242910-NOV-07 03.49.25.526321 AM721541134
242910-NOV-07 03.49.25.526321 AM81755935
242910-NOV-07 03.49.25.526321 AM930631890
242910-NOV-07 03.49.25.526321 AM1036672412
236113-NOV-07 01.34.21.986210 PM1461808280
236113-NOV-07 01.34.21.986210 PM27618013680
236113-NOV-07 01.34.21.986210 PM3531829646
236113-NOV-07 01.34.21.986210 PM486.918516076.5
236113-NOV-07 01.34.21.986210 PM5221874114
236113-NOV-07 01.34.21.986210 PM61.1194213.4
236113-NOV-07 01.34.21.986210 PM73.3198653.4
236113-NOV-07 01.34.21.986210 PM824820851584
236113-NOV-07 01.34.21.986210 PM97620915884
236213-NOV-07 02.41.10.619477 PM1482009600
236213-NOV-07 02.41.10.619477 PM27616012160
236213-NOV-07 02.41.10.619477 PM39316415252
236213-NOV-07 02.41.10.619477 PM4221683696
236213-NOV-07 02.41.10.619477 PM51.1173190.3
236213-NOV-07 02.41.10.619477 PM63.3177584.1
236213-NOV-07 02.41.10.619477 PM7251794475
236213-NOV-07 02.41.10.619477 PM824818946872
236014-NOV-07 12.22.31.223344 PM12329667
236014-NOV-07 12.22.31.223344 PM27.742323.4
239018-NOV-07 04.18.50.546851 PM114456
239018-NOV-07 04.18.50.546851 PM214228
239018-NOV-07 04.18.50.546851 PM3470.8167532.8
239719-NOV-07 02.41.54.696211 PM1522104
239719-NOV-07 02.41.54.696211 PM21208960
239719-NOV-07 02.41.54.696211 PM38801614080
239719-NOV-07 02.41.54.696211 PM41696.21627139.2
239819-NOV-07 09.22.53.224175 PM1482.952414.5
239819-NOV-07 09.22.53.224175 PM2193.6234452.8
239819-NOV-07 09.22.53.224175 PM3927243
239919-NOV-07 10.22.38.340990 PM1441205280
239919-NOV-07 10.22.38.340990 PM294121128
239919-NOV-07 10.22.38.340990 PM376151140
239919-NOV-07 10.22.38.340990 PM4149172533
239919-NOV-07 10.22.38.340990 PM55617952
239919-NOV-07 10.22.38.340990 PM686.9201738
239919-NOV-07 10.22.38.340990 PM72224528
239919-NOV-07 10.22.38.340990 PM81.12729.7
239919-NOV-07 10.22.38.340990 PM91.12830.8
239919-NOV-07 10.22.38.340990 PM10100333300
239919-NOV-07 10.22.38.340990 PM11226.6388610.8
242421-NOV-07 10.22.33.263332 AM1693117623
242421-NOV-07 10.22.33.263332 AM254194869
242421-NOV-07 10.22.33.263332 AM3111121332
242321-NOV-07 10.22.33.362632 AM1398312
242321-NOV-07 10.22.33.362632 AM232396
242321-NOV-07 10.22.33.362632 AM3214.5132788.5
242321-NOV-07 10.22.33.362632 AM4212.3142972.2
242321-NOV-07 10.22.33.362632 AM52616416
242321-NOV-07 10.22.33.362632 AM678211638
242321-NOV-07 10.22.33.362632 AM765332145
238606-DEC-07 12.22.34.225609 PM11.177.7
238606-DEC-07 12.22.34.225609 PM23.3516.5
238606-DEC-07 12.22.34.225609 PM37114994
238606-DEC-07 12.22.34.225609 PM477272079
238606-DEC-07 12.22.34.225609 PM590282520
238606-DEC-07 12.22.34.225609 PM673322336
238606-DEC-07 12.22.34.225609 PM7271.7338966.1
238606-DEC-07 12.22.34.225609 PM8116.6364197.6
238508-DEC-07 11.34.11.331392 AM1432008600
238508-DEC-07 11.34.11.331392 AM2133.18711579.7
238508-DEC-07 11.34.11.331392 AM386.9968342.4
238508-DEC-07 11.34.11.331392 AM425972425
238508-DEC-07 11.34.11.331392 AM591.31069677.8
238508-DEC-07 11.34.11.331392 AM62341.9109255267.1
242216-DEC-07 08.19.55.462332 PM14618828
242216-DEC-07 08.19.55.462332 PM2415205
242216-DEC-07 08.19.55.462332 PM371.55357.5
242216-DEC-07 08.19.55.462332 PM449694464
242216-DEC-07 08.19.55.462332 PM54611506
242216-DEC-07 08.19.55.462332 PM61725425
242216-DEC-07 08.19.55.462332 PM743291247
242216-DEC-07 08.19.55.462332 PM830351050
242216-DEC-07 08.19.55.462332 PM954392106
245117-DEC-07 05.03.52.562632 PM1139117
245117-DEC-07 05.03.52.562632 PM2470.82210357.6
235808-JAN-08 05.03.12.654278 PM1226.692039.4
235808-JAN-08 05.03.12.654278 PM21254500
235808-JAN-08 05.03.12.654278 PM3316.8123801.6
235808-JAN-08 05.03.12.654278 PM45513715
235808-JAN-08 05.03.12.654278 PM55514770
235626-JAN-08 09.22.41.934562 AM1199.1387565.8
235626-JAN-08 09.22.41.934562 AM2148.5345049
235626-JAN-08 09.22.41.934562 AM398403920
235626-JAN-08 09.22.41.934562 AM472443168
235626-JAN-08 09.22.41.934562 AM558472726
235626-JAN-08 09.22.41.934562 AM695514845
235626-JAN-08 09.22.41.934562 AM722551210
235626-JAN-08 09.22.41.934562 AM81855990
239310-FEB-08 07.53.19.528202 PM11210120
239310-FEB-08 07.53.19.528202 PM22952590
239310-FEB-08 07.53.19.528202 PM3101755085
239310-FEB-08 07.53.19.528202 PM438583080
239310-FEB-08 07.53.19.528202 PM5260.782085.6
239310-FEB-08 07.53.19.528202 PM67810780
239310-FEB-08 07.53.19.528202 PM7211132743
239310-FEB-08 07.53.19.528202 PM8108.9141524.6
239310-FEB-08 07.53.19.528202 PM9278195282
239310-FEB-08 07.53.19.528202 PM103.31962.7
239310-FEB-08 07.53.19.528202 PM1169.3302079
239410-FEB-08 09.22.35.564789 PM141903690
239410-FEB-08 09.22.35.564789 PM277362772
239410-FEB-08 09.22.35.564789 PM382393198
239410-FEB-08 09.22.35.564789 PM446411886
239410-FEB-08 09.22.35.564789 PM546452070
239410-FEB-08 09.22.35.564789 PM61845810
239410-FEB-08 09.22.35.564789 PM71948912
239410-FEB-08 09.22.35.564789 PM849612989
239410-FEB-08 09.22.35.564789 PM952683536
237327-FEB-08 01.34.51.220065 AM1498392
237327-FEB-08 01.34.51.220065 AM224124
237427-FEB-08 02.41.45.109654 AM1150101500
237427-FEB-08 02.41.45.109654 AM2786468
237427-FEB-08 02.41.45.109654 AM378151170
237427-FEB-08 02.41.45.109654 AM479211659
241329-MAR-08 01.34.04.525934 PM17720015400
241329-MAR-08 01.34.04.525934 PM275403000
241329-MAR-08 01.34.04.525934 PM335441540
241329-MAR-08 01.34.04.525934 PM44924421648
241329-MAR-08 01.34.04.525934 PM546452070
241329-MAR-08 01.34.04.525934 PM647622914
241329-MAR-08 01.34.04.525934 PM730661980
238312-MAY-08 11.22.30.545103 AM1194.7377203.9
238312-MAY-08 11.22.30.545103 AM256452520
238312-MAY-08 11.22.30.545103 AM3146466716
238312-MAY-08 11.22.30.545103 AM4174508700
238312-MAY-08 11.22.30.545103 AM5115.5546237
238312-MAY-08 11.22.30.545103 AM64.462272.8
238312-MAY-08 11.22.30.545103 AM775634725
238412-MAY-08 12.22.34.525972 PM143954085
238412-MAY-08 12.22.34.525972 PM271483408
238412-MAY-08 12.22.34.525972 PM321581218
238412-MAY-08 12.22.34.525972 PM422591298
238412-MAY-08 12.22.34.525972 PM51.16167.1
238412-MAY-08 12.22.34.525972 PM62497719173
238214-MAY-08 10.19.03.828321 AM1421606720
238214-MAY-08 10.19.03.828321 AM243642752
238214-MAY-08 10.19.03.828321 AM3100656500
238214-MAY-08 10.19.03.828321 AM435662310
238214-MAY-08 10.19.03.828321 AM579715609
238214-MAY-08 10.19.03.828321 AM64967135216
238214-MAY-08 10.19.03.828321 AM742763192
238214-MAY-08 10.19.03.828321 AM821791659
238214-MAY-08 10.19.03.828321 AM915821230
238214-MAY-08 10.19.03.828321 AM1029892581
238214-MAY-08 10.19.03.828321 AM1137923404
238114-MAY-08 08.59.08.843679 PM1381104180
238114-MAY-08 08.59.08.843679 PM277443388
238114-MAY-08 08.59.08.843679 PM344441936
238114-MAY-08 08.59.08.843679 PM42045900
238114-MAY-08 08.59.08.843679 PM51548720
238114-MAY-08 08.59.08.843679 PM635551925
238114-MAY-08 08.59.08.843679 PM7113.3627024.6
238114-MAY-08 08.59.08.843679 PM847632961
241024-MAY-08 10.19.51.985501 AM14610460
241024-MAY-08 10.19.51.985501 AM2405200
241024-MAY-08 10.19.51.985501 AM31206720
241024-MAY-08 10.19.51.985501 AM4688544
241024-MAY-08 10.19.51.985501 AM52866.61542999
241024-MAY-08 10.19.51.985501 AM61221252
238904-JUN-08 05.49.43.546954 PM1431807740
238904-JUN-08 05.49.43.546954 PM273181314
238904-JUN-08 05.49.43.546954 PM380211680
238904-JUN-08 05.49.43.546954 PM446221012
238904-JUN-08 05.49.43.546954 PM51530450
238904-JUN-08 05.49.43.546954 PM646331518
238904-JUN-08 05.49.43.546954 PM734431462
238904-JUN-08 05.49.43.546954 PM852472444
236826-JUN-08 10.19.43.190089 PM1481507200
236826-JUN-08 10.19.43.190089 PM242602520
236826-JUN-08 10.19.43.190089 PM338622356
236826-JUN-08 10.19.43.190089 PM481705670
236826-JUN-08 10.19.43.190089 PM54967034720
236826-JUN-08 10.19.43.190089 PM642723024
236826-JUN-08 10.19.43.190089 PM716751200
236826-JUN-08 10.19.43.190089 PM845753375
237027-JUN-08 12.22.11.647398 AM1149126
236727-JUN-08 09.53.32.335522 PM148994752
236727-JUN-08 09.53.32.335522 PM2147324704
236727-JUN-08 09.53.32.335522 PM354392106
236727-JUN-08 09.53.32.335522 PM42245990
236727-JUN-08 09.53.32.335522 PM51.14852.8
236727-JUN-08 09.53.32.335522 PM61.15257.2
236727-JUN-08 09.53.32.335522 PM791.3544930.2
236727-JUN-08 09.53.32.335522 PM82341.954126462.6
235414-JUL-08 06.18.23.234567 PM148612928
235414-JUL-08 06.18.23.234567 PM296.8434162.4
235414-JUL-08 06.18.23.234567 PM379473713
235414-JUL-08 06.18.23.234567 PM441471927
235414-JUL-08 06.18.23.234567 PM521481008
235414-JUL-08 06.18.23.234567 PM61653848
235414-JUL-08 06.18.23.234567 PM71758986
235414-JUL-08 06.18.23.234567 PM830611830
235414-JUL-08 06.18.23.234567 PM937642368
235414-JUL-08 06.18.23.234567 PM1051683468
235414-JUL-08 06.18.23.234567 PM11145.27010164
235414-JUL-08 06.18.23.234567 PM12113.3728157.6
235414-JUL-08 06.18.23.234567 PM1361774697
244727-JUL-08 08.59.10.223344 AM1199.1295773.9
244727-JUL-08 08.59.10.223344 AM2297236831
244727-JUL-08 08.59.10.223344 AM3121242904
244727-JUL-08 08.59.10.223344 AM450251250
244727-JUL-08 08.59.10.223344 AM597343298
244727-JUL-08 08.59.10.223344 AM676352660
244727-JUL-08 08.59.10.223344 AM7133.1374924.7
244727-JUL-08 08.59.10.223344 AM854402160
244727-JUL-08 08.59.10.223344 AM993444092
244101-AUG-08 11.22.48.734526 AM1809720
244101-AUG-08 11.22.48.734526 AM2193.671355.2
Solution
SELECT
	oe.orders.order_id,
	oe.orders.order_date,
	oe.order_items.line_item_id,
	oe.order_items.unit_price,
	oe.order_items.quantity,
	oe.order_items.unit_price * oe.order_items.quantity AS sale_amount
FROM
	oe.orders
	INNER JOIN
	oe.order_items
		ON oe.orders.order_id = oe.order_items.order_id
ORDER BY
	oe.orders.order_date,
	oe.orders.order_id,
	oe.order_items.line_item_id;

Problem 7
Build onto your solution for problem 6. For each order, retrieve the order ID, order date, and line-item IDs associated with the order ID. In addition, for each of the line-items associated with an order ID, include the product ID, product name, product description, unit price, quantity, and the sale amount (unit price * quantity) for the line item. Only include those records with a category ID of 19. Provide the derived sale amount column with an alias of “sale_amount.” Sort the result set by order date (ascending), order ID (ascending), and line-item ID (ascending).

Table(s) Required

oe.orders
oe.order_items
oe.product_information

Expected Output
ORDER_IDORDER_DATELINE_ITEM_IDPRODUCT_IDPRODUCT_NAMEPRODUCT_DESCRIPTIONUNIT_PRICEQUANTITYSALE_AMOUNT
241820-MAR-04 04.18.21.862632 PM33097Cable Connector – 32RCable Connector – 32 pin ribbon2.21328.6
241820-MAR-04 04.18.21.862632 PM53140Screws <Z.16.S>Screws: Zinc, length 16mm, straight. Carton box, contents 750.2031620
235908-JAN-06 09.34.13.112233 PM32370PS 220V /HS/FR220V hot swappable power supply, for France.91171547
235908-JAN-06 09.34.13.112233 PM42373Cable RS232 10/AF10 ft RS232 cable with F/F and 9F/25F adapters617102
235908-JAN-06 09.34.13.112233 PM52377PS 110V HS/US110 V hot swappable power supply – US compatible96171632
235908-JAN-06 09.34.13.112233 PM62380Cable PR/15/P15 foot parallel printer cable5.51793.5
235526-JAN-06 09.22.51.962632 AM32311PS 220V /LPower supply for laptop computers, 220V86.918816337.2
235526-JAN-06 09.22.51.962632 AM42322Screws <Z.28.P>Screws: Zinc, size 28 mm, Phillips head. Carton box, contents 850.191883572
235526-JAN-06 09.22.51.962632 AM52323Screws <B.32.P>Screws: Brass, size 32mm, Phillips head. Plastic box, contents 400.171903230
239602-FEB-06 01.34.56.345678 AM53140Screws <Z.16.S>Screws: Zinc, length 16mm, straight. Carton box, contents 750.19931767
241229-MAR-06 10.22.09.509801 AM33123PS 220V /DStandard power supply, 220V, for desktop computers.71.5684862
241229-MAR-06 10.22.09.509801 AM53134Screws <B.32.S>Screws: Brass, size 32mm, straight. Plastic box, contents 400.18751350
241229-MAR-06 10.22.09.509801 AM63139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.20791580
241229-MAR-06 10.22.09.509801 AM73143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.16801280
244227-JUL-06 12.22.59.662632 PM32418Battery Backup (DA-130)Single-battery charger with LED indicators60231380
244327-JUL-06 01.34.16.562632 PM33124PS 110V /TPower supply for tower PC, 110V826492
244327-JUL-06 01.34.16.562632 PM43139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.2012240
244327-JUL-06 01.34.16.562632 PM53143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1517255
244527-JUL-06 03.34.38.362632 PM22278Battery – NiHMRechargeable NiHM battery for laptop computers493147
244527-JUL-06 03.34.38.362632 PM42299PS 12V /PPower Supply – 12v portable72141008
244527-JUL-06 03.34.38.362632 PM52311PS 220V /LPower supply for laptop computers, 220V95242280
244527-JUL-06 03.34.38.362632 PM62319Screws <Z.24.S>Screws: Zinc, size 24mm, straight. Carton box, contents 500.2527675
243701-SEP-06 08.59.15.826132 AM32457Cable PR/S/6Standard RS232 serial printer cable, 6 feet4.41774.8
243114-SEP-06 07.03.04.763452 AM13097Cable Connector – 32RCable Connector – 32 pin ribbon2.236.6
245607-NOV-06 07.53.25.989889 PM12522Battery – ELExtended life battery, for laptop computers405200
237526-FEB-07 03.49.50.459233 AM63134Screws <B.32.S>Screws: Brass, size 32mm, straight. Plastic box, contents 400.17901530
237526-FEB-07 03.49.50.459233 AM73143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.15931395
237227-FEB-07 12.22.33.356789 AM43123PS 220V /DStandard power supply, 220V, for desktop computers.8110810
237227-FEB-07 12.22.33.356789 AM63134Screws <B.32.S>Screws: Brass, size 32mm, straight. Plastic box, contents 400.1717289
237227-FEB-07 12.22.33.356789 AM73143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1521315
242112-MAR-07 09.53.54.562432 PM53123PS 220V /DStandard power supply, 220V, for desktop computers.8016813440
242112-MAR-07 09.53.54.562432 PM73143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.151762640
242013-MAR-07 08.59.43.666320 PM43123PS 220V /DStandard power supply, 220V, for desktop computers.79201580
242013-MAR-07 08.59.43.666320 PM73140Screws <Z.16.S>Screws: Zinc, length 16mm, straight. Carton box, contents 750.1934646
242013-MAR-07 08.59.43.666320 PM83143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1539585
241720-MAR-07 05.49.10.974352 PM22976Drive Mount – DDrive Mount for desktop PC51371887
241920-MAR-07 07.03.32.764632 PM33123PS 220V /DStandard power supply, 220V, for desktop computers.71.5483432
241629-MAR-07 04.41.20.945676 PM22878Router – ASR/2WSpecial ALS Router – Approved Supplier required item with 2-way match3401340
237116-MAY-07 01.34.56.113356 AM32299PS 12V /PPower Supply – 12v portable73151095
237116-MAY-07 01.34.56.113356 AM42316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.2121441
237116-MAY-07 01.34.56.113356 AM52323Screws <B.32.P>Screws: Brass, size 32mm, Phillips head. Plastic box, contents 400.1724408
237916-MAY-07 02.22.24.234567 AM43139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.2134714
237916-MAY-07 02.22.24.234567 AM53140Screws <Z.16.S>Screws: Zinc, length 16mm, straight. Carton box, contents 750.1935665
238016-MAY-07 09.53.02.909090 AM63140Screws <Z.16.S>Screws: Zinc, length 16mm, straight. Carton box, contents 750.2030600
238016-MAY-07 09.53.02.909090 AM73143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1531465
237824-MAY-07 08.59.10.010101 AM72457Cable PR/S/6Standard RS232 serial printer cable, 6 feet4.425110
241124-MAY-07 11.22.10.548639 AM33097Cable Connector – 32RCable Connector – 32 pin ribbon2.2613.2
241124-MAY-07 11.22.10.548639 AM43099Cable HarnessCable harness to organize and bundle computer wiring3.3723.1
241124-MAY-07 11.22.10.548639 AM83123PS 220V /DStandard power supply, 220V, for desktop computers.75171275
241124-MAY-07 11.22.10.548639 AM93124PS 110V /TPower supply for tower PC, 110V84171428
241124-MAY-07 11.22.10.548639 AM123143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1524360
237607-JUN-07 06.18.08.883310 AM42299PS 12V /PPower Supply – 12v portable73171241
237607-JUN-07 06.18.08.883310 AM62311PS 220V /LPower supply for laptop computers, 220V95252375
237607-JUN-07 06.18.08.883310 AM72316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.2127567
237607-JUN-07 06.18.08.883310 AM82319Screws <Z.24.S>Screws: Zinc, size 24mm, straight. Carton box, contents 500.2532800
237707-JUN-07 07.03.01.001100 AM32311PS 220V /LPower supply for laptop computers, 220V9512111495
237707-JUN-07 07.03.01.001100 AM42319Screws <Z.24.S>Screws: Zinc, size 24mm, straight. Carton box, contents 500.251313275
244913-JUN-07 05.49.07.162632 PM12522Battery – ELExtended life battery, for laptop computers43286
244818-JUN-07 04.41.49.262632 PM43134Screws <B.32.S>Screws: Brass, size 32mm, straight. Plastic box, contents 400.1714238
244818-JUN-07 04.41.49.262632 PM53139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.2015300
244818-JUN-07 04.41.49.262632 PM63143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1616256
236926-JUN-07 11.22.54.009932 PM93204Envoy DSEnvoy Docking Station123344182
240301-JUL-07 04.49.13.615512 PM12522Battery – ELExtended life battery, for laptop computers445220
240501-JUL-07 04.49.13.678123 PM12638Envoy DS/EEnhanced Envoy Docking Station13791233
240010-JUL-07 01.34.29.559387 AM12976Drive Mount – DDrive Mount for desktop PC524208
240010-JUL-07 01.34.29.559387 AM22982Drive Mount – ADrive Mount assembly kit41141
240010-JUL-07 01.34.29.559387 AM42999Laptop 16/8/110Envoy Laptop, 16MB memory, 8GB hard disk, 110V power supply (US only).8801614080
240010-JUL-07 01.34.29.559387 AM53003Laptop 128/12/56/v90/110Envoy Laptop, 128MB memory, 12GB hard disk, v90 modem, 110V power supply.2866.61954465.4
239221-JUL-07 08.59.57.571057 PM43124PS 110V /TPower supply for tower PC, 110V77634851
239221-JUL-07 08.59.57.571057 PM63139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.21681428
244427-JUL-07 02.22.27.462632 PM43139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.21931953
244427-JUL-07 02.22.27.462632 PM53140Screws <Z.16.S>Screws: Zinc, length 16mm, straight. Carton box, contents 750.19951805
244427-JUL-07 02.22.27.462632 PM63143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.15971455
245816-AUG-07 03.34.12.234359 PM23123PS 220V /DStandard power supply, 220V, for desktop computers.791128848
245816-AUG-07 03.34.12.234359 PM43134Screws <B.32.S>Screws: Brass, size 32mm, straight. Plastic box, contents 400.171151955
245816-AUG-07 03.34.12.234359 PM53143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.151291935
236428-AUG-07 06.18.45.942399 PM21948Envoy IC/58Internet computer with built-in 58K modem470.8209416
236528-AUG-07 07.03.34.003399 PM52311PS 220V /LPower supply for laptop computers, 220V95292755
236528-AUG-07 07.03.34.003399 PM62316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.2234748
236528-AUG-07 07.03.34.003399 PM72319Screws <Z.24.S>Screws: Zinc, size 24mm, straight. Carton box, contents 500.2438912
236528-AUG-07 07.03.34.003399 PM82322Screws <Z.28.P>Screws: Zinc, size 28 mm, Phillips head. Carton box, contents 850.1943817
236628-AUG-07 08.59.23.144778 PM22373Cable RS232 10/AF10 ft RS232 cable with F/F and 9F/25F adapters6742
236628-AUG-07 08.59.23.144778 PM102419Battery Backup (DA-290)Two-battery charger with LED indicators69241656
244031-AUG-07 09.53.06.008765 PM42311PS 220V /LPower supply for laptop computers, 220V86.97608.3
244031-AUG-07 09.53.06.008765 PM52322Screws <Z.28.P>Screws: Zinc, size 28 mm, Phillips head. Carton box, contents 850.2310230
243801-SEP-07 09.53.26.934626 AM23000Laptop 32/10/56Envoy Laptop, 32MB memory, 10GB hard disk, 56K Modem, universal power supply (switchable).174835244
243502-SEP-07 11.22.53.134567 PM22299PS 12V /PPower Supply – 12v portable754300
243502-SEP-07 11.22.53.134567 PM32311PS 220V /LPower supply for laptop computers, 220V86.98695.2
243502-SEP-07 11.22.53.134567 PM42316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.2110210
243502-SEP-07 11.22.53.134567 PM52323Screws <B.32.P>Screws: Brass, size 32mm, Phillips head. Plastic box, contents 400.1812216
243214-SEP-07 09.53.40.223345 AM12976Drive Mount – DDrive Mount for desktop PC493147
243214-SEP-07 09.53.40.223345 AM22982Drive Mount – ADrive Mount assembly kit43286
243214-SEP-07 09.53.40.223345 AM42999Laptop 16/8/110Envoy Laptop, 16MB memory, 8GB hard disk, 110V power supply (US only).880119680
245402-OCT-07 05.49.34.678340 PM32299PS 12V /PPower Supply – 12v portable713213
245402-OCT-07 05.49.34.678340 PM52316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.2113273
245402-OCT-07 05.49.34.678340 PM62323Screws <B.32.P>Screws: Brass, size 32mm, Phillips head. Plastic box, contents 400.1816288
245206-OCT-07 08.59.43.462632 PM23139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.2010200
245206-OCT-07 08.59.43.462632 PM33143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1512180
236323-OCT-07 05.49.56.346122 PM32299PS 12V /PPower Supply – 12v portable74251850
236323-OCT-07 05.49.56.346122 PM52311PS 220V /LPower supply for laptop computers, 220V86.9292520.1
236323-OCT-07 05.49.56.346122 PM62319Screws <Z.24.S>Screws: Zinc, size 24mm, straight. Carton box, contents 500.2431744
236323-OCT-07 05.49.56.346122 PM72323Screws <B.32.P>Screws: Brass, size 32mm, Phillips head. Plastic box, contents 400.1834612
245731-OCT-07 11.22.16.162632 PM23123PS 220V /DStandard power supply, 220V, for desktop computers.79141106
242710-NOV-07 01.34.22.362124 AM32457Cable PR/S/6Standard RS232 serial printer cable, 6 feet4.4626.4
242710-NOV-07 01.34.22.362124 AM72522Battery – ELExtended life battery, for laptop computers4022880
242810-NOV-07 02.41.34.463567 AM53123PS 220V /DStandard power supply, 220V, for desktop computers.808640
242810-NOV-07 02.41.34.463567 AM83143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1613208
242910-NOV-07 03.49.25.526321 AM43123PS 220V /DStandard power supply, 220V, for desktop computers.79463634
242910-NOV-07 03.49.25.526321 AM73139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.21541134
236113-NOV-07 01.34.21.986210 PM22299PS 12V /PPower Supply – 12v portable7618013680
236113-NOV-07 01.34.21.986210 PM42311PS 220V /LPower supply for laptop computers, 220V86.918516076.5
236113-NOV-07 01.34.21.986210 PM52316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.221874114
236213-NOV-07 02.41.10.619477 PM22299PS 12V /PPower Supply – 12v portable7616012160
236213-NOV-07 02.41.10.619477 PM32311PS 220V /LPower supply for laptop computers, 220V9316415252
236213-NOV-07 02.41.10.619477 PM42316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.221683696
239018-NOV-07 04.18.50.546851 PM31948Envoy IC/58Internet computer with built-in 58K modem470.8167532.8
239719-NOV-07 02.41.54.696211 PM12976Drive Mount – DDrive Mount for desktop PC522104
239719-NOV-07 02.41.54.696211 PM32999Laptop 16/8/110Envoy Laptop, 16MB memory, 8GB hard disk, 110V power supply (US only).8801614080
239719-NOV-07 02.41.54.696211 PM43000Laptop 32/10/56Envoy Laptop, 32MB memory, 10GB hard disk, 56K Modem, universal power supply (switchable).1696.21627139.2
239919-NOV-07 10.22.38.340990 PM32299PS 12V /PPower Supply – 12v portable76151140
239919-NOV-07 10.22.38.340990 PM62311PS 220V /LPower supply for laptop computers, 220V86.9201738
239919-NOV-07 10.22.38.340990 PM72316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.2224528
238606-DEC-07 12.22.34.225609 PM52370PS 220V /HS/FR220V hot swappable power supply, for France.90282520
238508-DEC-07 11.34.11.331392 AM32311PS 220V /LPower supply for laptop computers, 220V86.9968342.4
238508-DEC-07 11.34.11.331392 AM42319Screws <Z.24.S>Screws: Zinc, size 24mm, straight. Carton box, contents 500.25972425
242216-DEC-07 08.19.55.462332 PM33123PS 220V /DStandard power supply, 220V, for desktop computers.71.55357.5
245117-DEC-07 05.03.52.562632 PM21948Envoy IC/58Internet computer with built-in 58K modem470.82210357.6
235626-JAN-08 09.22.41.934562 AM42299PS 12V /PPower Supply – 12v portable72443168
235626-JAN-08 09.22.41.934562 AM62311PS 220V /LPower supply for laptop computers, 220V95514845
235626-JAN-08 09.22.41.934562 AM72316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.22551210
235626-JAN-08 09.22.41.934562 AM82323Screws <B.32.P>Screws: Brass, size 32mm, Phillips head. Plastic box, contents 400.1855990
239310-FEB-08 07.53.19.528202 PM103099Cable HarnessCable harness to organize and bundle computer wiring3.31962.7
239410-FEB-08 09.22.35.564789 PM23123PS 220V /DStandard power supply, 220V, for desktop computers.77362772
239410-FEB-08 09.22.35.564789 PM33124PS 110V /TPower supply for tower PC, 110V82393198
239410-FEB-08 09.22.35.564789 PM63134Screws <B.32.S>Screws: Brass, size 32mm, straight. Plastic box, contents 400.1845810
239410-FEB-08 09.22.35.564789 PM73140Screws <Z.16.S>Screws: Zinc, length 16mm, straight. Carton box, contents 750.1948912
238312-MAY-08 11.22.30.545103 AM22418Battery Backup (DA-130)Single-battery charger with LED indicators56452520
238312-MAY-08 11.22.30.545103 AM62457Cable PR/S/6Standard RS232 serial printer cable, 6 feet4.462272.8
238412-MAY-08 12.22.34.525972 PM22299PS 12V /PPower Supply – 12v portable71483408
238412-MAY-08 12.22.34.525972 PM32316Screws <S.32.S>Screws: Steel, size 32mm, straight. Plastic box, contents 500.21581218
238412-MAY-08 12.22.34.525972 PM42322Screws <Z.28.P>Screws: Zinc, size 28 mm, Phillips head. Carton box, contents 850.22591298
238214-MAY-08 10.19.03.828321 AM53123PS 220V /DStandard power supply, 220V, for desktop computers.79715609
238214-MAY-08 10.19.03.828321 AM83139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.21791659
238214-MAY-08 10.19.03.828321 AM93143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.15821230
238114-MAY-08 08.59.08.843679 PM23124PS 110V /TPower supply for tower PC, 110V77443388
238114-MAY-08 08.59.08.843679 PM43139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.2045900
238114-MAY-08 08.59.08.843679 PM53143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1548720
241024-MAY-08 10.19.51.985501 AM12976Drive Mount – DDrive Mount for desktop PC4610460
241024-MAY-08 10.19.51.985501 AM22982Drive Mount – ADrive Mount assembly kit405200
241024-MAY-08 10.19.51.985501 AM53003Laptop 128/12/56/v90/110Envoy Laptop, 128MB memory, 12GB hard disk, v90 modem, 110V power supply.2866.61542999
238904-JUN-08 05.49.43.546954 PM33123PS 220V /DStandard power supply, 220V, for desktop computers.80211680
238904-JUN-08 05.49.43.546954 PM53143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1530450
236826-JUN-08 10.19.43.190089 PM43123PS 220V /DStandard power supply, 220V, for desktop computers.81705670
236826-JUN-08 10.19.43.190089 PM73143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.16751200
236727-JUN-08 09.53.32.335522 PM42322Screws <Z.28.P>Screws: Zinc, size 28 mm, Phillips head. Carton box, contents 850.2245990
235414-JUL-08 06.18.23.234567 PM33123PS 220V /DStandard power supply, 220V, for desktop computers.79473713
235414-JUL-08 06.18.23.234567 PM53139Screws <S.16.S>Screws: Steel, size 16 mm, straight. Carton box, contents 750.21481008
235414-JUL-08 06.18.23.234567 PM63143Screws <B.28.S>Screws: Brass, size 28mm, straight. Plastic box, contents 500.1653848
244727-JUL-08 08.59.10.223344 AM42278Battery – NiHMRechargeable NiHM battery for laptop computers50251250
244727-JUL-08 08.59.10.223344 AM62299PS 12V /PPower Supply – 12v portable76352660
244727-JUL-08 08.59.10.223344 AM92311PS 220V /LPower supply for laptop computers, 220V93444092
Solution
SELECT
	oe.orders.order_id,
	oe.orders.order_date,
	oe.order_items.line_item_id,
	oe.order_items.product_id,
	oe.product_information.product_name,
	oe.product_information.product_description,
	oe.order_items.unit_price,
	oe.order_items.quantity,
	oe.order_items.unit_price * oe.order_items.quantity AS sale_amount
FROM
	oe.orders
	INNER JOIN
	oe.order_items
		ON oe.orders.order_id = oe.order_items.order_id
	INNER JOIN
	oe.product_information
		ON oe.order_items.product_id = oe.product_information.product_id
WHERE
	oe.product_information.category_id = 19
ORDER BY
	oe.orders.order_date,
	oe.orders.order_id,
	oe.order_items.line_item_id;

Problem 8
For each customer ID, retrieve the product IDs and the total quantity ordered by the customer. For example, if customer 123 ordered 5 of product ABC on one occasion and 8 of product ABC on another occasion, then the record should as 123 for the customer ID, ABC for the product ID, and 13 for the total quantity ordered for the item across all the customer’s orders. Alias the summation as “total_ordered.” Sort the result set by customer ID (ascending) and product ID (ascending).

Table(s) Required

oe.orders
oe.order_items

Expected Output
CUSTOMER_IDPRODUCT_IDTOTAL_ORDERED
101226429
101226623
101227224
101227825
101229334
101229935
101230237
101230840
101231144
1013108200
101311240
1013117184
1013123112
1013127158
101312945
1013134115
1013143129
101315562
1013163208
10133506
10133535
101335910
101336210
101350143
10229765
10229822
102298613
102299927
102300016
10230973
10231061
10231143
10231177
10231279
102312911
10232088
10232167
10232209
102323411
102324618
102325323
102326024
10319106
1032289120
10322930
10322993
103230812
103231613
103232316
103233418
10324238
10324304
103245717
103246219
103246421
103249635
10327515
1042289200
1042308185
1042311188
1042322188
1042323190
1042326192
1042330197
1042339199
1042359204
104287010
10428781
10429953
10430003
104310661
104311443
104312347
104312947
104313948
104314353
104315058
104316361
104316564
104316768
104317070
104317672
104318277
10517819
10517824
105179721
105180313
10518064
105180814
10518209
105182213
105226438
105227434
105229340
105229944
105230847
105231151
105231655
105232355
10528709
105297637
10623371
10623591
106237017
106237317
106237717
106238017
106238117
10625369
10625377
106308215
106309012
106309713
106311020
1063117110
106312444
106313344
106313945
106314031
106314348
106315037
106316355
106317662
106318363
107205829
107209342
107228919
10722932
10723022
10723117
107232210
107233013
107233415
107233719
107233923
107235024
107235928
107240226
107241021
107241823
107242225
107243028
107243930
107245940
107246744
1073106150
107311445
107312348
107312957
107313361
107315069
107315572
107316576
107316781
1082211140
108224526
108225226
108225729
108226229
108226832
108227638
1082289221
1082299180
1082308182
1082311185
1082316187
1082326194
1082334198
1082359208
1082365209
1083106113
108311011
108311417
108312320
10831246
108312722
108313329
108313912
108314034
108314356
108315017
108315521
108316345
108316531
108317147
1092289200
1092299160
1092311164
1092316168
1092326173
1092334177
1092339179
1092359189
1093106160
1093108160
1093112164
1093117365
1093123204
109312439
109312788
1093129213
1093133135
109313445
109313993
1093140143
1093143273
1093150276
1093155350
1093165112
109316768
1093172112
1093182115
11624923
11631067
11631081
11631145
11631176
11631238
116312712
116313312
116314313
116315019
11631551
11631635
116316510
116317048
116317328
116317624
116318724
116319328
116320434
11632088
11632092
11632163
11632246
116324516
116325018
116325618
116329024
11719109
117228947
117232634
117233036
117233737
117235039
11725225
117253719
1173106200
117310840
117311043
117312346
117312749
117313352
117313954
117315055
117316363
117316567
11822746
11822938
118229915
118231621
118232324
118233426
118233929
118235032
118310836
118312314
118312717
118315027
118315532
118317042
118317245
11931066
11931082
11931107
119312310
119312713
119313417
119314321
119316330
119316732
119317036
12018208
12018251
121242210
12124236
121244915
121246721
1223106140
122311284
122311785
122312786
122313388
122313490
122314393
122315093
122315598
122316399
1223165103
1223171107
1223176109
123227014
12322764
123229313
123229917
123230221
123231125
123231627
123231932
123232633
123233436
1412289130
1412302119
1412311121
1412319131
1412326132
1412330136
142240320
14224122
14224147
142241711
142242311
142242415
142245725
142245925
143310626
143310818
143311723
143312724
143313328
143314030
143314331
143315033
143315533
143316336
143316737
143317640
143318740
14422649
14422705
14422727
14422783
144228935
144229311
144229943
144230826
144231161
144231610
144231958
144232346
144232665
144233456
144233919
144235024
144236533
1443106178
144311064
144311465
144311771
144312376
144312780
144312976
144313311
144313979
144314382
144315025
144315529
1443163124
144316592
144316739
14519106
145194820
145240937
145241845
145242246
145243050
145243954
145245762
145246263
14524713
145249632
145253654
14531063
14531140
145313311
145313414
145313915
145314316
14532208
14532243
145324513
145324614
145325116
145325821
145329033
1462289187
146229328
146229948
146230229
146230829
146231129
146231692
146231938
1462322102
146232644
146233061
146233545
146233950
146234054
146235977
14625222
146310692
146311414
146312723
146313934
146314035
146335011
14633549
146335912
1472289200
147230287
147231196
147231997
1472335106
1472350109
14723598
14723737
147238210
147239411
147239512
147240016
147240620
147240922
147241524
147241924
1473106150
147310875
147311079
147311483
147314093
147315093
147315598
1473163100
14731914
14731933
14731975
147321611
147322014
147322416
14735013
14735112
14735154
14819109
148194822
148228999
148230232
148230839
148232245
148232648
148233059
14823345
148233554
148234014
148235054
148236527
148237028
148237532
148237833
148239436
14827215
14827254
148276119
148278231
14831936
148321611
148323418
148324826
148325229
1492211133
149223684
149224320
1492245108
1492252114
149225332
149225492
149225794
1492268146
149243012
14924391
14924576
14924646
14924706
149249619
149252222
1493106150
149311060
1493117202
149312370
149312770
149312972
149313910
149314387
149315013
149315588
149316518
149317020
149317220
149317323
1502289150
150229390
150230896
1502330105
1502350112
1513106180
151311218
151312321
151312922
151314330
151315533
151316543
151316747
15219104
15219122
152194816
15317875
15317913
15317977
153179910
153180815
153182018
153182223
154310663
154311257
154311758
154312463
154313366
154313968
154315072
154315577
154316581
155305110
15530602
15530645
15530698
15530778
155308210
155308613
155308714
155309119
155309919
155310830
1562211110
156224327
156225230
156225534
156226434
156226837
156227041
15724715
157253723
157259427
1582289120
158229312
158229915
158230217
158230817
158231120
158231624
158232627
158233028
158233533
158235938
15929764
15929821
15929864
159299916
159300319
16024924
16024963
16125368
16225225
16327216
163280837
16426389
16527215
165275218
165276121
16627513
16627611
166278310
16728108
168297610
16829825
16829866
16829958
168300315
168305121
16930822
16930862
16930976
16930997
16931018
169310611
169311217
169312317
169312417
169312718
169313323
169314324
1703106170
170311468
170312368
170312772
170313475
170313979
170314380
170316392
170316794
Solution
SELECT
	oe.orders.customer_id,
	oe.order_items.product_id,
	SUM(oe.order_items.quantity) AS total_ordered
FROM
	oe.orders
	INNER JOIN
    oe.order_items
		ON oe.orders.order_id = oe.order_items.order_id
GROUP BY
	oe.orders.customer_id,
	oe.order_items.product_id
ORDER BY
	oe.orders.customer_id,
	oe.order_items.product_id;

Problem 9
For each customer ID, compute/retrieve the total number of orders placed by year. To extract the year from the order date, use EXTRACT(YEAR FROM oe.orders.order_date). Alias this derived column as “order_year.” Provide the alias of “order_count” to the number of orders placed by the customer for each year. Sort the result set by customer ID (ascending) and order year (ascending).

Table(s) Required

oe.orders

Expected Output
CUSTOMER_IDORDER_YEARORDER_COUNT
10120072
10120082
10220061
10220073
10320062
10320072
10420061
10420072
10420081
10520072
10520082
10620041
10620061
10620082
10720061
10720073
10820062
10820072
10920073
10920081
11620074
11720061
11720072
11720081
11820072
11920071
12020081
12120081
12220071
12320071
14120071
14220071
14320071
14420061
14420073
14420081
14520074
14520081
14620074
14620081
14720062
14720073
14820061
14820073
14820081
14920074
14920081
15020071
15120081
15220071
15320061
15420071
15520081
15620061
15720071
15820071
15920071
16020071
16120071
16220071
16320071
16420071
16520071
16620071
16720071
16820081
16920071
17020061
Solution
SELECT
	oe.orders.customer_id,
	EXTRACT(YEAR FROM oe.orders.order_date) AS order_year,
	COUNT(*) AS order_count
FROM
	oe.orders
GROUP BY
	oe.orders.customer_id,
	EXTRACT(YEAR FROM oe.orders.order_date)
ORDER BY
	oe.orders.customer_id,
    order_year;

Problem 10
For each category ID, retrieve the category ID, parent category ID, category name, category description, parent category name, and parent category description. Include all category IDs even if a parent category doesn’t exist. Each row should consist of child category and parent category (i.e., 1 level above the child) data. Alias the parent category name as “parent_category_name” and the parent category description as “parent_category_description.” Sort the result set by the child category ID, ascending.

Table(s) Required

oe.categories_tab

Expected Output
CATEGORY_IDPARENT_CATEGORY_IDCATEGORY_NAMECATEGORY_DESCRIPTIONPARENT_CATEGORY_NAMEPARENT_CATEGORY_DESCRIPTION
1090hardwarecomputer hardware and peripheralsonline catalogcatalog of computer hardware, software, and office equipment
1110hardware1monitorshardwarecomputer hardware and peripherals
1210hardware2printershardwarecomputer hardware and peripherals
1310hardware3harddiskshardwarecomputer hardware and peripherals
1410hardware4memory components/upgradeshardwarecomputer hardware and peripherals
1510hardware5processors, sound and video cards, network cards, motherboardshardwarecomputer hardware and peripherals
1610hardware6keyboards, mouses, mouse padshardwarecomputer hardware and peripherals
1710hardware7other peripherals (CD-ROM, DVD, tape cartridge drives, …)hardwarecomputer hardware and peripherals
1910hardware8miscellaneous hardware (cables, screws, power supplies …)hardwarecomputer hardware and peripherals
2090softwarecomputer softwareonline catalogcatalog of computer hardware, software, and office equipment
2120software1spreadsheet softwaresoftwarecomputer software
2220software2word processing softwaresoftwarecomputer software
2320software3database softwaresoftwarecomputer software
2420software4operating systemssoftwarecomputer software
2520software5software development tools (including languages)softwarecomputer software
2920software6miscellaneous softwaresoftwarecomputer software
3090office equipmentoffice furniture and suppliesonline catalogcatalog of computer hardware, software, and office equipment
3130office1capitalizable assets (desks, chairs, phones …)office equipmentoffice furniture and supplies
3230office2office supplies for daily use (pencils, erasers, staples, …)office equipmentoffice furniture and supplies
3330office3manuals, other booksoffice equipmentoffice furniture and supplies
3930office4miscellaneous office suppliesoffice equipmentoffice furniture and supplies
90online catalogcatalog of computer hardware, software, and office equipment
Solution
SELECT
    child_category.category_id,
    child_category.parent_category_id,
    child_category.category_name,
    child_category.category_description,
    parent_category.category_name AS parent_category_name,
    parent_category.category_description AS parent_category_description
FROM
    oe.categories_tab child_category
    LEFT JOIN
    oe.categories_tab parent_category
        ON child_category.parent_category_id = parent_category.category_id
ORDER BY
    child_category.category_id;

Problem 11
For customer ID 105, retrieve the customer ID, customer first name, customer last name, order ID, line-item ID, product ID, product name, product description, unit price, and quantity for orders containing a line-item with a product name starting with “RAM.”

Table(s) Required

oe.customers
oe.orders
oe.order_items
oe.product_information

Expected Output
CUSTOMER_IDCUST_FIRST_NAMECUST_LAST_NAMEORDER_IDLINE_ITEM_IDPRODUCT_IDPRODUCT_NAMEPRODUCT_DESCRIPTIONUNIT_PRICEQUANTITY
105MatthiasMacGraw235622274RAM – 32 MBMemory SIMM: RAM – 32 MB capacity.148.534
Solution
SELECT
	oe.customers.customer_id,        
	oe.customers.cust_first_name,
	oe.customers.cust_last_name,
	oe.orders.order_id,
	oe.order_items.line_item_id,
	oe.order_items.product_id,
	oe.product_information.product_name,
	oe.product_information.product_description,
	oe.order_items.unit_price,
	oe.order_items.quantity
FROM
	oe.customers
	INNER JOIN
	oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
		AND oe.customers.customer_id = 105
	INNER JOIN
	oe.order_items
		ON oe.orders.order_id = oe.order_items.order_id
	INNER JOIN
	oe.product_information
        ON oe.order_items.product_id = oe.product_information.product_id
        AND oe.product_information.product_name LIKE 'RAM%';

Problem 12
For each customer, compute/retrieve the average order total for the customer’s orders. Only include customers that have placed at least 1 order. Customer ID should be the first column in your output. Alias the average order total as “avg_order_total.” Sort the result set by average order total, descending.

Table(s) Required

oe.orders

Expected Output
CUSTOMER_IDAVG_ORDER_TOTAL
150282694.3
122103834.4
14980623.94
14774255.64
15969286.4
15668501
17066816
10966313.9
10853349.925
11850495.9
15348070.6
10147598.775
16845175
11739452.175
10738903.3
14138017.8
14837140.1
10436651.375
14432056.92
14327132.6
15426632
14225691.3
15825270.3
15523431.9
14617692.52
15117620
10217302.85
11916447.2
16915760.5
10515344.125
14514343.58
12311006.2
1069049.875
1168076.75
1527616.8
1577110.3
1035147.85
1214797
1652519
1641233
160969.2
161600
163510
120416
166309
162220
16748
Solution
SELECT
	oe.orders.customer_id,
	AVG(oe.orders.order_total) AS avg_order_total
FROM
	oe.orders
GROUP BY
	oe.orders.customer_id
ORDER BY
	avg_order_total DESC;

Problem 13
Compute/retrieve the number of orders place by customer income level. Include income levels even if no orders have been placed by customers with the corresponding income level. The income level category should be the first column in your result set. Alias the number of orders as “order_count.” Sort the result set by income level, ascending.

Table(s) Required

oe.customers
oe.orders

Expected Output
INCOME_LEVELORDER_COUNT
A: Below 30,0006
B: 30,000 – 49,9995
C: 50,000 – 69,9995
D: 70,000 – 89,9998
E: 90,000 – 109,9995
F: 110,000 – 129,99930
G: 130,000 – 149,99915
H: 150,000 – 169,99917
I: 170,000 – 189,9996
J: 190,000 – 249,9992
K: 250,000 – 299,9990
L: 300,000 and above6
Solution
SELECT
	oe.customers.income_level,
	COUNT(oe.orders.order_id) AS order_count
FROM
	oe.customers
	LEFT JOIN
    oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
GROUP BY
	oe.customers.income_level
ORDER BY
	oe.customers.income_level;

Problem 14
Write a query that returns a result set containing the customer ID, customer first name, customer last name, order ID, and order total for each customer order. Only include orders for married customers located in America. Sort the result set by order date, descending.

Table(s) Required

oe.customers
oe.orders

Expected Output
CUSTOMER_IDCUST_FIRST_NAMECUST_LAST_NAMEORDER_IDORDER_DATEORDER_TOTAL
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.6
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.8
117GuillaumeEdwards237027-JUN-08 12.22.11.647398 AM126
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.1
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM48552
121DianneSen237427-FEB-08 02.41.45.109654 AM4797
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.9
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.8
105MatthiasMacGraw235808-JAN-08 05.03.12.654278 PM7826
148GustavSteenburgen245117-DEC-07 05.03.52.562632 PM10474.6
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.5
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.9
146EliaFawcett242421-NOV-07 10.22.33.263332 AM13824
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.3
152DieterMatthau239018-NOV-07 04.18.50.546851 PM7616.8
107MatthiasCruise236014-NOV-07 12.22.31.223344 PM990.4
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.3
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM50125
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.3
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.4
101ConstantinWelles243002-OCT-07 06.18.36.663332 AM29669.9
103ManishaTaylor243313-SEP-07 10.19.00.654279 AM78
144SivajiLandis243502-SEP-07 11.22.53.134567 PM62303
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.9
105MatthiasMacGraw243931-AUG-07 10.19.37.811132 AM22150.1
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.3
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.6
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.3
160EddieStern240110-JUL-07 02.22.53.554822 AM969.2
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.4
164CharlotteKazan240501-JUL-07 04.49.13.678123 PM1233
162ErnestGeorge240301-JUL-07 04.49.13.615512 PM220
167GerardHershey240929-JUN-07 09.53.41.984501 AM48
165CharlotteFonda240729-JUN-07 07.03.21.526005 AM2519
148GustavSteenburgen240629-JUN-07 04.41.20.098765 AM2854.2
146EliaFawcett244913-JUN-07 05.49.07.162632 PM86
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.3
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.5
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.3
146EliaFawcett237916-MAY-07 02.22.24.234567 AM17848.2
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM31574
105MatthiasMacGraw241720-MAR-07 05.49.10.974352 PM1926.6
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM29750
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.2
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.4
148GustavSteenburgen242617-NOV-06 12.22.11.262552 AM7200
117GuillaumeEdwards245607-NOV-06 07.53.25.989889 PM3878.4
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM13550
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.8
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM3646
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.9
103ManishaTaylor241529-MAR-06 01.34.50.545196 PM310
156GoldieMontand239502-FEB-06 08.19.11.227550 PM68501
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.4
Solution
SELECT
	oe.customers.customer_id,
	oe.customers.cust_first_name,
	oe.customers.cust_last_name,
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total
FROM
	oe.customers
	INNER JOIN
	oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
WHERE
	oe.customers.nls_territory = 'AMERICA'
	AND oe.customers.marital_status = 'married'
ORDER BY
	oe.orders.order_date DESC;

Problem 15
Write a query that returns a result set containing the order ID, order date, customer ID, line-item ID, product ID, quantity, and unit price for all line-items with a quantity greater than 200 or those line-items with a unit price greater than $2,000. If an order has 5 line-items and only 2 of the line-items meet the criteria, then only 2 rows should be returned for the order (i.e., 1 for each line-item). Sort the result set by order date, ascending.

Table(s) Required

oe.orders
oe.order_items

Expected Output
ORDER_IDORDER_DATECUSTOMER_IDLINE_ITEM_IDPRODUCT_IDQUANTITYUNIT_PRICE
235526-JAN-06 09.22.51.962632 AM10492359204226.6
237116-MAY-07 01.34.56.113356 AM11882350322341.9
238804-JUN-07 04.41.12.554435 PM150523501122341.9
240010-JUL-07 01.34.29.559387 AM15953003192866.6
244627-JUL-07 07.03.08.302945 AM11752350392341.9
244031-AUG-07 09.53.06.008765 PM107102350242341.9
243502-SEP-07 11.22.53.134567 PM14482350242341.9
236113-NOV-07 01.34.21.986210 PM10882359208248
236113-NOV-07 01.34.21.986210 PM1089236520976
238508-DEC-07 11.34.11.331392 AM147623501092341.9
241024-MAY-08 10.19.51.985501 AM16853003152866.6
236727-JUN-08 09.53.32.335522 PM14882350542341.9
Solution
SELECT
    oe.orders.order_id,
    oe.orders.order_date,
    oe.orders.customer_id,
    oe.order_items.line_item_id,
    oe.order_items.product_id,
    oe.order_items.quantity,
    oe.order_items.unit_price
FROM
    oe.orders
    INNER JOIN
    oe.order_items
        ON oe.orders.order_id = oe.order_items.order_id
WHERE
    oe.order_items.quantity > 200
    OR oe.order_items.unit_price > 2000
ORDER BY
    oe.orders.order_date;

Problem 16
Write a query that returns a result set containing the customer ID, customer first name, customer last name, order ID, order date, and order total for each customer’s orders. Include customer data even if the customer hasn’t placed an order. If the customer hasn’t placed an order, then the customer’s order information should be NULL. Sort the result set by order date, ascending.

Table(s) Required

oe.customers
oe.orders

Expected Output
CUSTOMER_IDCUST_FIRST_NAMECUST_LAST_NAMEORDER_IDORDER_DATEORDER_TOTAL
106MatthiasHannah241820-MAR-04 04.18.21.862632 PM5546.6
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.4
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.1
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.5
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM34930
156GoldieMontand239502-FEB-06 08.19.11.227550 PM68501
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.6
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM66816
103ManishaTaylor241529-MAR-06 01.34.50.545196 PM310
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.9
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM3646
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.8
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM13550
102HarrisonPacino243114-SEP-06 07.03.04.763452 AM5610.6
117GuillaumeEdwards245607-NOV-06 07.53.25.989889 PM3878.4
147IshwaryaRoberts242516-NOV-06 11.34.22.162552 PM1500.8
148GustavSteenburgen242617-NOV-06 12.22.11.262552 AM7200
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.4
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.2
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.9
109ChristianCage242112-MAR-07 09.53.54.562432 PM72836
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM29750
105MatthiasMacGraw241720-MAR-07 05.49.10.974352 PM1926.6
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM31574
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.6
104HarrisonSutherland241629-MAR-07 04.41.20.945676 PM384
147IshwaryaRoberts245011-APR-07 06.18.10.362632 PM1636
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.6
146EliaFawcett237916-MAY-07 02.22.24.234567 AM17848.2
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.6
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.3
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.5
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.3
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.2
141MaximilianHenner237707-JUN-07 07.03.01.001100 AM38017.8
146EliaFawcett244913-JUN-07 05.49.07.162632 PM86
145MammuttiPacino244818-JUN-07 04.41.49.262632 PM1388
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.4
148GustavSteenburgen240629-JUN-07 04.41.20.098765 AM2854.2
165CharlotteFonda240729-JUN-07 07.03.21.526005 AM2519
166DheerajAlexander240829-JUN-07 08.59.31.333617 AM309
167GerardHershey240929-JUN-07 09.53.41.984501 AM48
162ErnestGeorge240301-JUL-07 04.49.13.615512 PM220
163ErnestChandar240401-JUL-07 04.49.13.664085 PM510
164CharlotteKazan240501-JUL-07 04.49.13.678123 PM1233
161ErnestWeaver240202-JUL-07 03.34.44.665170 AM600
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.4
160EddieStern240110-JUL-07 02.22.53.554822 AM969.2
154FredericGrodin239221-JUL-07 08.59.57.571057 PM26632
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.3
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.2
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.6
145MammuttiPacino236428-AUG-07 06.18.45.942399 PM9500
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.3
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.4
105MatthiasMacGraw243931-AUG-07 10.19.37.811132 AM22150.1
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.9
104HarrisonSutherland243801-SEP-07 09.53.26.934626 AM5451
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.8
144SivajiLandis243502-SEP-07 11.22.53.134567 PM62303
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.8
103ManishaTaylor243313-SEP-07 10.19.00.654279 AM78
102HarrisonPacino243214-SEP-07 09.53.40.223345 AM10523
145MammuttiPacino245520-SEP-07 11.34.11.456789 AM14087.5
101ConstantinWelles243002-OCT-07 06.18.36.663332 AM29669.9
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.4
116GeraldineMartin245304-OCT-07 09.53.34.362632 PM129
149MarkusRampling245206-OCT-07 08.59.43.462632 PM12589
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.3
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.2
149MarkusRampling242710-NOV-07 01.34.22.362124 AM9055
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.8
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM50125
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.3
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.4
107MatthiasCruise236014-NOV-07 12.22.31.223344 PM990.4
152DieterMatthau239018-NOV-07 04.18.50.546851 PM7616.8
102HarrisonPacino239719-NOV-07 02.41.54.696211 PM42283.2
157SidneyCapshaw239819-NOV-07 09.22.53.224175 PM7110.3
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.3
146EliaFawcett242421-NOV-07 10.22.33.263332 AM13824
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.7
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.9
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM295892
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.5
148GustavSteenburgen245117-DEC-07 05.03.52.562632 PM10474.6
105MatthiasMacGraw235808-JAN-08 05.03.12.654278 PM7826
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.8
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.9
109ChristianCage239410-FEB-08 09.22.35.564789 PM21863
120DianeHiggins237327-FEB-08 01.34.51.220065 AM416
121DianneSen237427-FEB-08 02.41.45.109654 AM4797
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM48552
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.7
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.1
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.6
168HemaVoight241024-MAY-08 10.19.51.985501 AM45175
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM17620
149MarkusRampling236826-JUN-08 10.19.43.190089 PM60065
117GuillaumeEdwards237027-JUN-08 12.22.11.647398 AM126
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.8
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM46257
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.6
106MatthiasHannah244101-AUG-08 11.22.48.734526 AM2075.2
171HemaPowell
172Harry MeanPeckinpah
174BlakeSeignier
175ClaudePowell
176FayeGlenn
177GerhardSeignier
179Harry deanForrest
180Harry deanCage
181LaurenHershey
183LaurenAltman
184Mary BethRoberts
262FredReynolds
263FredLithgow
265IreneLaughton
266PremCardinale
267PremWalken
268KyleSchneider
270MegDerek
271ShelleyPeckinpah
272PremGarcia
274BobMcCarthy
275DomMcQueen
276DomHoskins
110CharlieSutherland
111CharliePacino
112GuillaumeJackson
113DanielCostner
114DianneDerek
115GeraldineSchneider
185MatthewWright
186MeenaAlexander
188CharlotteBuckley
277DonSiegel
278GvtzBradford
279HollyKurosawa
280RobMacLaine
281DonBarkin
282KurtDanson
283KurtHeard
308GlendaDunaway
309GlendaBates
323GoetzFalk
326HalOlin
327HannahKanth
328HannahField
333MargretPowell
334Harry MeanTaylor
335MargritGarner
337MariaWarden
361MarilouChapman
363KathyLambert
360HelmutCapshaw
341KeirGeorge
342MarlonLaughton
343KeirChandar
345KeirWeaver
346MarlonClapton
347KellyQuinlan
349KenGlenn
350KenChopra
351KenWenders
380MerylHolden
447RichardCoppola
448RichardWinters
450RickLyon
451RidleyHackman
452RidleyCoyote
454RobRussell
458Robertde Niro
466RodolfoHershey
467RodolfoDench
468RodolfoAltman
189GenaHarris
190GenaCurtis
191MaureenSanders
192SeanStockwell
193Harry deanKinski
194KathleenGarcia
195SeanOlin
196GerardDench
197GerardAltman
198Maureende Funes
199ClintChapman
200ClintGielgud
201EricPrashant
202IngridWelles
203IngridRampling
204CliffPuri
205EmilyPollack
206FritzHackman
207CybillLaughton
208CyndiGriem
209CyndiCollins
210CybillClapton
211LuchinoJordan
213LuchinoBradford
214RobinDanson
215OrsonPerkins
216OrsonKoirala
218BryanDvrrie
219AjaySen
220CarolJordan
221CarolBradford
223CaryOlin
224ClaraKrige
225ClaraGanesan
227KathyPrashant
228GrahamNeeson
229IanChapman
230DannyWright
232DonaldHunter
233GrahamSpielberg
234DanRoberts
235EdwardOates
236EdwardJulius
237FarrahQuinlan
238FarrahLange
239HalStockwell
240MalcolmKanth
241MalcolmBroderick
242MaryLemmon
243MaryCollins
244MattGueney
245Maxvon Sydow
246MaxSchell
247CyndaWhitcraft
248DonaldMinnelli
249HannahBroderick
250DanWilliams
251RaulWilder
252Shah RukhField
253SallyBogart
254BruceBates
256Bende Niro
257EmmetWalken
258EllenPalin
259Denholmvon Sydow
261EmmetGarcia
124DianeMason
125DianneAndrews
126CharlesField
128IsabellaReed
129LouisJackson
130LouisEdwards
131DorisDutt
133KristinMalden
134SissyPuri
135DorisBel Geddes
136SissyWarden
138ManiFonda
139PlacidoKubrick
140ClaudiaKurosawa
767Klaus MariaRussell
771Krisde Niro
826AlainBarkin
830AlbertDutt
850AmandaFinney
905BillyHershey
911BoDickinson
919BrookeMichalkow
924BrunoMontand
930BusterJackson
980DanielLoren
473RolfAshby
474RomySharif
475RomyMcCarthy
476RosanneHopkins
477RosanneDouglas
478RosanneBaldwin
479RoxanneShepherd
480RoxanneMichalkow
481RoyHulce
482RoyDunaway
483RoyBates
487RufusDvrrie
488RufusBelushi
492SallyEdwards
496ScottJordan
605ShammiPacino
606SharmilaKazan
609ShelleyTaylor
615ShyamPlummer
621SilkKurosawa
712M. EmmetStockwell
713M. EmmetOlin
717MammuttiSutherland
719ManiKazan
721ManiBuckley
729MargauxKrige
731MargauxCapshaw
754KevinGoodman
756KevinWilder
757KieferReynolds
766KlausYoung
768Klaus MariaMacLaine
769KrisHarris
770KrisCurtis
772KristinSavage
782LaurenceSeignier
825AlainDreyfuss
827AlainSiegel
828AlanMinnelli
829AlanHunter
831AlbertBel Geddes
832AlbertSpacek
833AlecMoranis
834AlecIdle
835AlexanderEastwood
836AlexanderBerenger
837AlexanderStanton
838AlfredNicholson
839AlfredJohnson
840AliElliott
841AliBoyer
842AliStern
843AliceOates
844AliceJulius
845AllyFawcett
846AllyBrando
847AllyStreep
848AlonsoOlmos
849AlonsoKaurusmdki
851AmandaBrown
852AmandaTanner
853AmrishPalin
906BillyDench
909BlakeMastroianni
912BoAshby
913BobSharif
916BrianDouglas
917BrianBaldwin
920BruceHulce
921BruceDunaway
923BrunoSlater
927BryanBelushi
928BurtSpielberg
929BurtNeeson
931BusterEdwards
932BusterBogart
934C. ThomasNolte
981DanielGueney
127CharlesBroderick
132DorisSpacek
137EliaBrando
173KathleenWalken
178GraceBelushi
182LaurenDench
187GraceDvrrie
212LuchinoFalk
217BryanHuston
222CaryStockwell
226AjayAndrews
231DannyRourke
255BrookeShepherd
260EllenKhan
264GeorgeAdjani
269KyleMartin
273BoHitchcock
339MarilouLandis
344MarlonGodard
348KellyLange
352KennethRedford
378MegSen
449RickRomero
453RidleyYoung
463RobinAdjani
470RogerMastroianni
607SharmilaFonda
627SivajiGielgud
715MalcolmField
727MargaretUstinov
755KevinCleveland
Solution
SELECT
	oe.customers.customer_id,
	oe.customers.cust_first_name,
	oe.customers.cust_last_name,
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total
FROM
	oe.customers
	LEFT JOIN
	oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
ORDER BY
	oe.orders.order_date;

Problem 17
Write a query that returns a result set containing the containing the number of orders placed for each NLS territory. Alias the number of orders placed as “order_count.” Include NLS territory values even if customers from the territory have not placed an order. Sort the result set by NLS Territory, ascending.

Table(s) Required

oe.customers
oe.orders

Expected Output
NLS_TERRITORYORDER_COUNT
AMERICA105
CHINA0
GERMANY0
INDIA0
ITALY0
JAPAN0
SWITZERLAND0
THAILAND0
Solution
SELECT
	oe.customers.nls_territory,
	COUNT(oe.orders.order_id) AS order_count
FROM
	oe.customers
	LEFT JOIN
	oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
GROUP BY
	oe.customers.nls_territory
ORDER BY
	oe.customers.nls_territory;

Problem 18
Write a query that returns a result set containing the containing the marital status, cheapest order made by a customer of the corresponding marital status, most expensive order made by a customer of the corresponding marital status, and the sum of all order total values for the corresponding marital status. Alias the cheapest order total as “cheapest_order,” most expensive order as “most_expensive_order,” and the sum of all order totals as “combined_order_total.”

Table(s) Required

oe.customers
oe.orders

Expected Output
MARITAL_STATUSCHEAPEST_ORDERMOST_EXPENSIVE_ORDERCOMBINED_ORDER_TOTAL
married48282694.31881952.6
single1292958921786102.1
Solution
SELECT
	oe.customers.marital_status,
	MIN(oe.orders.order_total) AS cheapest_order,
	MAX(oe.orders.order_total) AS most_expensive_order,
	SUM(oe.orders.order_total) AS combined_order_total
FROM
	oe.customers
	INNER JOIN
	oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
GROUP BY
	oe.customers.marital_status;

Problem 19
Write a query that returns a result set containing the customer ID, customer first name, customer last name, order ID, order date, and order total for all orders with an order total greater than or equal to 1.5 times the average order total. Sort the result set by order total, descending.

Table(s) Required

oe.customers
oe.orders

Expected Output
CUSTOMER_IDCUST_FIRST_NAMECUST_LAST_NAMEORDER_IDORDER_DATEORDER_TOTAL
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM295892
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.3
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.8
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.8
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.3
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.4
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.3
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.5
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.4
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.6
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.6
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.2
109ChristianCage242112-MAR-07 09.53.54.562432 PM72836
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.9
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.4
156GoldieMontand239502-FEB-06 08.19.11.227550 PM68501
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM66816
144SivajiLandis243502-SEP-07 11.22.53.134567 PM62303
149MarkusRampling236826-JUN-08 10.19.43.190089 PM60065
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.4
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.9
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.9
Solution
SELECT
	oe.customers.customer_id,
	oe.customers.cust_first_name,
	oe.customers.cust_last_name,
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total
FROM
	oe.orders
    INNER JOIN
	oe.customers
        ON oe.orders.customer_id = oe.customers.customer_id
WHERE
	oe.orders.order_total >= (
		SELECT
			AVG(oe.orders.order_total) * 1.5
		FROM
			oe.orders
	)
ORDER BY
	oe.orders.order_total DESC;

Problem 20
Write a query that returns a result set containing the details of the first order placed based on the order date. The result set should include order ID, order date, order total, line-item ID, product ID, product name, unit price, and quantity.  There should be one row for each line-item. Sort the result set by line-item ID, ascending.

Table(s) Required

oe.orders
oe.order_items
oe.product_information

Expected Output
ORDER_IDORDER_DATEORDER_TOTALLINE_ITEM_IDPRODUCT_IDPRODUCT_NAMEUNIT_PRICEQUANTITY
241820-MAR-04 04.18.21.862632 PM5546.613082Modem – 56/90/E7515
241820-MAR-04 04.18.21.862632 PM5546.623090RAM – 48 MB18712
241820-MAR-04 04.18.21.862632 PM5546.633097Cable Connector – 32R2.213
241820-MAR-04 04.18.21.862632 PM5546.643110KB 101/FR4520
241820-MAR-04 04.18.21.862632 PM5546.653140Screws <Z.16.S>2031
241820-MAR-04 04.18.21.862632 PM5546.663150Card Holder – 251737
Solution
SELECT
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total,
	oe.order_items.line_item_id,
	oe.order_items.product_id,
	oe.product_information.product_name,
	oe.order_items.unit_price,
	oe.order_items.quantity
FROM
	oe.orders
	INNER JOIN
	oe.order_items
		ON oe.orders.order_id = oe.order_items.order_id
	INNER JOIN
	oe.product_information
		ON oe.order_items.product_id = oe.product_information.product_id
WHERE
	oe.orders.order_date = (
		SELECT
			MIN(oe.orders.order_date) 
		FROM
			oe.orders
	)
ORDER BY
	oe.order_items.line_item_id;

Problem 21
Write a query that returns a result set containing details of each sales representative’s largest order based on order total. The result set should include the sales representative’s ID, the customer ID the representative made the sale to, order ID, and order total. Sort the result set by order total, descending.

Table(s) Required

oe.orders

Expected Output
SALES_REP_IDCUSTOMER_IDORDER_IDORDER_TOTAL
1611492434268651.8
153101245878279.6
155109244477727.2
156107244070576.9
163156239568501
158170241266816
159144243562303
154107244252471.9
160107241931574
Solution
SELECT
	oe.orders.sales_rep_id,
	oe.orders.customer_id,
	oe.orders.order_id,
	oe.orders.order_total
FROM
	oe.orders
	INNER JOIN (
	SELECT
		oe.orders.sales_rep_id,
		MAX(oe.orders.order_total) max_order_total
	FROM
		oe.orders
	GROUP BY
		oe.orders.sales_rep_id
	) max_order
		ON oe.orders.sales_rep_id = max_order.sales_rep_id
		AND oe.orders.order_total = max_order.max_order_total
ORDER BY
	oe.orders.order_total DESC;

Problem 22
Write a query that returns a result set containing the order ID, order date, and order total for each order. Instead of using the already existing order total column in the orders table, create a derived column that takes the sum of unit price multiplied by quantity for each line item in each order. If done properly, the derived column and the original order total column will contain the same value. Alias the derived column as “manual_order_total.” Sort the result set by the derived column, descending.

Table(s) Required

oe.orders
oe.order_items

Expected Output
ORDER_IDORDER_DATEORDER_TOTALMANUAL_ORDER_TOTAL
238508-DEC-07 11.34.11.331392 AM295892295892
238804-JUN-07 04.41.12.554435 PM282694.3282694.3
243413-SEP-07 05.49.30.647893 AM268651.8268651.8
236727-JUN-08 09.53.32.335522 PM144054.8144054.8
236113-NOV-07 01.34.21.986210 PM120131.3120131.3
237526-FEB-07 03.49.50.459233 AM103834.4103834.4
244627-JUL-07 07.03.08.302945 AM103679.3103679.3
235526-JAN-06 09.22.51.962632 AM94513.594513.5
236213-NOV-07 02.41.10.619477 PM92829.492829.4
237116-MAY-07 01.34.56.113356 AM79405.679405.6
245816-AUG-07 03.34.12.234359 PM78279.678279.6
244427-JUL-07 02.22.27.462632 PM77727.277727.2
242112-MAR-07 09.53.54.562432 PM7283672836
238214-MAY-08 10.19.03.828321 AM7117371173
244031-AUG-07 09.53.06.008765 PM70576.970576.9
240010-JUL-07 01.34.29.559387 AM69286.469286.4
239502-FEB-06 08.19.11.227550 PM6850168501
241229-MAR-06 10.22.09.509801 AM6681666816
243502-SEP-07 11.22.53.134567 PM6230362303
236826-JUN-08 10.19.43.190089 PM6006560065
235708-JAN-06 08.19.44.123456 PM59872.459872.4
238711-MAR-07 03.34.56.536966 PM52758.952758.9
244227-JUL-06 12.22.59.662632 PM52471.952471.9
242910-NOV-07 03.49.25.526321 AM5012550125
241329-MAR-08 01.34.04.525934 PM4855248552
239127-FEB-06 05.03.03.828330 PM48070.648070.6
235414-JUL-08 06.18.23.234567 PM4625746257
241024-MAY-08 10.19.51.985501 AM4517545175
239719-NOV-07 02.41.54.696211 PM42283.242283.2
237707-JUN-07 07.03.01.001100 AM38017.838017.8
236628-AUG-07 08.59.23.144778 PM37319.437319.4
238312-MAY-08 11.22.30.545103 AM36374.736374.7
239602-FEB-06 01.34.56.345678 AM3493034930
244727-JUL-08 08.59.10.223344 AM33893.633893.6
241920-MAR-07 07.03.32.764632 PM3157431574
242013-MAR-07 08.59.43.666320 PM2975029750
243002-OCT-07 06.18.36.663332 AM29669.929669.9
235626-JAN-08 09.22.41.934562 AM29473.829473.8
238412-MAY-08 12.22.34.525972 PM29249.129249.1
236528-AUG-07 07.03.34.003399 PM27455.327455.3
238016-MAY-07 09.53.02.909090 AM27132.627132.6
239221-JUL-07 08.59.57.571057 PM2663226632
237824-MAY-07 08.59.10.010101 AM25691.325691.3
239919-NOV-07 10.22.38.340990 PM25270.325270.3
239310-FEB-08 07.53.19.528202 PM23431.923431.9
238114-MAY-08 08.59.08.843679 PM23034.623034.6
243931-AUG-07 10.19.37.811132 AM22150.122150.1
239410-FEB-08 09.22.35.564789 PM2186321863
245731-OCT-07 11.22.16.162632 PM21586.221586.2
238606-DEC-07 12.22.34.225609 PM21116.921116.9
237916-MAY-07 02.22.24.234567 AM17848.217848.2
238904-JUN-08 05.49.43.546954 PM1762017620
237227-FEB-07 12.22.33.356789 AM16447.216447.2
241124-MAY-07 11.22.10.548639 AM15760.515760.5
242810-NOV-07 02.41.34.463567 AM14685.814685.8
245520-SEP-07 11.34.11.456789 AM14087.514087.5
242421-NOV-07 10.22.33.263332 AM1382413824
243701-SEP-06 08.59.15.826132 AM1355013550
245206-OCT-07 08.59.43.462632 PM1258912589
242216-DEC-07 08.19.55.462332 PM11188.511188.5
236926-JUN-07 11.22.54.009932 PM11097.411097.4
237607-JUN-07 06.18.08.883310 AM11006.211006.2
241429-MAR-07 02.22.40.536996 PM10794.610794.6
243214-SEP-07 09.53.40.223345 AM1052310523
245117-DEC-07 05.03.52.562632 PM10474.610474.6
242321-NOV-07 10.22.33.362632 AM10367.710367.7
236323-OCT-07 05.49.56.346122 PM10082.310082.3
236428-AUG-07 06.18.45.942399 PM95009500
242710-NOV-07 01.34.22.362124 AM90559055
235808-JAN-08 05.03.12.654278 PM78267826
239018-NOV-07 04.18.50.546851 PM7616.87616.8
242617-NOV-06 12.22.11.262552 AM72007200
239819-NOV-07 09.22.53.224175 PM7110.37110.3
245402-OCT-07 05.49.34.678340 PM6653.46653.4
243602-SEP-07 06.18.04.378034 AM6394.86394.8
243114-SEP-06 07.03.04.763452 AM5610.65610.6
241820-MAR-04 04.18.21.862632 PM5546.65546.6
235908-JAN-06 09.34.13.112233 PM5543.15543.1
244527-JUL-06 03.34.38.362632 PM5537.85537.8
243801-SEP-07 09.53.26.934626 AM54515451
237427-FEB-08 02.41.45.109654 AM47974797
245607-NOV-06 07.53.25.989889 PM3878.43878.4
244327-JUL-06 01.34.16.562632 PM36463646
240629-JUN-07 04.41.20.098765 AM2854.22854.2
240729-JUN-07 07.03.21.526005 AM25192519
244101-AUG-08 11.22.48.734526 AM2075.22075.2
241720-MAR-07 05.49.10.974352 PM1926.61926.6
245011-APR-07 06.18.10.362632 PM16361636
242516-NOV-06 11.34.22.162552 PM1500.81500.8
244818-JUN-07 04.41.49.262632 PM13881388
240501-JUL-07 04.49.13.678123 PM12331233
236014-NOV-07 12.22.31.223344 PM990.4990.4
240110-JUL-07 02.22.53.554822 AM969.2969.2
240202-JUL-07 03.34.44.665170 AM600600
240401-JUL-07 04.49.13.664085 PM510510
237327-FEB-08 01.34.51.220065 AM416416
241629-MAR-07 04.41.20.945676 PM384384
241529-MAR-06 01.34.50.545196 PM310310
240829-JUN-07 08.59.31.333617 AM309309
240301-JUL-07 04.49.13.615512 PM220220
245304-OCT-07 09.53.34.362632 PM129129
237027-JUN-08 12.22.11.647398 AM126126
244913-JUN-07 05.49.07.162632 PM8686
243313-SEP-07 10.19.00.654279 AM7878
240929-JUN-07 09.53.41.984501 AM4848
Solution
SELECT
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total,
	order_total.manual_order_total
FROM
	oe.orders
	INNER JOIN (
	SELECT
		oe.order_items.order_id,
		SUM(oe.order_items.unit_price * oe.order_items.quantity) AS manual_order_total
	FROM
		oe.order_items
	GROUP BY
		oe.order_items.order_id
	) order_total
		ON oe.orders.order_id = order_total.order_id
ORDER BY
	order_total.manual_order_total DESC;

Problem 23
Write a query that returns a result set containing the customer ID, order ID, and order date for each customer’s first and last order. If a customer has only made one order, then there should only be one row for the customer, otherwise two rows. Assign the same integer value to ties in order date. Use consecutive integers (e.g., 1, 1, 2, 3, 4, 4, 5). Alias any derived columns as you see fit. Sort the result set by customer ID, ascending.

Table(s) Required

oe.orders

Expected Output
CUSTOMER_IDORDER_IDORDER_DATEORDER_DATE_SEQUENCE_ASCORDER_DATE_SEQUENCE_DESC
101245816-AUG-07 03.34.12.234359 PM14
101244727-JUL-08 08.59.10.223344 AM41
102243114-SEP-06 07.03.04.763452 AM14
102239719-NOV-07 02.41.54.696211 PM41
103241529-MAR-06 01.34.50.545196 PM14
103245402-OCT-07 05.49.34.678340 PM41
104235526-JAN-06 09.22.51.962632 AM14
104235414-JUL-08 06.18.23.234567 PM41
105241720-MAR-07 05.49.10.974352 PM14
105235626-JAN-08 09.22.41.934562 AM41
106241820-MAR-04 04.18.21.862632 PM14
106244101-AUG-08 11.22.48.734526 AM41
107244227-JUL-06 12.22.59.662632 PM14
107236014-NOV-07 12.22.31.223344 PM41
108235708-JAN-06 08.19.44.123456 PM14
108236113-NOV-07 01.34.21.986210 PM41
109242112-MAR-07 09.53.54.562432 PM14
109239410-FEB-08 09.22.35.564789 PM41
116236926-JUN-07 11.22.54.009932 PM14
116242810-NOV-07 02.41.34.463567 AM41
117245607-NOV-06 07.53.25.989889 PM14
117237027-JUN-08 12.22.11.647398 AM41
118237116-MAY-07 01.34.56.113356 AM12
118245731-OCT-07 11.22.16.162632 PM21
119237227-FEB-07 12.22.33.356789 AM11
120237327-FEB-08 01.34.51.220065 AM11
121237427-FEB-08 02.41.45.109654 AM11
122237526-FEB-07 03.49.50.459233 AM11
123237607-JUN-07 06.18.08.883310 AM11
141237707-JUN-07 07.03.01.001100 AM11
142237824-MAY-07 08.59.10.010101 AM11
143238016-MAY-07 09.53.02.909090 AM11
144244527-JUL-06 03.34.38.362632 PM15
144238214-MAY-08 10.19.03.828321 AM51
145244818-JUN-07 04.41.49.262632 PM15
145238312-MAY-08 11.22.30.545103 AM51
146237916-MAY-07 02.22.24.234567 AM15
146238412-MAY-08 12.22.34.525972 PM51
147239602-FEB-06 01.34.56.345678 AM15
147238508-DEC-07 11.34.11.331392 AM51
148242617-NOV-06 12.22.11.262552 AM15
148236727-JUN-08 09.53.32.335522 PM51
149238711-MAR-07 03.34.56.536966 PM15
149236826-JUN-08 10.19.43.190089 PM51
150238804-JUN-07 04.41.12.554435 PM11
151238904-JUN-08 05.49.43.546954 PM11
152239018-NOV-07 04.18.50.546851 PM11
153239127-FEB-06 05.03.03.828330 PM11
154239221-JUL-07 08.59.57.571057 PM11
155239310-FEB-08 07.53.19.528202 PM11
156239502-FEB-06 08.19.11.227550 PM11
157239819-NOV-07 09.22.53.224175 PM11
158239919-NOV-07 10.22.38.340990 PM11
159240010-JUL-07 01.34.29.559387 AM11
160240110-JUL-07 02.22.53.554822 AM11
161240202-JUL-07 03.34.44.665170 AM11
162240301-JUL-07 04.49.13.615512 PM11
163240401-JUL-07 04.49.13.664085 PM11
164240501-JUL-07 04.49.13.678123 PM11
165240729-JUN-07 07.03.21.526005 AM11
166240829-JUN-07 08.59.31.333617 AM11
167240929-JUN-07 09.53.41.984501 AM11
168241024-MAY-08 10.19.51.985501 AM11
169241124-MAY-07 11.22.10.548639 AM11
170241229-MAR-06 10.22.09.509801 AM11
Solution
SELECT
	first_last_order.customer_id,
	first_last_order.order_id,
	first_last_order.order_date,
	first_last_order.order_date_sequence_asc,
	first_last_order.order_date_sequence_desc
FROM (
	SELECT
		oe.orders.customer_id,
        oe.orders.order_id,
        oe.orders.order_date,
        DENSE_RANK() OVER (
            PARTITION BY oe.orders.customer_id
            ORDER BY oe.orders.order_date
        ) AS order_date_sequence_asc,
        DENSE_RANK() OVER (
            PARTITION BY oe.orders.customer_id
            ORDER BY oe.orders.order_date DESC
        ) AS order_date_sequence_desc
	FROM
		oe.orders
) first_last_order
WHERE
	first_last_order.order_date_sequence_asc = 1
	OR first_last_order.order_date_sequence_desc = 1
ORDER BY
	first_last_order.customer_id;

Problem 24
Retrieve all orders placed with an order date equal to the most recent day a customer placed an order. Include the order ID, order date, customer ID, and order total.

Table(s) Required

oe.orders

Expected Output
ORDER_IDORDER_DATECUSTOMER_IDORDER_TOTAL
244101-AUG-08 11.22.48.734526 AM1062075.2
Solution
SELECT
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.customer_id,
	oe.orders.order_total
FROM
	oe.orders
WHERE
	oe.orders.order_date = (
		SELECT
			MAX(oe.orders.order_date)
		FROM
			oe.orders
	);

Problem 25
Retrieve the order(s) placed with the highest order total. Include the order ID, order date, order total, and customer ID.

Table(s) Required

oe.orders

Expected Output
ORDER_IDORDER_DATEORDER_TOTALCUSTOMER_ID
238508-DEC-07 11.34.11.331392 AM295892147
Solution
SELECT
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total,
	oe.orders.customer_id
FROM
	oe.orders
WHERE
	oe.orders.order_total = (
		SELECT
			MAX(oe.orders.order_total)
		FROM
			oe.orders
	);

Problem 26
Retrieve the order(s) with an order total greater than or equal to the average order total. Include the order ID, order date, order total, and customer ID. Sort the result set by order total, descending.

Table(s) Required

oe.orders

Expected Output
ORDER_IDORDER_DATEORDER_TOTALCUSTOMER_ID
238508-DEC-07 11.34.11.331392 AM295892147
238804-JUN-07 04.41.12.554435 PM282694.3150
243413-SEP-07 05.49.30.647893 AM268651.8149
236727-JUN-08 09.53.32.335522 PM144054.8148
236113-NOV-07 01.34.21.986210 PM120131.3108
237526-FEB-07 03.49.50.459233 AM103834.4122
244627-JUL-07 07.03.08.302945 AM103679.3117
235526-JAN-06 09.22.51.962632 AM94513.5104
236213-NOV-07 02.41.10.619477 PM92829.4109
237116-MAY-07 01.34.56.113356 AM79405.6118
245816-AUG-07 03.34.12.234359 PM78279.6101
244427-JUL-07 02.22.27.462632 PM77727.2109
242112-MAR-07 09.53.54.562432 PM72836109
238214-MAY-08 10.19.03.828321 AM71173144
244031-AUG-07 09.53.06.008765 PM70576.9107
240010-JUL-07 01.34.29.559387 AM69286.4159
239502-FEB-06 08.19.11.227550 PM68501156
241229-MAR-06 10.22.09.509801 AM66816170
243502-SEP-07 11.22.53.134567 PM62303144
236826-JUN-08 10.19.43.190089 PM60065149
235708-JAN-06 08.19.44.123456 PM59872.4108
238711-MAR-07 03.34.56.536966 PM52758.9149
244227-JUL-06 12.22.59.662632 PM52471.9107
242910-NOV-07 03.49.25.526321 AM50125117
241329-MAR-08 01.34.04.525934 PM48552101
239127-FEB-06 05.03.03.828330 PM48070.6153
235414-JUL-08 06.18.23.234567 PM46257104
241024-MAY-08 10.19.51.985501 AM45175168
239719-NOV-07 02.41.54.696211 PM42283.2102
237707-JUN-07 07.03.01.001100 AM38017.8141
236628-AUG-07 08.59.23.144778 PM37319.4147
238312-MAY-08 11.22.30.545103 AM36374.7145
Solution
SELECT
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total,
	oe.orders.customer_id
FROM
	oe.orders
WHERE
	oe.orders.order_total >= (
		SELECT
			AVG(oe.orders.order_total)
		FROM
			oe.orders
	)
ORDER BY
	oe.orders.order_total DESC;

Problem 27
Building onto your solution from problem 25, include the line-item ID(s), product ID(s), unit price for each line item, quantity for each line item, and the line-item total. Line-item total is defined as the quantity ordered multiplied by unit the price for the corresponding line-item. Alias this derived column as “line_item_total.” Your solution should include order ID, order date, order total, line-item ID, product ID, unit price, quantity, and line-item total.

Table(s) Required

oe.orders
oe.order_items

Expected Output
ORDER_IDORDER_DATEORDER_TOTALLINE_ITEM_IDPRODUCT_IDUNIT_PRICEQUANTITYLINE_ITEM_TOTAL
238508-DEC-07 11.34.11.331392 AM29589212289432008600
238508-DEC-07 11.34.11.331392 AM29589222302133.18711579.7
238508-DEC-07 11.34.11.331392 AM2958923231186.9968342.4
238508-DEC-07 11.34.11.331392 AM2958924231925972425
238508-DEC-07 11.34.11.331392 AM2958925233591.31069677.8
238508-DEC-07 11.34.11.331392 AM295892623502341.9109255267.1
Solution
SELECT
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total,
    oe.orders.customer_id,
	oe.order_items.line_item_id,
	oe.order_items.product_id,
	oe.order_items.unit_price,
	oe.order_items.quantity,
	oe.order_items.unit_price * oe.order_items.quantity AS line_item_total
FROM
	oe.orders
	INNER JOIN
	oe.order_items
		ON oe.orders.order_id = oe.order_items.order_id
WHERE
	oe.orders.order_total = (
		SELECT
			MAX(oe.orders.order_total)
		FROM
			oe.orders
	);

Problem 28
Retrieve the customer ID(s) and order total by customer for each customer. Only include customer(s) that have placed the most orders. For example, if the most orders placed by any single customer is 3, then include the customer ID(s) and sum of the order totals for those three orders in the output for each of the customers meeting the criteria. Alias the sum of the customer(s) order total(s) as “customer_order_total.” Sort the result set by customer order total, descending.

Table(s) Required

oe.orders

Expected Output
CUSTOMER_IDCUSTOMER_ORDER_TOTAL
149403119.7
147371278.2
148185700.5
144160284.6
14688462.6
14571717.9
Solution
SELECT
	oe.orders.customer_id,
	SUM(oe.orders.order_total) AS customer_order_total
FROM
	oe.orders
GROUP BY
	oe.orders.customer_id
HAVING
	COUNT(*) >= ALL (
		SELECT
			COUNT(*)
		FROM
			oe.orders
		GROUP BY
			oe.orders.customer_id
	)
ORDER BY
	customer_order_total DESC;

Problem 29
For each order, retrieve the customer ID, order ID, order total, minimum order total for the customer, and maximum order total for the customer. Alias the minimum and maximum order total as “min_order_total” and “max_order_total,” respectively. Only include customers that have placed more than 1 order. Sort the result set by customer ID (ascending) and order total (descending).

Table(s) Required

oe.orders

Expected Output
CUSTOMER_IDORDER_IDORDER_TOTALMIN_ORDER_TOTALMAX_ORDER_TOTAL
101245878279.629669.978279.6
10124134855229669.978279.6
101244733893.629669.978279.6
101243029669.929669.978279.6
102239742283.25610.642283.2
102241410794.65610.642283.2
1022432105235610.642283.2
10224315610.65610.642283.2
1032437135507813550
10324546653.47813550
10324153107813550
1032433787813550
104235594513.538494513.5
10423544625738494513.5
1042438545138494513.5
104241638438494513.5
105235629473.81926.629473.8
105243922150.11926.629473.8
105235878261926.629473.8
10524171926.61926.629473.8
106238123034.62075.223034.6
10624185546.62075.223034.6
10623595543.12075.223034.6
10624412075.22075.223034.6
107244070576.9990.470576.9
107244252471.9990.470576.9
107241931574990.470576.9
1072360990.4990.470576.9
1082361120131.33646120131.3
108235759872.43646120131.3
1082420297503646120131.3
108244336463646120131.3
109236292829.42186392829.4
109244477727.22186392829.4
1092421728362186392829.4
1092394218632186392829.4
116242814685.812914685.8
116236911097.412914685.8
11624366394.812914685.8
116245312912914685.8
1172446103679.3126103679.3
117242950125126103679.3
11724563878.4126103679.3
1172370126126103679.3
118237179405.621586.279405.6
118245721586.221586.279405.6
1442382711735537.871173
1442435623035537.871173
144242211188.55537.871173
144236310082.35537.871173
14424455537.85537.871173
145238336374.7138836374.7
145245514087.5138836374.7
145242310367.7138836374.7
14523649500138836374.7
14524481388138836374.7
146238429249.18629249.1
146236527455.38629249.1
146237917848.28629249.1
1462424138248629249.1
1462449868629249.1
14723852958921500.8295892
147236637319.41500.8295892
1472396349301500.8295892
147245016361500.8295892
14724251500.81500.8295892
1482367144054.82854.2144054.8
148238621116.92854.2144054.8
148245110474.62854.2144054.8
148242672002854.2144054.8
14824062854.22854.2144054.8
1492434268651.89055268651.8
1492368600659055268651.8
149238752758.99055268651.8
1492452125899055268651.8
149242790559055268651.8
Solution
SELECT
	oe.orders.customer_id,
	oe.orders.order_id,
	oe.orders.order_total,
	min_max_order.min_order_total,
	min_max_order.max_order_total
FROM
	oe.orders
	INNER JOIN (
	SELECT
		oe.orders.customer_id,
		MIN(oe.orders.order_total) AS min_order_total,
		MAX(oe.orders.order_total) AS max_order_total
	FROM
		oe.orders
	GROUP BY
		oe.orders.customer_id
	HAVING
		COUNT(oe.orders.customer_id) > 1
	) min_max_order
		ON oe.orders.customer_id = min_max_order.customer_id
ORDER BY
	oe.orders.customer_id,
	oe.orders.order_total DESC;

Problem 30
For each order, include the customer ID, customer first name, customer last name, order ID, order date, order total, line-item ID(s), product ID(s), unit price(s), and quantity. In each row, include the line-item count for the order. Line-item count is defined as the number of line-items in the order. Alias this derived column as “line_item_count.” Sort the result set by customer ID (ascending), order date (ascending), order ID (ascending), and line-item ID (ascending).

Table(s) Required

oe.customers
oe.orders
oe.order_items

Expected Output
CUSTOMER_IDCUST_FIRST_NAMECUST_LAST_NAMEORDER_IDORDER_DATEORDER_TOTALLINE_ITEM_IDLINE_ITEM_COUNTPRODUCT_IDUNIT_PRICEQUANTITY
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.616311738140
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.626312379112
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.6363127488.4114
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.646313417115
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.656314315129
101ConstantinWelles245816-AUG-07 03.34.12.234359 PM78279.666316332142
101ConstantinWelles243002-OCT-07 06.18.36.663332 AM29669.91533506936
101ConstantinWelles243002-OCT-07 06.18.36.663332 AM29669.9253353454.35
101ConstantinWelles243002-OCT-07 06.18.36.663332 AM29669.935335911110
101ConstantinWelles243002-OCT-07 06.18.36.663332 AM29669.94533629410
101ConstantinWelles243002-OCT-07 06.18.36.663332 AM29669.9553501492.843
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM4855217310877200
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM485522731127540
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM485523731173544
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM4855247312749244
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM485525731294645
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM485526731554762
101ConstantinWelles241329-MAR-08 01.34.04.525934 PM485527731633066
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.6192264199.129
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.629226629723
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.639227212124
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.64922785025
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.65922939734
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.66922997635
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.6792302133.137
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.68923085440
101ConstantinWelles244727-JUL-08 08.59.10.223344 AM33893.69923119344
102HarrisonPacino243114-SEP-06 07.03.04.763452 AM5610.61630972.23
102HarrisonPacino243114-SEP-06 07.03.04.763452 AM5610.6263106481
102HarrisonPacino243114-SEP-06 07.03.04.763452 AM5610.63631141013
102HarrisonPacino243114-SEP-06 07.03.04.763452 AM5610.6463117417
102HarrisonPacino243114-SEP-06 07.03.04.763452 AM5610.65631274989
102HarrisonPacino243114-SEP-06 07.03.04.763452 AM5610.66631294411
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.61732081.18
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.6273216307
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.6373220419
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.64732343911
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.6573246212.318
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.6673253206.823
102HarrisonPacino241429-MAR-07 02.22.40.536996 PM10794.67732605024
102HarrisonPacino243214-SEP-07 09.53.40.223345 AM10523142976493
102HarrisonPacino243214-SEP-07 09.53.40.223345 AM10523242982432
102HarrisonPacino243214-SEP-07 09.53.40.223345 AM105233429861225
102HarrisonPacino243214-SEP-07 09.53.40.223345 AM1052344299988011
102HarrisonPacino239719-NOV-07 02.41.54.696211 PM42283.2142976522
102HarrisonPacino239719-NOV-07 02.41.54.696211 PM42283.22429861208
102HarrisonPacino239719-NOV-07 02.41.54.696211 PM42283.234299988016
102HarrisonPacino239719-NOV-07 02.41.54.696211 PM42283.24430001696.216
103ManishaTaylor241529-MAR-06 01.34.50.545196 PM310112751625
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM13550162423838
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM13550262430157.34
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM135503624574.417
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM135504624627619
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM135505624646421
103ManishaTaylor243701-SEP-06 08.59.15.826132 AM13550662496268.435
103ManishaTaylor243313-SEP-07 10.19.00.654279 AM78111910136
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.417228943120
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.4272293990
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.4372299713
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.44723085512
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.45723162113
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.46723231816
103ManishaTaylor245402-OCT-07 05.49.34.678340 PM6653.47723343.318
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.519228946200
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.529230857185
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.539231186.9188
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.549232219188
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.559232317190
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.56923261.1192
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.57923301.1197
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.589233925199
104HarrisonSutherland235526-JAN-06 09.22.51.962632 AM94513.5992359226.6204
104HarrisonSutherland241629-MAR-07 04.41.20.945676 PM3841228704.410
104HarrisonSutherland241629-MAR-07 04.41.20.945676 PM3842228783401
104HarrisonSutherland243801-SEP-07 09.53.26.934626 AM5451122995693
104HarrisonSutherland243801-SEP-07 09.53.26.934626 AM545122300017483
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625711331064861
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM46257213311496.843
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625731331237947
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625741331294147
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625751331392148
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625761331431653
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625771331501758
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625781331633061
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625791331653764
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM46257101331675168
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625711133170145.270
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM4625712133176113.372
104HarrisonSutherland235414-JUL-08 06.18.23.234567 PM46257131331826177
105MatthiasMacGraw241720-MAR-07 05.49.10.974352 PM1926.61228704.49
105MatthiasMacGraw241720-MAR-07 05.49.10.974352 PM1926.62229765137
105MatthiasMacGraw243931-AUG-07 10.19.37.811132 AM22150.1141797316.89
105MatthiasMacGraw243931-AUG-07 10.19.37.811132 AM22150.1241806454
105MatthiasMacGraw243931-AUG-07 10.19.37.811132 AM22150.1341820549
105MatthiasMacGraw243931-AUG-07 10.19.37.811132 AM22150.14418221433.313
105MatthiasMacGraw235808-JAN-08 05.03.12.654278 PM7826151781226.69
105MatthiasMacGraw235808-JAN-08 05.03.12.654278 PM78262517821254
105MatthiasMacGraw235808-JAN-08 05.03.12.654278 PM7826351797316.812
105MatthiasMacGraw235808-JAN-08 05.03.12.654278 PM78264518035513
105MatthiasMacGraw235808-JAN-08 05.03.12.654278 PM78265518085514
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.8182264199.138
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.8282274148.534
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.83822939840
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.84822997244
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.85823085847
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.86823119551
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.87823162255
105MatthiasMacGraw235626-JAN-08 09.22.41.934562 AM29473.88823231855
106MatthiasHannah241820-MAR-04 04.18.21.862632 PM5546.61630827515
106MatthiasHannah241820-MAR-04 04.18.21.862632 PM5546.626309018712
106MatthiasHannah241820-MAR-04 04.18.21.862632 PM5546.63630972.213
106MatthiasHannah241820-MAR-04 04.18.21.862632 PM5546.64631104520
106MatthiasHannah241820-MAR-04 04.18.21.862632 PM5546.65631402031
106MatthiasHannah241820-MAR-04 04.18.21.862632 PM5546.66631501737
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.1172337270.61
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.12723592491
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.13723709117
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.1472373617
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.15723779617
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.16723805.517
106MatthiasHannah235908-JAN-06 09.34.13.112233 PM5543.17723819717
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.618311738110
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.62831247744
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.63831334444
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.64831392045
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.65831431548
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.66831633555
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.6783176113.362
106MatthiasHannah238114-MAY-08 08.59.08.843679 PM23034.68831834763
106MatthiasHannah244101-AUG-08 11.22.48.734526 AM2075.2122536809
106MatthiasHannah244101-AUG-08 11.22.48.734526 AM2075.2222537193.67
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.918240212726
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.9282410350.921
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.93824186023
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.948242214425
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.958243017328
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.9682439115.530
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.9782459624.840
107MatthiasCruise244227-JUL-06 12.22.59.662632 PM52471.98824678044
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM3157419310646150
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM315742931149945
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM3157439312371.548
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM315744931294357
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM315745931334561
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM315746931501769
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM315747931554772
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM315748931653576
107MatthiasCruise241920-MAR-07 07.03.32.764632 PM315749931675481
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.911122894819
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.92112293982
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.931123021502
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.9411231186.97
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.951123222310
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.961123301.113
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.971123343.315
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.98112337270.619
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.991123392523
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.9101123502341.924
107MatthiasCruise244031-AUG-07 09.53.06.008765 PM70576.911112359226.628
107MatthiasCruise236014-NOV-07 12.22.31.223344 PM990.41220582329
107MatthiasCruise236014-NOV-07 12.22.31.223344 PM990.42220937.742
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.41822113.3140
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.428224546226
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.4382252788.726
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.4482257371.829
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.45822629529
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.46822687532
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.4782276236.538
108MeenakshiMason235708-JAN-06 08.19.44.123456 PM59872.48822894841
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM3646183106443
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM36462831141012
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM3646383124826
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM36464831392012
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM36465831431517
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM36466831501817
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM36467831554321
108MeenakshiMason244327-JUL-06 01.34.16.562632 PM36468831653631
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM29750110310646110
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM2975021031104611
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM29750310311410115
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM2975041031237920
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM29750510312749622
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM2975061031334829
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM2975071031401934
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM2975081031431539
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM2975091031633045
108MeenakshiMason242013-MAR-07 08.59.43.666320 PM297501010317113247
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.319228946180
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.329229976180
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.339230853182
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.349231186.9185
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.359231622187
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.36923261.1194
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.37923343.3198
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.3892359248208
108MeenakshiMason236113-NOV-07 01.34.21.986210 PM120131.399236576209
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283619310646160
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283629310878160
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283639311272164
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283649311741165
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283659312380168
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283669312943172
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283679314315176
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283689315017176
109ChristianCage242112-MAR-07 09.53.54.562432 PM7283699315543185
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.2111311736110
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.22113127488.488
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.231131334390
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.241131392193
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.251131401995
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.261131431597
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.2711315017100
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.2811315543104
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.2911316537112
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.21011317237112
109ChristianCage244427-JUL-07 02.22.27.462632 PM77727.21111318263115
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.418228948200
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.428229976160
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.438231193164
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.448231622168
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.45823261.1173
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.46823343.3177
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.478233925179
109ChristianCage236213-NOV-07 02.41.10.619477 PM92829.4882359248189
109ChristianCage239410-FEB-08 09.22.35.564789 PM218631931174190
109ChristianCage239410-FEB-08 09.22.35.564789 PM218632931237736
109ChristianCage239410-FEB-08 09.22.35.564789 PM218633931248239
109ChristianCage239410-FEB-08 09.22.35.564789 PM218634931294641
109ChristianCage239410-FEB-08 09.22.35.564789 PM218635931334645
109ChristianCage239410-FEB-08 09.22.35.564789 PM218636931341845
109ChristianCage239410-FEB-08 09.22.35.564789 PM218637931401948
109ChristianCage239410-FEB-08 09.22.35.564789 PM218638931554961
109ChristianCage239410-FEB-08 09.22.35.564789 PM218639931675268
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.4193150183
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.4293155431
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.4393163325
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.44931653410
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.4593170145.224
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.4693176113.324
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.47931872.224
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.48931932.228
116GeraldineMartin236926-JUN-07 11.22.54.009932 PM11097.499320412334
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.81832081.18
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.8283209132
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.8383216303
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.8483224326
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.8583245214.516
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.86832502718
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.87832563618
116GeraldineMartin243602-SEP-07 06.18.04.378034 AM6394.88832906324
116GeraldineMartin245304-OCT-07 09.53.34.362632 PM129112492433
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.81113106427
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.82113108761
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.831131141015
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.84113117416
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.85113123808
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.8611312749812
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.871131334812
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.881131431613
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.891131501716
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.810113170145.224
116GeraldineMartin242810-NOV-07 02.41.34.463567 AM14685.8111131738628
117GuillaumeEdwards245607-NOV-06 07.53.25.989889 PM3878.4122522405
117GuillaumeEdwards245607-NOV-06 07.53.25.989889 PM3878.4222537193.619
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.31522894847
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.32523261.134
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.33523301.136
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.3452337270.637
117GuillaumeEdwards244627-JUL-07 07.03.08.302945 AM103679.35523502341.939
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM50125110310642200
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM5012521031087640
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM5012531031104543
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM5012541031237946
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM50125510312749749
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM5012561031334652
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM5012571031392154
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM5012581031501755
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM5012591031633063
117GuillaumeEdwards242910-NOV-07 03.49.25.526321 AM50125101031653667
117GuillaumeEdwards237027-JUN-08 12.22.11.647398 AM126111910149
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.61822741576
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.6282293968
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.63822997315
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.64823162121
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.65823231724
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.66823343.326
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.67823392529
118MauriceMahoney237116-MAY-07 01.34.56.113356 AM79405.68823502341.932
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.21731087236
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.22731237914
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.2373127488.417
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.24731501727
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.25731554432
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.2673170145.242
118MauriceMahoney245731-OCT-07 11.22.16.162632 PM21586.27731723645
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.21103106486
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.22103108742
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.23103110427
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.241031238110
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.2510312749613
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.261031341717
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.271031431521
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.281031633030
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.291031675432
119MauriceHasan237227-FEB-07 12.22.33.356789 AM16447.210103170145.236
120DianeHiggins237327-FEB-08 01.34.51.220065 AM416121820498
120DianeHiggins237327-FEB-08 01.34.51.220065 AM416221825241
121DianneSen237427-FEB-08 02.41.45.109654 AM479714242215010
121DianneSen237427-FEB-08 02.41.45.109654 AM4797242423786
121DianneSen237427-FEB-08 02.41.45.109654 AM47973424497815
121DianneSen237427-FEB-08 02.41.45.109654 AM47974424677921
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.4113310642140
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.421331127184
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.431331173885
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.44133127488.486
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.451331334588
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.461331341790
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.471331431593
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.481331501793
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.491331554598
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.4101331633099
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.41113316536103
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.412133171132107
122MauriceDaltrey237526-FEB-07 03.49.50.459233 AM103834.413133176120109
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.211022706014
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.22102276236.54
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.231022939913
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.241022997317
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.25102302133.121
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.261023119525
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.271023162127
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.281023192532
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.291023261.133
123ElizabethBrown237607-JUN-07 06.18.08.883310 AM11006.2101023343.336
141MaximilianHenner237707-JUN-07 07.03.01.001100 AM38017.816228942130
141MaximilianHenner237707-JUN-07 07.03.01.001100 AM38017.8262302147119
141MaximilianHenner237707-JUN-07 07.03.01.001100 AM38017.836231195121
141MaximilianHenner237707-JUN-07 07.03.01.001100 AM38017.846231925131
141MaximilianHenner237707-JUN-07 07.03.01.001100 AM38017.85623261.1132
141MaximilianHenner237707-JUN-07 07.03.01.001100 AM38017.86623301.1136
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.3182403113.320
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.3282412952
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.3382414438.97
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.34824172711
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.35824237911
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.3682424217.815
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.37824574.425
142SachinSpielberg237824-MAY-07 08.59.10.010101 AM25691.3882459624.825
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.611331064226
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.621331087518
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.631331173823
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.64133127488.424
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.651331334628
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.661331402030
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.671331431531
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.681331501733
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.691331554533
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.6101331633236
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.6111331675237
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.612133176113.340
143SachinNeeson238016-MAY-07 09.53.02.909090 AM27132.6131331872.240
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.8172270665
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.8272278493
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.83722939711
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.84722997214
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.85723119524
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.86723192527
144SivajiLandis244527-JUL-06 03.34.38.362632 PM5537.87723261.128
144SivajiLandis243502-SEP-07 11.22.53.134567 PM623031922894835
144SivajiLandis243502-SEP-07 11.22.53.134567 PM62303292299754
144SivajiLandis243502-SEP-07 11.22.53.134567 PM6230339231186.98
144SivajiLandis243502-SEP-07 11.22.53.134567 PM623034923162110
144SivajiLandis243502-SEP-07 11.22.53.134567 PM623035923231812
144SivajiLandis243502-SEP-07 11.22.53.134567 PM623036923343.314
144SivajiLandis243502-SEP-07 11.22.53.134567 PM623037923392519
144SivajiLandis243502-SEP-07 11.22.53.134567 PM623038923502341.924
144SivajiLandis243502-SEP-07 11.22.53.134567 PM623039923657533
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.3192264199.19
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.32922721297
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.33922997425
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.34923085726
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.359231186.929
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.36923192431
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.37923231834
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.38923261.137
144SivajiLandis236323-OCT-07 05.49.56.346122 PM10082.39923343.342
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.51931064618
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.5293117415
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.539312371.55
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.54931274969
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.55931334611
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.56931501725
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.57931554329
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.58931633035
144SivajiLandis242216-DEC-07 08.19.55.462332 PM11188.59931675439
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173111310642160
144SivajiLandis238214-MAY-08 10.19.03.828321 AM7117321131104364
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173311311410065
144SivajiLandis238214-MAY-08 10.19.03.828321 AM7117341131173566
144SivajiLandis238214-MAY-08 10.19.03.828321 AM7117351131237971
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173611312749671
144SivajiLandis238214-MAY-08 10.19.03.828321 AM7117371131294276
144SivajiLandis238214-MAY-08 10.19.03.828321 AM7117381131392179
144SivajiLandis238214-MAY-08 10.19.03.828321 AM7117391131431582
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173101131632989
144SivajiLandis238214-MAY-08 10.19.03.828321 AM71173111131653792
145MammuttiPacino244818-JUN-07 04.41.49.262632 PM1388163106443
145MammuttiPacino244818-JUN-07 04.41.49.262632 PM1388263114990
145MammuttiPacino244818-JUN-07 04.41.49.262632 PM13883631334211
145MammuttiPacino244818-JUN-07 04.41.49.262632 PM13884631341714
145MammuttiPacino244818-JUN-07 04.41.49.262632 PM13885631392015
145MammuttiPacino244818-JUN-07 04.41.49.262632 PM13886631431616
145MammuttiPacino236428-AUG-07 06.18.45.942399 PM9500121910146
145MammuttiPacino236428-AUG-07 06.18.45.942399 PM9500221948470.820
145MammuttiPacino245520-SEP-07 11.34.11.456789 AM14087.5132471482.93
145MammuttiPacino245520-SEP-07 11.34.11.456789 AM14087.5232496268.432
145MammuttiPacino245520-SEP-07 11.34.11.456789 AM14087.53325367554
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.7173220398
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.7273224323
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.7373245214.513
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.7473246212.314
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.75732512616
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.76732587821
145MammuttiPacino242321-NOV-07 10.22.33.362632 AM10367.77732906533
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.7172409194.737
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.72724185645
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.737242214646
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.747243017450
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.7572439115.554
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.76724574.462
145MammuttiPacino238312-MAY-08 11.22.30.545103 AM36374.77724627563
146EliaFawcett237916-MAY-07 02.22.24.234567 AM17848.21531064292
146EliaFawcett237916-MAY-07 02.22.24.234567 AM17848.22531149814
146EliaFawcett237916-MAY-07 02.22.24.234567 AM17848.2353127488.423
146EliaFawcett237916-MAY-07 02.22.24.234567 AM17848.24531392134
146EliaFawcett237916-MAY-07 02.22.24.234567 AM17848.25531401935
146EliaFawcett244913-JUN-07 05.49.07.162632 PM86112522432
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.311222894892
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.321222939928
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.33122302133.129
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.341223085629
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.351223119529
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.361223162234
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.371223192438
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.381223221943
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.391223261.144
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.3101223359745
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.3111223392550
146EliaFawcett236528-AUG-07 07.03.34.003399 PM27455.3121223407254
146EliaFawcett242421-NOV-07 10.22.33.263332 AM1382413335069311
146EliaFawcett242421-NOV-07 10.22.33.263332 AM138242333545419
146EliaFawcett242421-NOV-07 10.22.33.263332 AM1382433335911112
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.11622894395
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.12622997148
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.13623162158
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.14623222259
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.15623301.161
146EliaFawcett238412-MAY-08 12.22.34.525972 PM29249.166235924977
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM3493018310644150
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM349302831087675
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM349303831104479
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM3493048311410083
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM349305831401993
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM349306831501793
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM349307831554798
147IshwaryaRoberts239602-FEB-06 01.34.56.345678 AM3493088316329100
147IshwaryaRoberts242516-NOV-06 11.34.22.162552 PM1500.8133501492.83
147IshwaryaRoberts242516-NOV-06 11.34.22.162552 PM1500.823351192
147IshwaryaRoberts242516-NOV-06 11.34.22.162552 PM1500.83335151.14
147IshwaryaRoberts245011-APR-07 06.18.10.362632 PM16361631911.14
147IshwaryaRoberts245011-APR-07 06.18.10.362632 PM16362631932.23
147IshwaryaRoberts245011-APR-07 06.18.10.362632 PM1636363197445
147IshwaryaRoberts245011-APR-07 06.18.10.362632 PM16364632162911
147IshwaryaRoberts245011-APR-07 06.18.10.362632 PM16365632204114
147IshwaryaRoberts245011-APR-07 06.18.10.362632 PM16366632243216
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.41102359226.68
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.4210237367
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.43102382804.110
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.44102394116.611
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.4510239512012
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.4610240041816
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.47102406195.820
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.48102409194.722
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.49102415339.924
147IshwaryaRoberts236628-AUG-07 08.59.23.144778 PM37319.4101024196924
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM29589216228943200
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM295892262302133.187
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM29589236231186.996
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM2958924623192597
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM29589256233591.3106
147IshwaryaRoberts238508-DEC-07 11.34.11.331392 AM2958926623502341.9109
148GustavSteenburgen242617-NOV-06 12.22.11.262552 AM72001531932.26
148GustavSteenburgen242617-NOV-06 12.22.11.262552 AM72002532163011
148GustavSteenburgen242617-NOV-06 12.22.11.262552 AM72003532343418
148GustavSteenburgen242617-NOV-06 12.22.11.262552 AM7200453248212.326
148GustavSteenburgen242617-NOV-06 12.22.11.262552 AM72005532522529
148GustavSteenburgen240629-JUN-07 04.41.20.098765 AM2854.2142721855
148GustavSteenburgen240629-JUN-07 04.41.20.098765 AM2854.22427253.34
148GustavSteenburgen240629-JUN-07 04.41.20.098765 AM2854.23427612619
148GustavSteenburgen240629-JUN-07 04.41.20.098765 AM2854.24427826231
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.91823301.17
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.92823343.35
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.93823407114
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.94823657727
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.95823709028
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.96823757332
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.9782378271.733
148GustavSteenburgen238606-DEC-07 12.22.34.225609 PM21116.9882394116.636
148GustavSteenburgen245117-DEC-07 05.03.52.562632 PM10474.6121910139
148GustavSteenburgen245117-DEC-07 05.03.52.562632 PM10474.6221948470.822
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.81822894899
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.828230214732
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.83823085439
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.84823222245
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.85823261.148
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.86823301.152
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.878233591.354
148GustavSteenburgen236727-JUN-08 09.53.32.335522 PM144054.88823502341.954
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.91622113.352
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.9262243332.220
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.936224546222
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.9462252788.727
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.9562253354.232
149MarkusRampling238711-MAR-07 03.34.56.536966 PM52758.96622687542
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.81722113.381
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.8272236949.384
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.837224546286
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.8472252788.787
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.8572254408.192
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.8672257371.894
149MarkusRampling243413-SEP-07 05.49.30.647893 AM268651.877226875104
149MarkusRampling245206-OCT-07 08.59.43.462632 PM1258919311738140
149MarkusRampling245206-OCT-07 08.59.43.462632 PM125892931392010
149MarkusRampling245206-OCT-07 08.59.43.462632 PM125893931431512
149MarkusRampling245206-OCT-07 08.59.43.462632 PM125894931501713
149MarkusRampling245206-OCT-07 08.59.43.462632 PM125895931554413
149MarkusRampling245206-OCT-07 08.59.43.462632 PM125896931653418
149MarkusRampling245206-OCT-07 08.59.43.462632 PM12589793170145.220
149MarkusRampling245206-OCT-07 08.59.43.462632 PM125898931723720
149MarkusRampling245206-OCT-07 08.59.43.462632 PM125899931738023
149MarkusRampling242710-NOV-07 01.34.22.362124 AM905517243017312
149MarkusRampling242710-NOV-07 01.34.22.362124 AM90552724391211
149MarkusRampling242710-NOV-07 01.34.22.362124 AM90553724574.46
149MarkusRampling242710-NOV-07 01.34.22.362124 AM9055472464666
149MarkusRampling242710-NOV-07 01.34.22.362124 AM9055572470766
149MarkusRampling242710-NOV-07 01.34.22.362124 AM9055672496268.419
149MarkusRampling242710-NOV-07 01.34.22.362124 AM90557725224022
149MarkusRampling236826-JUN-08 10.19.43.190089 PM6006518310648150
149MarkusRampling236826-JUN-08 10.19.43.190089 PM600652831104260
149MarkusRampling236826-JUN-08 10.19.43.190089 PM600653831173862
149MarkusRampling236826-JUN-08 10.19.43.190089 PM600654831238170
149MarkusRampling236826-JUN-08 10.19.43.190089 PM6006558312749670
149MarkusRampling236826-JUN-08 10.19.43.190089 PM600656831294272
149MarkusRampling236826-JUN-08 10.19.43.190089 PM600657831431675
149MarkusRampling236826-JUN-08 10.19.43.190089 PM600658831554575
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.315228943150
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.32522939490
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.33523085696
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.34523301.1105
150GoldieSlater238804-JUN-07 04.41.12.554435 PM282694.35523502341.9112
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM1762018310643180
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM176202831127318
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM176203831238021
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM176204831294622
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM176205831431530
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM176206831554633
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM176207831653443
151DivineAykroyd238904-JUN-08 05.49.43.546954 PM176208831675247
152DieterMatthau239018-NOV-07 04.18.50.546851 PM7616.8131910144
152DieterMatthau239018-NOV-07 04.18.50.546851 PM7616.8231912142
152DieterMatthau239018-NOV-07 04.18.50.546851 PM7616.8331948470.816
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.61717871015
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.6271791262.93
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.63717973487
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.6471799961.410
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.65718085515
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.66718205218
153DivineSheen239127-FEB-06 05.03.03.828330 PM48070.67718221433.323
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266321931064363
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266322931127357
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266323931173858
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266324931247763
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266325931334566
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266326931392168
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266327931501872
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266328931554977
154FredericGrodin239221-JUL-07 08.59.57.571057 PM266329931654081
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.911130511210
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.921130602952
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.9311306410175
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.941130693858
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.95113077260.78
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.961130827810
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.9711308621113
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.98113087108.914
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.9911309127819
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.9101130993.319
155FredericoRomero239310-FEB-08 07.53.19.528202 PM23431.91111310869.330
156GoldieMontand239502-FEB-06 08.19.11.227550 PM685011722113.3110
156GoldieMontand239502-FEB-06 08.19.11.227550 PM68501272243332.227
156GoldieMontand239502-FEB-06 08.19.11.227550 PM68501372252788.730
156GoldieMontand239502-FEB-06 08.19.11.227550 PM68501472255690.834
156GoldieMontand239502-FEB-06 08.19.11.227550 PM68501572264199.134
156GoldieMontand239502-FEB-06 08.19.11.227550 PM685016722687137
156GoldieMontand239502-FEB-06 08.19.11.227550 PM685017722706441
157SidneyCapshaw239819-NOV-07 09.22.53.224175 PM7110.3132471482.95
157SidneyCapshaw239819-NOV-07 09.22.53.224175 PM7110.3232537193.623
157SidneyCapshaw239819-NOV-07 09.22.53.224175 PM7110.3332594927
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.3111228944120
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.321122939412
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.331122997615
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.3411230214917
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.351123085617
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.3611231186.920
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.371123162224
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.381123261.127
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.391123301.128
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.31011233510033
158FredericoLyon239919-NOV-07 10.22.38.340990 PM25270.311112359226.638
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.4152976524
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.4252982411
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.43529861234
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.445299988016
159EddieBoyer240010-JUL-07 01.34.29.559387 AM69286.45530032866.619
160EddieStern240110-JUL-07 02.22.53.554822 AM969.2122492414
160EddieStern240110-JUL-07 02.22.53.554822 AM969.2222496268.43
161ErnestWeaver240202-JUL-07 03.34.44.665170 AM600112536758
162ErnestGeorge240301-JUL-07 04.49.13.615512 PM220112522445
163ErnestChandar240401-JUL-07 04.49.13.664085 PM510122721856
163ErnestChandar240401-JUL-07 04.49.13.664085 PM510222808037
164CharlotteKazan240501-JUL-07 04.49.13.678123 PM12331126381379
165CharlotteFonda240729-JUN-07 07.03.21.526005 AM2519132721855
165CharlotteFonda240729-JUN-07 07.03.21.526005 AM25192327528618
165CharlotteFonda240729-JUN-07 07.03.21.526005 AM25193327612621
166DheerajAlexander240829-JUN-07 08.59.31.333617 AM309132751613
166DheerajAlexander240829-JUN-07 08.59.31.333617 AM309232761261
166DheerajAlexander240829-JUN-07 08.59.31.333617 AM3093327831010
167GerardHershey240929-JUN-07 09.53.41.984501 AM4811281068
168HemaVoight241024-MAY-08 10.19.51.985501 AM451751629764610
168HemaVoight241024-MAY-08 10.19.51.985501 AM45175262982405
168HemaVoight241024-MAY-08 10.19.51.985501 AM451753629861206
168HemaVoight241024-MAY-08 10.19.51.985501 AM45175462995688
168HemaVoight241024-MAY-08 10.19.51.985501 AM451755630032866.615
168HemaVoight241024-MAY-08 10.19.51.985501 AM451756630511221
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.51123082812
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.521230862082
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.531230972.26
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.541230993.37
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.55123101738
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.561231064511
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.571231127217
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.581231237517
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.591231248417
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.510123127488.418
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.5111231334323
169DheerajDavis241124-MAY-07 11.22.10.548639 AM15760.5121231431524
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM6681619310646170
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM668162931149868
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM6681639312371.568
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM6681649312749272
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM668165931341875
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM668166931392079
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM668167931431680
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM668168931633092
170Harry DeanFonda241229-MAR-06 10.22.09.509801 AM668169931675494
Solution
SELECT
	oe.customers.customer_id,
	oe.customers.cust_first_name,
	oe.customers.cust_last_name,
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total,
	oe.order_items.line_item_id,
	line_item.line_item_count,
	oe.order_items.product_id,
	oe.order_items.unit_price,
	oe.order_items.quantity
FROM
	oe.customers
	INNER JOIN
	oe.orders
		ON oe.customers.customer_id = oe.orders.customer_id
	INNER JOIN
	oe.order_items
		ON oe.orders.order_id = oe.order_items.order_id
	INNER JOIN (
	SELECT
		oe.order_items.order_id,
		COUNT(*) AS line_item_count
	FROM
		oe.order_items
	GROUP BY
		oe.order_items.order_id
	) line_item
		ON oe.orders.order_id = line_item.order_id
ORDER BY
	oe.orders.customer_id,
	oe.orders.order_date,
	oe.order_items.order_id,
	oe.order_items.line_item_id;

Problem 31
For each order, retrieve the customer ID, order ID, order date, and order total. In addition to this data, create a derived column that assigns an integer value based on the order date for each customer’s orders. The value of 1 should be assigned to the customer’s first order placed, 2 to the second order placed, and so on. Alias this column as “order_date_sequence.” Assign the same integer value to ties in order date. Use consecutive integers (e.g., 1, 1, 2, 3, 4, 4, 5). Sort the result set by customer ID (ascending) and order date (ascending).

Table(s) Required

oe.orders

Expected Output
CUSTOMER_IDORDER_IDORDER_DATEORDER_TOTALORDER_DATE_SEQUENCE
101245816-AUG-07 03.34.12.234359 PM78279.61
101243002-OCT-07 06.18.36.663332 AM29669.92
101241329-MAR-08 01.34.04.525934 PM485523
101244727-JUL-08 08.59.10.223344 AM33893.64
102243114-SEP-06 07.03.04.763452 AM5610.61
102241429-MAR-07 02.22.40.536996 PM10794.62
102243214-SEP-07 09.53.40.223345 AM105233
102239719-NOV-07 02.41.54.696211 PM42283.24
103241529-MAR-06 01.34.50.545196 PM3101
103243701-SEP-06 08.59.15.826132 AM135502
103243313-SEP-07 10.19.00.654279 AM783
103245402-OCT-07 05.49.34.678340 PM6653.44
104235526-JAN-06 09.22.51.962632 AM94513.51
104241629-MAR-07 04.41.20.945676 PM3842
104243801-SEP-07 09.53.26.934626 AM54513
104235414-JUL-08 06.18.23.234567 PM462574
105241720-MAR-07 05.49.10.974352 PM1926.61
105243931-AUG-07 10.19.37.811132 AM22150.12
105235808-JAN-08 05.03.12.654278 PM78263
105235626-JAN-08 09.22.41.934562 AM29473.84
106241820-MAR-04 04.18.21.862632 PM5546.61
106235908-JAN-06 09.34.13.112233 PM5543.12
106238114-MAY-08 08.59.08.843679 PM23034.63
106244101-AUG-08 11.22.48.734526 AM2075.24
107244227-JUL-06 12.22.59.662632 PM52471.91
107241920-MAR-07 07.03.32.764632 PM315742
107244031-AUG-07 09.53.06.008765 PM70576.93
107236014-NOV-07 12.22.31.223344 PM990.44
108235708-JAN-06 08.19.44.123456 PM59872.41
108244327-JUL-06 01.34.16.562632 PM36462
108242013-MAR-07 08.59.43.666320 PM297503
108236113-NOV-07 01.34.21.986210 PM120131.34
109242112-MAR-07 09.53.54.562432 PM728361
109244427-JUL-07 02.22.27.462632 PM77727.22
109236213-NOV-07 02.41.10.619477 PM92829.43
109239410-FEB-08 09.22.35.564789 PM218634
116236926-JUN-07 11.22.54.009932 PM11097.41
116243602-SEP-07 06.18.04.378034 AM6394.82
116245304-OCT-07 09.53.34.362632 PM1293
116242810-NOV-07 02.41.34.463567 AM14685.84
117245607-NOV-06 07.53.25.989889 PM3878.41
117244627-JUL-07 07.03.08.302945 AM103679.32
117242910-NOV-07 03.49.25.526321 AM501253
117237027-JUN-08 12.22.11.647398 AM1264
118237116-MAY-07 01.34.56.113356 AM79405.61
118245731-OCT-07 11.22.16.162632 PM21586.22
119237227-FEB-07 12.22.33.356789 AM16447.21
120237327-FEB-08 01.34.51.220065 AM4161
121237427-FEB-08 02.41.45.109654 AM47971
122237526-FEB-07 03.49.50.459233 AM103834.41
123237607-JUN-07 06.18.08.883310 AM11006.21
141237707-JUN-07 07.03.01.001100 AM38017.81
142237824-MAY-07 08.59.10.010101 AM25691.31
143238016-MAY-07 09.53.02.909090 AM27132.61
144244527-JUL-06 03.34.38.362632 PM5537.81
144243502-SEP-07 11.22.53.134567 PM623032
144236323-OCT-07 05.49.56.346122 PM10082.33
144242216-DEC-07 08.19.55.462332 PM11188.54
144238214-MAY-08 10.19.03.828321 AM711735
145244818-JUN-07 04.41.49.262632 PM13881
145236428-AUG-07 06.18.45.942399 PM95002
145245520-SEP-07 11.34.11.456789 AM14087.53
145242321-NOV-07 10.22.33.362632 AM10367.74
145238312-MAY-08 11.22.30.545103 AM36374.75
146237916-MAY-07 02.22.24.234567 AM17848.21
146244913-JUN-07 05.49.07.162632 PM862
146236528-AUG-07 07.03.34.003399 PM27455.33
146242421-NOV-07 10.22.33.263332 AM138244
146238412-MAY-08 12.22.34.525972 PM29249.15
147239602-FEB-06 01.34.56.345678 AM349301
147242516-NOV-06 11.34.22.162552 PM1500.82
147245011-APR-07 06.18.10.362632 PM16363
147236628-AUG-07 08.59.23.144778 PM37319.44
147238508-DEC-07 11.34.11.331392 AM2958925
148242617-NOV-06 12.22.11.262552 AM72001
148240629-JUN-07 04.41.20.098765 AM2854.22
148238606-DEC-07 12.22.34.225609 PM21116.93
148245117-DEC-07 05.03.52.562632 PM10474.64
148236727-JUN-08 09.53.32.335522 PM144054.85
149238711-MAR-07 03.34.56.536966 PM52758.91
149243413-SEP-07 05.49.30.647893 AM268651.82
149245206-OCT-07 08.59.43.462632 PM125893
149242710-NOV-07 01.34.22.362124 AM90554
149236826-JUN-08 10.19.43.190089 PM600655
150238804-JUN-07 04.41.12.554435 PM282694.31
151238904-JUN-08 05.49.43.546954 PM176201
152239018-NOV-07 04.18.50.546851 PM7616.81
153239127-FEB-06 05.03.03.828330 PM48070.61
154239221-JUL-07 08.59.57.571057 PM266321
155239310-FEB-08 07.53.19.528202 PM23431.91
156239502-FEB-06 08.19.11.227550 PM685011
157239819-NOV-07 09.22.53.224175 PM7110.31
158239919-NOV-07 10.22.38.340990 PM25270.31
159240010-JUL-07 01.34.29.559387 AM69286.41
160240110-JUL-07 02.22.53.554822 AM969.21
161240202-JUL-07 03.34.44.665170 AM6001
162240301-JUL-07 04.49.13.615512 PM2201
163240401-JUL-07 04.49.13.664085 PM5101
164240501-JUL-07 04.49.13.678123 PM12331
165240729-JUN-07 07.03.21.526005 AM25191
166240829-JUN-07 08.59.31.333617 AM3091
167240929-JUN-07 09.53.41.984501 AM481
168241024-MAY-08 10.19.51.985501 AM451751
169241124-MAY-07 11.22.10.548639 AM15760.51
170241229-MAR-06 10.22.09.509801 AM668161
Solution
SELECT
	oe.orders.customer_id,
	oe.orders.order_id,
	oe.orders.order_date,
	oe.orders.order_total,
	DENSE_RANK() OVER (
		PARTITION BY oe.orders.customer_id
		ORDER BY oe.orders.order_date
	) AS order_date_sequence
FROM
	oe.orders
ORDER BY
	oe.orders.customer_id,
	oe.orders.order_date;

Problem 32
Building onto your solution from problem 31, only include each customer’s first order.

Table(s) Required

oe.orders

Expected Output
CUSTOMER_IDORDER_IDORDER_DATEORDER_TOTALORDER_DATE_SEQUENCE
101245816-AUG-07 03.34.12.234359 PM78279.61
102243114-SEP-06 07.03.04.763452 AM5610.61
103241529-MAR-06 01.34.50.545196 PM3101
104235526-JAN-06 09.22.51.962632 AM94513.51
105241720-MAR-07 05.49.10.974352 PM1926.61
106241820-MAR-04 04.18.21.862632 PM5546.61
107244227-JUL-06 12.22.59.662632 PM52471.91
108235708-JAN-06 08.19.44.123456 PM59872.41
109242112-MAR-07 09.53.54.562432 PM728361
116236926-JUN-07 11.22.54.009932 PM11097.41
117245607-NOV-06 07.53.25.989889 PM3878.41
118237116-MAY-07 01.34.56.113356 AM79405.61
119237227-FEB-07 12.22.33.356789 AM16447.21
120237327-FEB-08 01.34.51.220065 AM4161
121237427-FEB-08 02.41.45.109654 AM47971
122237526-FEB-07 03.49.50.459233 AM103834.41
123237607-JUN-07 06.18.08.883310 AM11006.21
141237707-JUN-07 07.03.01.001100 AM38017.81
142237824-MAY-07 08.59.10.010101 AM25691.31
143238016-MAY-07 09.53.02.909090 AM27132.61
144244527-JUL-06 03.34.38.362632 PM5537.81
145244818-JUN-07 04.41.49.262632 PM13881
146237916-MAY-07 02.22.24.234567 AM17848.21
147239602-FEB-06 01.34.56.345678 AM349301
148242617-NOV-06 12.22.11.262552 AM72001
149238711-MAR-07 03.34.56.536966 PM52758.91
150238804-JUN-07 04.41.12.554435 PM282694.31
151238904-JUN-08 05.49.43.546954 PM176201
152239018-NOV-07 04.18.50.546851 PM7616.81
153239127-FEB-06 05.03.03.828330 PM48070.61
154239221-JUL-07 08.59.57.571057 PM266321
155239310-FEB-08 07.53.19.528202 PM23431.91
156239502-FEB-06 08.19.11.227550 PM685011
157239819-NOV-07 09.22.53.224175 PM7110.31
158239919-NOV-07 10.22.38.340990 PM25270.31
159240010-JUL-07 01.34.29.559387 AM69286.41
160240110-JUL-07 02.22.53.554822 AM969.21
161240202-JUL-07 03.34.44.665170 AM6001
162240301-JUL-07 04.49.13.615512 PM2201
163240401-JUL-07 04.49.13.664085 PM5101
164240501-JUL-07 04.49.13.678123 PM12331
165240729-JUN-07 07.03.21.526005 AM25191
166240829-JUN-07 08.59.31.333617 AM3091
167240929-JUN-07 09.53.41.984501 AM481
168241024-MAY-08 10.19.51.985501 AM451751
169241124-MAY-07 11.22.10.548639 AM15760.51
170241229-MAR-06 10.22.09.509801 AM668161
Solution
SELECT
	customer_order.customer_id,
	customer_order.order_id,
	customer_order.order_date,
	customer_order.order_total,
	customer_order.order_date_sequence
FROM (
    SELECT
		oe.orders.customer_id,
		oe.orders.order_id,
		oe.orders.order_date,
		oe.orders.order_total,
		DENSE_RANK() OVER (
			PARTITION BY oe.orders.customer_id
			ORDER BY oe.orders.order_date
		) AS order_date_sequence
    FROM
		oe.orders
) customer_order
WHERE
	customer_order.order_date_sequence = 1
ORDER BY
	customer_order.customer_id,
	customer_order.order_date;

Problem 33
For each customer, rank the customer’s order totals among all other order totals for the customer. Include customer ID, order ID, order total, and the derived column used to rank the order totals for each customer. Alias the ranking column as “order_total_sequence.” Assign the same integer value to ties in order total. Use consecutive integers (e.g., 1, 1, 2, 3, 4, 4, 5). Sort the result set by customer ID (ascending) and order total (ascending).

Table(s) Required

oe.orders

Expected Output
CUSTOMER_IDORDER_IDORDER_TOTALORDER_TOTAL_SEQUENCE
101243029669.91
101244733893.62
1012413485523
101245878279.64
10224315610.61
1022432105232
102241410794.63
102239742283.24
1032433781
10324153102
10324546653.43
1032437135504
10424163841
104243854512
1042354462573
104235594513.54
10524171926.61
105235878262
105243922150.13
105235629473.84
10624412075.21
10623595543.12
10624185546.63
106238123034.64
1072360990.41
1072419315742
107244252471.93
107244070576.94
108244336461
1082420297502
108235759872.43
1082361120131.34
1092394218631
1092421728362
109244477727.23
109236292829.44
11624531291
11624366394.82
116236911097.43
116242814685.84
11723701261
11724563878.42
1172429501253
1172446103679.34
118245721586.21
118237179405.62
119237216447.21
12023734161
121237447971
1222375103834.41
123237611006.21
141237738017.81
142237825691.31
143238027132.61
14424455537.81
144236310082.32
144242211188.53
1442435623034
1442382711735
145244813881
145236495002
145242310367.73
145245514087.54
145238336374.75
1462449861
1462424138242
146237917848.23
146236527455.34
146238429249.15
14724251500.81
147245016362
1472396349303
147236637319.44
14723852958925
14824062854.21
148242672002
148245110474.63
148238621116.94
1482367144054.85
149242790551
1492452125892
149238752758.93
1492368600654
1492434268651.85
1502388282694.31
1512389176201
15223907616.81
153239148070.61
1542392266321
155239323431.91
1562395685011
15723987110.31
158239925270.31
159240069286.41
1602401969.21
16124026001
16224032201
16324045101
164240512331
165240725191
16624083091
1672409481
1682410451751
169241115760.51
1702412668161
Solution
SELECT
	oe.orders.customer_id,
	oe.orders.order_id,
	oe.orders.order_total,
	DENSE_RANK() OVER (
		PARTITION BY oe.orders.customer_id
		ORDER BY oe.orders.order_total
	) AS order_total_sequence
FROM
	oe.orders
ORDER BY
	oe.orders.customer_id,
	oe.orders.order_total;

Problem 34
Retrieve the product ID, product name, list price, and minimum price for each product. In addition to this data, create a derived column that ranks the markup (i.e., list price – minimum price) for each product among all other products. Alias this column as “product_markup_sequence.” Assign the same integer value to ties in markup values. Use consecutive integers (e.g., 1, 1, 2, 3, 4, 4, 5). Only include products where both, list price and minimum price, are available. Sort/order the result set by markup (i.e., list price – min price), ascending.

Table(s) Required

oe.product_information

Expected Output
PRODUCT_IDPRODUCT_NAMELIST_PRICEMIN_PRICEPRODUCT_MARKUP_SEQUENCE
2870Pencil – Mech541
3097Cable Connector – 32R321
3099Cable Harness431
2380Cable PR/15/P651
2408Cable PR/P/6431
2457Cable PR/S/6541
1734Cable RS232 10/AM651
2211Wrist Pad431
2944Wrist Pad /CL321
3208Pencils – Wood211
3515Lead Replacement211
2326Plastic Stock – Y211
2330Plastic Stock – R211
2334Resin431
2725Machine Oil431
3187Plastic Stock – B/HD321
3189Plastic Stock – G211
3191Plastic Stock – O211
3193Plastic Stock – W/HD321
2091Paper Tablet LW 8 1/2 x 11101
2093Pens – 10/FP871
2808Paper Tablet LY 8 1/2 x 11101
2810Inkvisible Pens642
2373Cable RS232 10/AF642
1737Cable SCSI 10/FW/ADS862
1745Cable SCSI 20/WD->D972
2056Mouse Pad /CL862
3051Pens – 10/MP12102
3209Sharpener – Pencil13112
3511Paper – HQ Printer972
2030Latex Gloves12102
2594FG Stock – L972
2596SS Stock – 1mm12102
2783Clips – Paper1082
3150Card Holder – 2518153
1910FG Stock – H14113
1912SS Stock – 3mm15123
2631ESD Bracelet/QR15123
3301Screws <B.28.P>15123
3143Screws <B.28.S>16133
3134Screws <B.32.S>18153
2316Screws <S.32.S>22193
2493SPNIX3.3 C/DU25223
3252Project Management – S3.326233
2058Mouse +WP23194
2761Mouse +WP/CL27234
3224Card Organizer – 25032284
3216Manual – Vision Net6.330264
1940ESD Bracelet/Clip18144
2323Screws <B.32.P>18144
3139Screws <S.16.S>21174
3300Screws <S.32.P>23194
2319Screws <Z.24.S>25214
3503C for SPNIX3.3 – Seat/U22184
1825X25 – 1 Line License25214
3250Graphics – DIK28244
2144Card Organizer Cover18144
2339Paper – Std Printer25214
3234Monitor Hinge – STD39345
2261FD 1.44/3.5/E42375
2522Battery – EL44395
3140Screws <Z.16.S>24195
2322Screws <Z.28.P>23185
3255Spreadsheet – SSS/CD 2.2B35305
2494SPNIX3.3 NU25205
1775Client ISO CP – S27225
2416Client ISO CP – S41365
3175Project Management – S4.037325
3251Project Management – V31265
3117Mouse C/E41356
3163Manual – Vision Net6.3/US35296
3165Manual – Vision Tools2.040346
3179Spreadsheet – SSS/S 2.150446
3256Spreadsheet – SSS/V 2.040346
3361Spreadsheet – SSP/S 1.540346
2417Client ISO CP – V33276
2336Business Cards Box – 25055496
3155Monitor Hinge – HD49427
2259FD 1.44/3.539327
2278Battery – NiHM55487
3277Drive Mount – A/T36297
3129Sound Card STD46397
3133Video Card /3248417
3106KB 101/EN48417
2492SPNIX3.3 AU45387
2976Drive Mount – D52448
2049MB – S30055478
3225Card Organizer – 100047398
3167Manual – Vision OS/2.x55478
3178Spreadsheet – SSP/V 2.045378
1805SPNIX3.3 – UL/A50428
1806SPNIX3.3 – UL/C50428
2464SPNIX4.0 – UL/A70628
2468SPNIX4.0 – UL/C75678
2995SPNIX3.3 SAU70628
3101IC Browser – V75678
3172Graphics – DIK+42348
3257Web Browser – SB/S 2.166588
3082Modem – 56/90/E81729
2418Battery Backup (DA-130)61529
2982Drive Mount – A44359
2375GP 1024×76878699
3110KB 101/FR48399
3220Manual – Vision OS/1.245369
2365Chemicals – TCS78699
3197Spreadsheet – SSS/V 2.145369
3260Word Processing – SWP/S 4.450419
3262Spreadsheet – SSS/S 2.250419
1803SPNIX3.3 – DL60519
1804SPNIX3.3 – UL/N65569
1808SPNIX3.3 – UL/D55469
2462SPNIX4.0 – UL/N80719
2270Modem – 56/90/I665610
2268Modem – 56/H/E776710
3391PS 110/220857510
2308Video Card /E32584810
2289KB 101/ES483810
3183Word Processing – SWS/V 4.5504010
1820SPNIX3.3 – NL554510
2470SPNIX4.0 – NL807010
3290SPNIX3.3 DU655510
1778C for SPNIX3.3 – 1 Seat625210
2004IC Browser – S908010
3258Web Browser – SB/V 1.0807010
3083Modem – 56/H/I675611
2374Modem – C/100655411
1787CPU D3001019011
3112MB – S500776611
3182Word Processing – SWP/V 4.5655411
2423C for SPNIX4.0 – 1 Seat847311
2449OSI 1-4/IL837211
2419Battery Backup (DA-290)726012
2299PS 12V /P766412
3359SDRAM – 16 MB1119912
2751MB – S450665412
2752MB – S550887612
2293MB – S600998712
2782PC Bag – C/S625012
1801SPNIX3.3 – AL1008812
2452SPNIX4.0 – DL1008812
2536Business Cards – 250/2L806812
2260DFD 1.44/3.5675413
3114MB – S900/650+1018813
2340Chemicals – SW725913
2722PC Bag – L/D1129913
1748PS 220V /EUR837013
1733PS 220V /UK897613
3124PS 110V /T847014
239532MB Cache /M12310914
2402CD-ROM 600/E/24x12711314
2403CD-ROM 600/I/24x11710314
2986Manual – Vision OS/2x +12511114
1729Chemicals – RCP806614
3173Graphics – SA867214
2377PS 110V HS/US978215
24128MB EDO Memory988315
3108KB E/EN786315
1761CD-ROM 600/I/32x13411915
2005IC Browser Doc – S11510015
1738PS 110V /US867016
3123PS 220V /D816516
2370PS 220V /HS/FR917516
2311PS 220V /L957916
2467SPNIX4.0 – UL/D806416
1779C for SPNIX3.3 – Doc12811216
1794OSI 8-16/IL12811216
1782Compact 400/DQ12510817
2262ZIP 100988117
2381CD-ROM 8x998217
2721PC Bag – L/S877017
2387PS 220V /FR836617
3502C for SPNIX3.3 -Sys/U1058817
1774Base ISO CP – BL1109317
3176Smart Suite – V/EN12010317
2335Mobile phone1008317
2439CPU D40012310518
3177Smart Suite – V/FR12010218
3362Web Browser – SB/S 4.0998118
3204Envoy DS12610719
2411GP 1280×1024987820
1742CD-ROM 500/16x1018120
2422SPNIX4.0 – SAL15013020
2453Inkjet C/419517421
175532MB Cache /NM1219922
2394DIMM – 32MB12810622
1740TD 12GB/DAT13411123
3090RAM – 48 MB19317023
2424CDW 12/2422119823
3247Smart Suite – V/DE1209624
2537Business Cards Box – 100020017624
3087DIMM – 16 MB1249925
2272RAM – 16 MB13511025
3086VRAM – 16 MB21118625
2638Envoy DS/E13711126
2274RAM – 32 MB16113526
3073HD 6GB /I22419727
1781CDW 20/48/E23320627
2371C for SPNIX4.0 – Doc14611927
3245Smart Suite – S4.0/FR22219527
3171Smart Suite – S3.3/EN14812028
2302Inkjet B/615012129
1788CPU D60017814929
3170Smart Suite – V/SP16113229
3246Smart Suite – S4.0/SP22219329
3248Smart Suite – S4.0/DE22219329
2396EDO – 32MB17914930
2430Compact 400/LQ17514331
2409TD 7GB/821017732
3253Smart Suite – S4.0/EN22218833
1791Industrial 700/HD27523934
3091VRAM – 64 MB27924334
3077DVD 8x27423735
1749DIMM – 256MB33730035
2410HD 8.4GB @540035731936
3088SDRAM – 32 MB25822036
1768HD 8.2GB @540034530637
2878Router – ASR/2W34530538
2152Router – DTMF423119138
240464MB Cache /NM22118039
2264CDW 20/48/I22318140
2359LCD Monitor 9/PM24920641
2497WSP DA-29039935542
1792Industrial 600/DQ22518043
1763DIMM – 64MB24720243
240664MB Cache /M22317843
2243Monitor 17/HR/F35030244
3060Monitor 17/HR29925045
3057Monitor 17/SD36932045
2415HD 9.1GB @720035930946
1739SDRAM – 128 MB29924847
1726LCD Monitor 11/PM25920847
3400HD 8GB /SE38933748
3127LaserPro 600/6/BW49844449
2337Business Cards – 1000/2L30024649
2276SDRAM – 48 MB26921549
2496WSP DA-13029924450
2414HD 9.1GB @10000 /I45439950
2378DIMM – 128 MB30524751
3072HD 12GB /N56750752
2257HD 8GB /I39933853
1797Inkjet C/8/HQ34928853
2471SPNIX3.3 SU50043953
3061Monitor 19/SD49943754
1772HD 9.1GB @1000045639355
2266DVD 12x33327055
3354HD 12GB /I54347856
1780C for SPNIX3.3 – Sys45038556
2400DIMM – 512 MB44838057
1948Envoy IC/5849842858
2879Router – ASR/3W45638459
3353HD 10GB /R48941360
2253HD 10GB @5400 /SE39932261
3071HD 12GB /S63355362
3054Plasma Monitor 10/XGA60051963
2254HD 10GB /I45337164
3020Envoy IC44936665
3069HD 10GB /S43635066
2245Monitor 19/SD/M51242067
3331Monitor 21/HR87978568
3334HD 12GB /R61251269
2236Plasma Monitor 10/TFT/XGA96486370
3501C for SPNIX4.0 – Sys55544871
3399HD 18GB /SE81570672
3350Plasma Monitor 10/LE/VGA74063073
3064Monitor 21/SD102390974
2382HD 18.2GB@10000 /I85073175
2384DIMM – 1GB59947976
3065Monitor 21/D99987577
1799SPNIX3.3 – SL100087478
2459LaserPro 1200/8/BW69956879
3337Mobile Web Phone80066680
1743HD 18.2GB @10000 /E80066181
1750DIMM – 2GB69956081
2255HD 12GB @7200 /SE77562882
2252Monitor 21/HR/M88971783
1822SPNIX4.0 – SL1500130384
2999Laptop 16/8/11099980085
3000Laptop 32/10/561749154286
2350Desk – W/482500212987
2231Desk – S/V2510211488
3001Laptop 48/10/56/1102556207389
3004Laptop 64/10/56/2202768227590
2351Desk – W/48/R2900238691
3003Laptop 128/12/56/v90/1103219260692
2779Desk – OS/O/F3980334793
Solution
SELECT
	oe.product_information.product_id,
	oe.product_information.product_name,
	oe.product_information.list_price,
	oe.product_information.min_price,
	DENSE_RANK() OVER (
		ORDER BY oe.product_information.list_price - oe.product_information.min_price
	) AS product_markup_sequence
FROM
	oe.product_information
WHERE
	oe.product_information.list_price IS NOT NULL
	AND oe.product_information.min_price IS NOT NULL
ORDER BY
	product_markup_sequence;

Problem 35
Adjust your solution to problem 34 slightly and build on to it to retrieve the products with the largest markup. Include the product ID, product name, list price, minimum price, category name, and product markup sequence in the output.

Table(s) Required

oe.product_information
oe.categories_tab

Expected Output
PRODUCT_IDPRODUCT_NAMELIST_PRICEMIN_PRICECATEGORY_NAMEPRODUCT_MARKUP_SEQUENCE
2779Desk – OS/O/F39803347office11
Solution
SELECT
	product_markup.product_id,
	product_markup.product_name,
	product_markup.list_price,
	product_markup.min_price,
	product_markup.category_name,
	product_markup.product_markup_sequence
FROM (
    SELECT
		oe.product_information.product_id,
		oe.product_information.product_name,
		oe.product_information.list_price,
		oe.product_information.min_price,
		oe.categories_tab.category_name,
		DENSE_RANK() OVER (
			ORDER BY oe.product_information.list_price - oe.product_information.min_price DESC
		) AS product_markup_sequence
    FROM
		oe.product_information
		INNER JOIN
		oe.categories_tab
			ON oe.product_information.category_id = oe.categories_tab.category_id
			AND oe.product_information.list_price IS NOT NULL
			AND oe.product_information.min_price IS NOT NULL
) product_markup
WHERE
	product_markup.product_markup_sequence = 1;

Problem 36
Using the north_america_sale and europe_sale tables, retrieve the total sale value for each product category. The output should include an additional column indicating the origin of the row produced. For example, any row originating from the north_america_sale table should contain a value of “North America.” Rows originating from the europe_sale table should contain a value of “Europe.” Alias this column as “sales_region.”

Table(s) Required

north_america_sale
europe_sale

Expected Output
sales_regionproduct_categorytotal_sale
North AmericaOffice Supplies110578733
North AmericaSoftware109730709
North AmericaHardware110083856
EuropeOffice Supplies110578733
EuropeSoftware109730709
EuropeHardware110083856
Solution
SELECT
	'North America' AS sales_region,
    north_america_sale.product_category,
    SUM(north_america_sale.total_sale) AS total_sale
FROM
    north_america_sale
GROUP BY
    north_america_sale.product_category
UNION ALL
SELECT
	'Europe',
    europe_sale.product_category,
    SUM(europe_sale.total_sale)
FROM
    europe_sale
GROUP BY
    europe_sale.product_category;

Problem 37
Using the north_america_sale table, develop a common table expression (CTE) producing the ranking of each product category based on total sales within each month. In the output, include the month, product category rank, product category, and total sale value. Ensure the CTE’s output is sorted in ascending order by reporting month and product category rank.

Table(s) Required

north_america_sale

Expected Output
reporting_monthproduct_category_rankproduct_categorytotal_sale
01-JAN-231Hardware10532049
01-JAN-232Software10032955
01-JAN-233Office Supplies9527596
01-FEB-231Office Supplies8636016
01-FEB-232Software8266828
01-FEB-233Hardware8145411
01-MAR-231Hardware10107952
01-MAR-232Software9566038
01-MAR-233Office Supplies9308036
01-APR-231Hardware9981157
01-APR-232Office Supplies9101319
01-APR-233Software8094593
01-MAY-231Office Supplies9854939
01-MAY-232Software8719227
01-MAY-233Hardware8224588
01-JUN-231Software9837380
01-JUN-232Office Supplies9033310
01-JUN-233Hardware8983925
01-JUL-231Hardware8956408
01-JUL-232Software8850498
01-JUL-233Office Supplies8742601
01-AUG-231Software9848671
01-AUG-232Hardware9718295
01-AUG-233Office Supplies8566646
01-SEP-231Software9532093
01-SEP-232Hardware9198295
01-SEP-233Office Supplies8742664
01-OCT-231Hardware9408886
01-OCT-232Office Supplies9149671
01-OCT-233Software8922649
01-NOV-231Office Supplies9474652
01-NOV-232Hardware8334058
01-NOV-233Software8327729
01-DEC-231Office Supplies10441283
01-DEC-232Software9732048
01-DEC-233Hardware8492832
Solution
WITH product_category_performance AS (
    SELECT
        TRUNC(north_america_sale.report_date, 'MONTH') AS reporting_month,
        DENSE_RANK() OVER (
            PARTITION BY TRUNC(north_america_sale.report_date, 'MONTH')
            ORDER BY SUM(north_america_sale.total_sale) DESC
        ) AS product_category_rank,
        north_america_sale.product_category,
        SUM(north_america_sale.total_sale) AS total_sale
    FROM
        north_america_sale
    GROUP BY
        TRUNC(north_america_sale.report_date, 'MONTH'),
        north_america_sale.product_category
    ORDER BY
        reporting_month,
        product_category_rank
)
SELECT
    product_category_performance.reporting_month,
    product_category_performance.product_category_rank,
    product_category_performance.product_category,
    product_category_performance.total_sale
FROM
    product_category_performance;

Problem 38
Using the europe_sale table, write a query returning a result set containing the total monthly sales for each product category. The sales for each product category should be represented as columns. In other words, pivot the row values to columns. For example, given that there are three distinct product category values within the table, there should be one column per product category and the corresponding monthly sale value captured within the column for each month. Use report friendly column names by renaming the columns to “Reporting Month,”, “Software Sales,” “Hardware Sales,” and “Office Supply Sales.” Sort the result set in ascending order by reporting month.

Table(s) Required

europe_sale

Expected Output
Reporting MonthSoftware SalesHardware SalesOffice Supply Sales
01-JAN-2310032955105320499527596
01-FEB-23826682881454118636016
01-MAR-239566038101079529308036
01-APR-23809459399811579101319
01-MAY-23871922782245889854939
01-JUN-23983738089839259033310
01-JUL-23885049889564088742601
01-AUG-23984867197182958566646
01-SEP-23953209391982958742664
01-OCT-23892264994088869149671
01-NOV-23832772983340589474652
01-DEC-239732048849283210441283
Solution
-- Solution 1
SELECT
    TRUNC(europe_sale.report_date, 'MONTH') AS "Reporting Month",
    SUM(
        CASE europe_sale.product_category
            WHEN 'Software'
                THEN europe_sale.total_sale
            ELSE 0
        END
    ) AS "Software Sales",
    SUM(
        CASE europe_sale.product_category
            WHEN 'Hardware'
                THEN europe_sale.total_sale
            ELSE 0
        END
    ) AS "Hardware Sales",
    SUM(
        CASE europe_sale.product_category
            WHEN 'Office Supplies'
                THEN europe_sale.total_sale
            ELSE 0
        END
    ) AS "Office Supply Sales"
FROM
    europe_sale
GROUP BY
    TRUNC(europe_sale.report_date, 'MONTH')
ORDER BY
    "Reporting Month";
 
-- Solution 2
SELECT
   pivoted_sale."Reporting Month",
   pivoted_sale."Software Sales",
   pivoted_sale."Hardware Sales",
   pivoted_sale."Office Supply Sales"
FROM (
    SELECT
        TRUNC(europe_sale.report_date, 'MONTH') AS "Reporting Month",
        europe_sale.product_category,
        europe_sale.total_sale AS total_sale
    FROM
        europe_sale
) product_category_sale
PIVOT (
    SUM(total_sale)
    FOR product_category IN (
        'Software' AS "Software Sales",
        'Hardware' AS "Hardware Sales",
        'Office Supplies' AS "Office Supply Sales"
    )
) pivoted_sale
ORDER BY
    pivoted_sale."Reporting Month";

Problem 39
Using common table expressions, generate a report containing a summary of each customer’s order history along with the customer’s personal information. The order history summary should consist of the number of orders placed by the customer along with the total, average, minimum, and maximum sales values associated with those orders. The required personal information for each customer is the customer ID, first name, last name, email, date of birth, marital status, income level, and credit limit. In your solution, use separate CTEs for the customer’s order history and the customer’s personal information. Additionally, only include customers that have placed at least one order.

Table(s) Required

oe.customers
oe.orders

Expected Output
customer_idcust_first_namecust_last_namecust_emaildate_of_birthmarital_statusgenderincome_levelcredit_limitorder_counttotal_saleaverage_saleminimum_salemaximum_sale
144SivajiLandisSivaji.Landis@GOLDENEYE.EXAMPLE.COM09-FEB-70marriedMF: 110,000 – 129,9995005160284.632056.925537.871173
145MammuttiPacinoMammutti.Pacino@GREBE.EXAMPLE.COM19-FEB-46singleMF: 110,000 – 129,999500571717.914343.58138836374.7
146EliaFawcettElia.Fawcett@JACANA.EXAMPLE.COM12-MAR-63marriedFL: 300,000 and above500588462.617692.528629249.1
147IshwaryaRobertsIshwarya.Roberts@LAPWING.EXAMPLE.COM21-MAR-44singleFG: 130,000 – 149,9996005371278.274255.641500.8295892
148GustavSteenburgenGustav.Steenburgen@PINTAIL.EXAMPLE.COM10-APR-50marriedMF: 110,000 – 129,9996005185700.537140.12854.2144054.8
149MarkusRamplingMarkus.Rampling@PUFFIN.EXAMPLE.COM20-APR-41singleMD: 70,000 – 89,9996005403119.780623.949055268651.8
150GoldieSlaterGoldie.Slater@PYRRHULOXIA.EXAMPLE.COM11-MAY-51marriedMD: 70,000 – 89,9997001282694.3282694.3282694.3282694.3
151DivineAykroydDivine.Aykroyd@REDSTART.EXAMPLE.COM20-MAY-76singleMF: 110,000 – 129,999700117620176201762017620
152DieterMatthauDieter.Matthau@VERDIN.EXAMPLE.COM09-JUN-22marriedMA: Below 30,00070017616.87616.87616.87616.8
153DivineSheenDivine.Sheen@COWBIRD.EXAMPLE.COM20-JUN-67singleMI: 170,000 – 189,999700148070.648070.648070.648070.6
154FredericGrodinFrederic.Grodin@CREEPER.EXAMPLE.COM29-JUN-65singleFL: 300,000 and above700126632266322663226632
155FredericoRomeroFrederico.Romero@CURLEW.EXAMPLE.COM09-JUL-42marriedME: 90,000 – 109,999700123431.923431.923431.923431.9
156GoldieMontandGoldie.Montand@DIPPER.EXAMPLE.COM09-AUG-55marriedFF: 110,000 – 129,999700168501685016850168501
157SidneyCapshawSidney.Capshaw@DUNLIN.EXAMPLE.COM18-AUG-69singleMG: 130,000 – 149,99970017110.37110.37110.37110.3
158FredericoLyonFrederico.Lyon@FLICKER.EXAMPLE.COM07-SEP-70marriedMJ: 190,000 – 249,999700125270.325270.325270.325270.3
159EddieBoyerEddie.Boyer@GALLINULE.EXAMPLE.COM07-OCT-53marriedMG: 130,000 – 149,999700169286.469286.469286.469286.4
160EddieSternEddie.Stern@GODWIT.EXAMPLE.COM06-NOV-50marriedMG: 130,000 – 149,9997001969.2969.2969.2969.2
161ErnestWeaverErnest.Weaver@GROSBEAK.EXAMPLE.COM16-NOV-42singleMB: 30,000 – 49,9999001600600600600
162ErnestGeorgeErnest.George@LAPWING.EXAMPLE.COM07-DEC-75marriedMD: 70,000 – 89,9999001220220220220
164CharlotteKazanCharlotte.Kazan@MERGANSER.EXAMPLE.COM05-JAN-54marriedMI: 170,000 – 189,999120011233123312331233
165CharlotteFondaCharlotte.Fonda@MOORHEN.EXAMPLE.COM05-FEB-56marriedMJ: 190,000 – 249,999120012519251925192519
166DheerajAlexanderDheeraj.Alexander@NUTHATCH.EXAMPLE.COM14-FEB-50singleFG: 130,000 – 149,99912001309309309309
167GerardHersheyGerard.Hershey@PARULA.EXAMPLE.COM06-MAR-48marriedMD: 70,000 – 89,9991200148484848
169DheerajDavisDheeraj.Davis@PIPIT.EXAMPLE.COM05-APR-81marriedFF: 110,000 – 129,9991200115760.515760.515760.515760.5
170Harry DeanFondaHarryDean.Fonda@PLOVER.EXAMPLE.COM15-APR-88singleMG: 130,000 – 149,9991200166816668166681666816
101ConstantinWellesConstantin.Welles@ANHINGA.EXAMPLE.COM20-FEB-72marriedMB: 30,000 – 49,9991004190395.147598.77529669.978279.6
102HarrisonPacinoHarrison.Pacino@ANI.EXAMPLE.COM02-MAR-53singleMI: 170,000 – 189,999100469211.417302.855610.642283.2
103ManishaTaylorManisha.Taylor@AUKLET.EXAMPLE.COM22-MAR-83marriedFH: 150,000 – 169,999100420591.45147.857813550
104HarrisonSutherlandHarrison.Sutherland@GODWIT.EXAMPLE.COM31-MAR-72singleFH: 150,000 – 169,9991004146605.536651.37538494513.5
105MatthiasMacGrawMatthias.MacGraw@GOLDENEYE.EXAMPLE.COM21-APR-69marriedFC: 50,000 – 69,999100461376.515344.1251926.629473.8
106MatthiasHannahMatthias.Hannah@GREBE.EXAMPLE.COM30-APR-60singleMF: 110,000 – 129,999100436199.59049.8752075.223034.6
107MatthiasCruiseMatthias.Cruise@GROSBEAK.EXAMPLE.COM21-MAY-69marriedFG: 130,000 – 149,9991004155613.238903.3990.470576.9
108MeenakshiMasonMeenakshi.Mason@JACANA.EXAMPLE.COM20-JUN-57marriedMH: 150,000 – 169,9991004213399.753349.9253646120131.3
109ChristianCageChristian.Cage@KINGLET.EXAMPLE.COM30-JUN-38singleMF: 110,000 – 129,9991004265255.666313.92186392829.4
116GeraldineMartinGeraldine.Martin@SCOTER.EXAMPLE.COM28-OCT-27singleMA: Below 30,0002004323078076.7512914685.8
117GuillaumeEdwardsGuillaume.Edwards@SHRIKE.EXAMPLE.COM16-NOV-52marriedME: 90,000 – 109,9992004157808.739452.175126103679.3
118MauriceMahoneyMaurice.Mahoney@SNIPE.EXAMPLE.COM27-NOV-66singleMF: 110,000 – 129,9992002100991.850495.921586.279405.6
119MauriceHasanMaurice.Hasan@STILT.EXAMPLE.COM17-DEC-65marriedMG: 130,000 – 149,999200116447.216447.216447.216447.2
120DianeHigginsDiane.Higgins@TANAGER.EXAMPLE.COM26-DEC-84singleMH: 150,000 – 169,9992001416416416416
121DianneSenDianne.Sen@TATTLER.EXAMPLE.COM15-JAN-53marriedMH: 150,000 – 169,99920014797479747974797
122MauriceDaltreyMaurice.Daltrey@TEAL.EXAMPLE.COM15-FEB-43marriedMA: Below 30,0002001103834.4103834.4103834.4103834.4
141MaximilianHennerMaximilian.Henner@DUNLIN.EXAMPLE.COM21-DEC-73singleMH: 150,000 – 169,999500138017.838017.838017.838017.8
143SachinNeesonSachin.Neeson@GALLINULE.EXAMPLE.COM20-JAN-62singleMF: 110,000 – 129,999500127132.627132.627132.627132.6
123ElizabethBrownElizabeth.Brown@THRASHER.EXAMPLE.COM24-FEB-49singleFF: 110,000 – 129,999200111006.211006.211006.211006.2
142SachinSpielbergSachin.Spielberg@GADWALL.EXAMPLE.COM11-JAN-71marriedMC: 50,000 – 69,999500125691.325691.325691.325691.3
163ErnestChandarErnest.Chandar@LIMPKIN.EXAMPLE.COM16-DEC-62singleMH: 150,000 – 169,9999001510510510510
168HemaVoightHema.Voight@PHALAROPE.EXAMPLE.COM16-MAR-50singleMH: 150,000 – 169,9991200145175451754517545175
Solution
WITH customer_order_summary AS (
    SELECT
		oe.orders.customer_id,
    	COUNT(oe.orders.order_id) AS order_count,
		SUM(oe.orders.order_total) AS total_sale,
		AVG(oe.orders.order_total) AS average_sale,
		MIN(oe.orders.order_total) AS minimum_sale,
		MAX(oe.orders.order_total) AS maximum_sale
    FROM
    	oe.orders
	GROUP BY
		oe.orders.customer_id
),
customer AS (
	SELECT
		oe.customers.customer_id,
		oe.customers.cust_first_name,
		oe.customers.cust_last_name,
		oe.customers.cust_email,
		oe.customers.date_of_birth,
		oe.customers.marital_status,
		oe.customers.gender,
		oe.customers.income_level,
		oe.customers.credit_limit
	FROM
		oe.customers
)
SELECT
	customer.customer_id,
	customer.cust_first_name,
	customer.cust_last_name,
	customer.cust_email,
	customer.date_of_birth,
	customer.marital_status,
	customer.gender,
	customer.income_level,
	customer.credit_limit,
	customer_order_summary.order_count,
	customer_order_summary.total_sale,
	customer_order_summary.average_sale,
	customer_order_summary.minimum_sale,
	customer_order_summary.maximum_sale
FROM
	customer_order_summary
	INNER JOIN
	customer
		ON customer_order_summary.customer_id = customer.customer_id;
	

Problem 40
Compute the average number of members enrolled per employee. Round this value to 2 decimal places and alias it as “average_enrollment.”

Table(s) Required

member

Expected Output
average_enrollment
11.11
Solution
-- Solution 1
SELECT
    ROUND(
		AVG(employee_member_enrollment.enrollment_count),
		2
	) AS average_enrollment
FROM (
    SELECT
        COUNT(member.member_id) AS enrollment_count
    FROM
    	member
    GROUP BY
        member.employee_id
) employee_member_enrollment;

-- Solution 2
SELECT
    ROUND(
		AVG(COUNT(member.member_id)),
		2
	) AS average_enrollment
FROM
	member
GROUP BY
    member.employee_id;

Problem 41
For each member type description, compute the number of members and total revenue generated from the annual membership costs. Alias the number of members and revenue generated corresponding to each member type description as “member_count” and “total_revenue”, respectively. Do not include free members. In the output, include the member type description, member count, and total revenue. Sort the result set in descending order by total revenue.

Table(s) Required

member
member_type

Expected Output
descriptionmember_counttotal_revenue
Platinum25750
Silver19380
Gold15375
Bronze22330
Free190
Solution
SELECT
	member_type.description,
    COUNT(member.member_id) AS member_count,
    SUM(member_type.annual_cost) AS total_revenue
FROM
	member
	INNER JOIN
	member_type
		ON member.member_type_id = member_type.member_type_id
GROUP BY
	member_type.description
ORDER BY
    SUM(member_type.annual_cost) DESC;

Problem 42
Generate the purchase history for the member with an ID value of 1. In the output, include the member ID, purchase date, product description, quantity of the corresponding product purchased, each product’s price, and the item total (i.e., price * quantity for each product in a single purchase). Sort the result set in ascending order by purchase date. Hint: There should be one row per purchase per item purchased in the output. For example, if a member made a single purchase of three items, then there should be three rows in the output.

Table(s) Required

purchase
purchase_item
product

Expected Output
member_idpurchase_datedescriptionquantitypriceitem_total
101-JAN-24Chocolate428
101-JAN-24Cookie Dough23.57
102-JAN-24Strawberry122
Solution
SELECT
	purchase.member_id,
    purchase.purchase_date,
    product.description,
    purchase_item.quantity,
    product.price,
    purchase_item.item_total
FROM
	purchase
	INNER JOIN
	purchase_item
		ON purchase.purchase_id = purchase_item.purchase_id
    	AND purchase.member_id = 1
	INNER JOIN
    product
		ON purchase_item.product_id = product.product_id
ORDER BY
    purchase.purchase_date;

Problem 43
Using a common table expression (CTE), compute each product’s (i.e., ice cream flavor) rank value in terms of total quantity sold across all member purchases. The product with the largest total quantity value should receive a rank value of 1. Assign the same rank in instances of ties and use consecutive integers. For example, the quantity values 100, 100, 95, 85, 80, and 80 should receive the rank values of 1, 1, 2, 3, 4, and 4, respectively. In the output, include the product description, the total quantity purchased, and the product ranking value. Alias the total quantity purchased as “total_quantity” and the product ranking value as “quantity_rank.” Sort the result set in descending order by total quantity.

Table(s) Required

purchase_item
product

Expected Output
descriptiontotal_quantityquantity_rank
Cookies N’ Cream1641
Cookie Dough1342
Mint Chocolate Chip1342
Buttered Pecan1273
Chocolate Chip Cookie Dough1114
Strawberry1105
Chocolate1036
Vanilla997
Solution
WITH product_ranking AS (
    SELECT
		product.description,
		SUM(purchase_item.quantity) AS total_quantity,
		DENSE_RANK() OVER (
			ORDER BY SUM(purchase_item.quantity) DESC
		) AS quantity_rank
	FROM
		purchase_item
		INNER JOIN
		product
			ON purchase_item.product_id = product.product_id
	GROUP BY
		product.description
)
SELECT
	product_ranking.description,
	product_ranking.total_quantity,
	product_ranking.quantity_rank
FROM
	product_ranking
ORDER BY
	product_ranking.total_quantity DESC;

Problem 44
Building on your solution from the previous problem, only include the top two and bottom two products in terms of quantity purchased. In the output, Include the product description, total quantity, and the product ranking column(s) . Keep the result set sorted in descending order by total quantity.

Table(s) Required

purchase_item
product

Expected Output
descriptiontotal_quantityquantity_rank_ascquantity_rank_desc
Cookies N’ Cream16471
Mint Chocolate Chip13462
Cookie Dough13462
Chocolate10326
Vanilla9917
Solution
WITH product_ranking AS (
    SELECT
        product.description,
    	SUM(purchase_item.quantity) AS total_quantity,
        DENSE_RANK() OVER (
        	ORDER BY SUM(purchase_item.quantity) ASC
        ) AS quantity_rank_asc,
        DENSE_RANK() OVER (
        	ORDER BY SUM(purchase_item.quantity) DESC
        ) AS quantity_rank_desc
    FROM
    	purchase_item
    	INNER JOIN
        product
    		ON purchase_item.product_id = product.product_id
    GROUP BY
    	product.description
)
SELECT
	product_ranking.description,
	product_ranking.total_quantity,
    product_ranking.quantity_rank_asc,
	product_ranking.quantity_rank_desc
FROM
	product_ranking
WHERE
	product_ranking.quantity_rank_asc <= 2
    OR product_ranking.quantity_rank_desc <= 2
ORDER BY
	product_ranking.total_quantity DESC;

Problem 45
For each member, generate a summary containing the member’s ID, member type, annual member cost, member discount, amount spent across purchases, and amount saved across purchases. Provide report-friendly column names through the use of aliases. Round the amount saved to two decimal places. Sort the result set in ascending order by member ID.

Table(s) Required

member
member_type
purchase

Expected Output
Member IDMember Type IDMember TypeAnnual Member CostMember DiscountAmount SpentAmount Saved
11Free00170
25Platinum30.128.83.2
32Bronze15.0345.61.41
45Platinum30.125.22.8
55Platinum30.150.855.65
63Silver20.0550.842.68
73Silver20.0513.78.73
85Platinum30.13.6.4
94Gold25.0710.23.77
101Free00190
112Bronze15.0314.55.45
123Silver20.0518.05.95
135Platinum30.130.63.4
145Platinum30.144.554.95
155Platinum30.1273
162Bronze15.0325.22.78
175Platinum30.111.251.25
183Silver20.055.23.28
193Silver20.0523.751.25
202Bronze15.0313.59.42
212Bronze15.0310.19.32
222Bronze15.0324.25.75
234Gold25.076.52.49
242Bronze15.0323.28.72
251Free0025.50
263Silver20.055.23.28
273Silver20.0539.92.1
284Gold25.076.51.49
294Gold25.079.3.7
305Platinum30.124.752.75
314Gold25.0766.55.01
325Platinum30.128.83.2
335Platinum30.135.553.95
342Bronze15.034.85.15
351Free0090
363Silver20.0511.4.6
375Platinum30.116.21.8
385Platinum30.121.62.4
392Bronze15.0356.751.76
403Silver20.0524.71.3
412Bronze15.037.76.24
424Gold25.0722.331.68
432Bronze15.038.73.27
442Bronze15.0329.59.92
455Platinum30.133.33.7
464Gold25.0733.482.52
472Bronze15.0344.141.37
481Free00350
495Platinum30.128.353.15
504Gold25.0733.022.49
511Free0017.50
524Gold25.0722.321.68
534Gold25.0741.853.15
541Free00140
553Silver20.0516.63.88
562Bronze15.0330.56.95
571Free00270
583Silver20.057.13.38
592Bronze15.0360.151.86
605Platinum30.158.056.45
611Free0038.50
622Bronze15.0313.58.42
631Free00300
643Silver20.0511.4.6
655Platinum30.12.7.3
665Platinum30.15.4.6
671Free0022.50
685Platinum30.147.255.25
692Bronze15.0336.861.14
702Bronze15.0346.561.44
713Silver20.0557.963.05
724Gold25.0730.692.31
735Platinum30.112.61.4
745Platinum30.129.73.3
753Silver20.0530.881.63
762Bronze15.037.76.24
771Free00210
782Bronze15.0342.691.32
794Gold25.0736.282.73
802Bronze15.032.91.09
813Silver20.0531.351.65
823Silver20.0543.72.3
835Platinum30.19.451.05
841Free00700
855Platinum30.191
864Gold25.0719.531.47
875Platinum30.125.22.8
881Free00330
892Bronze15.035.82.18
901Free00300
914Gold25.0718.61.4
923Silver20.0541.812.2
934Gold25.076.51.49
945Platinum30.131.953.55
953Silver20.0547.032.48
963Silver20.0558.443.08
971Free0053.50
981Free00650
991Free0016.50
1001Free00320
Solution
SELECT
	member.member_id AS "Member ID",
	member_type.member_type_id AS "Member Type ID",
	member_type.description AS "Member Type",
	member_type.annual_cost AS "Annual Member Cost",
	member_type.discount AS "Member Discount",
	SUM(purchase.purchase_total) AS "Amount Spent",
	ROUND(
    	(
			(SUM(purchase.purchase_total)
    		/ (1 - member_type.discount))
			- SUM(purchase.purchase_total)
    	),
		2
	) AS "Amount Saved"
FROM
	member
	INNER JOIN
	member_type
		ON member.member_type_id = member_type.member_type_id
	INNER JOIN
	purchase
		ON member.member_id = purchase.member_id
GROUP BY
	member.member_id,
	member_type.member_type_id,
	member_type.description,
	member_type.annual_cost,
	member_type.discount
ORDER BY
	member.member_id;

Problem 46
Determine the amount a member must spend across their purchases to have a savings amount equal to the annual member cost associated with their member type. In the output, include the member type description, annual member cost, member discount, and the spending amount required to cover the annual member cost. Only include non-free member types. Round the spending amount required to cover the annual member cost to two decimals. Sort the result set in ascending order by member type ID.

Table(s) Required

member_type

Expected Output
Member TypeAnnual Member CostMember DiscountAmount Required
Bronze15.03500
Silver20.05400
Gold25.07357.14
Platinum30.1300
Solution
SELECT
	member_type.description AS "Member Type",
	member_type.annual_cost AS "Annual Member Cost",
	member_type.discount AS "Member Discount",
	ROUND(member_type.annual_cost / member_type.discount, 2) AS "Amount Required"
FROM
	member_type
WHERE
    member_type.description != 'Free'
ORDER BY
	member_type.member_type_id;

Problem 47
For each ice cream product sold at the ice cream shop, determine whether the product contains chocolate. Products with chocolate content contain the word ‘Chocolate’ in their descriptions. In the output, include the product ID, product description, a derived attribute indicating whether the product contains chocolate, and the product price. Sort the result set in such a way that those products containing chocolate appear before those not containing chocolate.

Table(s) Required

product

Expected Output
product_iddescriptioncontains_chocolateprice
4Mint Chocolate Chip13
5Chocolate Chip Cookie Dough13.5
2Chocolate12
8Strawberry02
7Cookie Dough03.5
3Cookies N’ Cream03
6Buttered Pecan03.5
1Vanilla02
Solution
SELECT
	product.product_id,
    product.description,
    CASE
    	WHEN product.description LIKE '%Chocolate%'
    		THEN 1
    	ELSE 0
    END AS contains_chocolate,
    product.price
FROM
	product
ORDER BY
    contains_chocolate DESC;

Problem 48
Create a view speaking to the performance of each ice cream flavor sold at the ice cream shop in terms of the number of times each flavor was purchased and the total sales generated. The view should output the flavor, number of times it was purchased, and the total sales. Ensure the view sorts the result set in descending order by the number of times each flavor was purchased. Provide report-friendly column names through the use of aliases. Finally, verify the newly created view produces the desirable output.

Table(s) Required

purchase
purchase_item
product

Expected Output
Ice Cream FlavorPurchase CountTotal Sales
Cookies N’ Cream571071.61
Cookie Dough52922
Mint Chocolate Chip52977.2
Buttered Pecan44709.4
Chocolate Chip Cookie Dough44791.41
Strawberry42769.6
Vanilla40755
Chocolate37753.01
Solution
CREATE OR REPLACE VIEW flavor_performance AS
    SELECT
        product.description AS "Ice Cream Flavor",
        COUNT(purchase.purchase_id) AS "Purchase Count",
        SUM(purchase.purchase_total) AS "Total Sales"
    FROM
        purchase
        INNER JOIN
        purchase_item
            ON purchase.purchase_id = purchase_item.purchase_item_id
        INNER JOIN
        product
            ON purchase_item.product_id = product.product_id
    GROUP BY
        product.description
    ORDER BY
        "Purchase Count" DESC;

SELECT
    flavor_performance."Ice Cream Flavor",
    flavor_performance."Purchase Count",
    flavor_performance."Total Sales"
FROM
    flavor_performance;

Problem 49
Create a view that returns the dates for which the ice cream shop enrolled zero members. The date range of interest is January 1 to March 30, 2024 inclusive. Ensure the view sorts the result set in ascending order by date. Additionally, write a query that verifies the output of your newly created view.

Table(s) Required

member

Expected Output
calendar_date
04-JAN-24
06-JAN-24
07-JAN-24
08-JAN-24
09-JAN-24
18-JAN-24
21-JAN-24
23-JAN-24
24-JAN-24
25-JAN-24
28-JAN-24
29-JAN-24
01-FEB-24
03-FEB-24
06-FEB-24
07-FEB-24
12-FEB-24
14-FEB-24
24-FEB-24
29-FEB-24
07-MAR-24
08-MAR-24
09-MAR-24
10-MAR-24
12-MAR-24
16-MAR-24
17-MAR-24
19-MAR-24
20-MAR-24
23-MAR-24
28-MAR-24
Solution
CREATE OR REPLACE VIEW zero_enrollment AS
    WITH calendar (calendar_date) AS (
        SELECT
        	TO_DATE('01-JAN-24', 'DD-MON-RR') AS opening_day
        FROM
    		dual
        UNION ALL
    	SELECT
    		calendar.calendar_date + 1
        FROM
        	calendar
        WHERE
        	calendar.calendar_date < TO_DATE('30-MAR-24')
    ),
    member_enrollment AS (
        SELECT
        	DISTINCT member.enrollment_date
        FROM
        	member
    )
    SELECT
        calendar.calendar_date
    FROM
        calendar
    	LEFT JOIN
    	member_enrollment
    		ON calendar.calendar_date = member_enrollment.enrollment_date
    WHERE
    	member_enrollment.enrollment_date IS NULL
    ORDER BY
    	calendar.calendar_date;
		
SELECT
	zero_enrollment.calendar_date
FROM
	zero_enrollment;