DROP TABLE quarterly_sales;

create table quarterly_sales 
(
	department		varchar(16),
	year			smallint,
	quarter			smallint,
	sales			decimal(9,2),
	constraint quarterly_sales_pk 
		primary key (department, year, quarter)
);

insert into quarterly_sales values ('Appliances', 2000, 1, 235956.23);
insert into quarterly_sales values ('Appliances', 2000, 2, 129871.95);
insert into quarterly_sales values ('Appliances', 2000, 3, 398213.39);
insert into quarterly_sales values ('Appliances', 2000, 4,  54111.05);

insert into quarterly_sales values ('Appliances', 2001, 1,  87230.33);
insert into quarterly_sales values ('Appliances', 2001, 2, 105231.94);
insert into quarterly_sales values ('Appliances', 2001, 3, 167323.22);
insert into quarterly_sales values ('Appliances', 2001, 4, 100010.13);

insert into quarterly_sales values ('Appliances', 2002, 1,  95678.13);
insert into quarterly_sales values ('Appliances', 2002, 2, 197399.29);
insert into quarterly_sales values ('Appliances', 2002, 3, 187400.84);
insert into quarterly_sales values ('Appliances', 2002, 4, 123499.00);

insert into quarterly_sales values ('Appliances', 2003, 1, 143003.83);
insert into quarterly_sales values ('Appliances', 2003, 2, 150393.87);
insert into quarterly_sales values ('Appliances', 2003, 3, 143842.51);
insert into quarterly_sales values ('Appliances', 2003, 4, 130239.78);

insert into quarterly_sales values ('Appliances', 2004, 1, 149382.23);
insert into quarterly_sales values ('Appliances', 2004, 2, 162489.02);
insert into quarterly_sales values ('Appliances', 2004, 3, 153903.69);
insert into quarterly_sales values ('Appliances', 2004, 4, 143670.03);

insert into quarterly_sales values ('Appliances', 2005, 1, 168233.93);
insert into quarterly_sales values ('Appliances', 2005, 2, 123863.65);
insert into quarterly_sales values ('Appliances', 2005, 3,  96078.73);
insert into quarterly_sales values ('Appliances', 2005, 4, 137740.47);

insert into quarterly_sales values ('Appliances', 2006, 1, 107473.43);
insert into quarterly_sales values ('Appliances', 2006, 2, 123033.29);
insert into quarterly_sales values ('Appliances', 2006, 3, 133939.74);
insert into quarterly_sales values ('Appliances', 2006, 4, 169102.06);

insert into quarterly_sales values ('Appliances', 2007, 1, 149873.93);
insert into quarterly_sales values ('Appliances', 2007, 2, 178345.47);
insert into quarterly_sales values ('Appliances', 2007, 3, 198971.74);
insert into quarterly_sales values ('Appliances', 2007, 4, 175983.02);

insert into quarterly_sales values ('Appliances', 2008, 1, 171343.75);
insert into quarterly_sales values ('Appliances', 2008, 2, 201019.64);
insert into quarterly_sales values ('Appliances', 2008, 3, 249473.54);
insert into quarterly_sales values ('Appliances', 2008, 4, 223878.21);

insert into quarterly_sales values ('Appliances', 2009, 1, 268765.87);
insert into quarterly_sales values ('Appliances', 2009, 2, 278433.01);
insert into quarterly_sales values ('Appliances', 2009, 3, 265891.68);
insert into quarterly_sales values ('Appliances', 2009, 4, 259873.34);

insert into quarterly_sales values ('Appliances', 2010, 1, 274473.83);
insert into quarterly_sales values ('Appliances', 2010, 2, 294689.04);
insert into quarterly_sales values ('Appliances', 2010, 3, 300174.32);
insert into quarterly_sales values ('Appliances', 2010, 4, 289756.12);

insert into quarterly_sales values ('Appliances', 2011, 1, 330174.34);
insert into quarterly_sales values ('Appliances', 2011, 2, 345673.87);
insert into quarterly_sales values ('Appliances', 2011, 3, 356998.19);



insert into quarterly_sales values ('Vacuums', 2000, 1,  65873.32);
insert into quarterly_sales values ('Vacuums', 2000, 2,  56983.43);
insert into quarterly_sales values ('Vacuums', 2000, 3,  74343.87);
insert into quarterly_sales values ('Vacuums', 2000, 4,  94474.64);

insert into quarterly_sales values ('Vacuums', 2001, 1,  64341.54);
insert into quarterly_sales values ('Vacuums', 2001, 2,  84354.76);
insert into quarterly_sales values ('Vacuums', 2001, 3,  86732.19);
insert into quarterly_sales values ('Vacuums', 2001, 4,  98440.42);

insert into quarterly_sales values ('Vacuums', 2002, 1,  78141.41);
insert into quarterly_sales values ('Vacuums', 2002, 2,  86783.54);
insert into quarterly_sales values ('Vacuums', 2002, 3,  88478.34);
insert into quarterly_sales values ('Vacuums', 2002, 4, 101434.67);

insert into quarterly_sales values ('Vacuums', 2003, 1,  87948.84);
insert into quarterly_sales values ('Vacuums', 2003, 2, 103834.89);
insert into quarterly_sales values ('Vacuums', 2003, 3, 123983.11);
insert into quarterly_sales values ('Vacuums', 2003, 4, 134399.48);

insert into quarterly_sales values ('Vacuums', 2004, 1, 127893.23);
insert into quarterly_sales values ('Vacuums', 2004, 2, 109383.24);
insert into quarterly_sales values ('Vacuums', 2004, 3,  98574.34);
insert into quarterly_sales values ('Vacuums', 2004, 4,  97328.78);

insert into quarterly_sales values ('Vacuums', 2005, 1,  87454.41);
insert into quarterly_sales values ('Vacuums', 2005, 2,  89756.65);
insert into quarterly_sales values ('Vacuums', 2005, 3,  94598.72);
insert into quarterly_sales values ('Vacuums', 2005, 4,  97823.76);

insert into quarterly_sales values ('Vacuums', 2006, 1,  93343.52);
insert into quarterly_sales values ('Vacuums', 2006, 2,  97945.87);
insert into quarterly_sales values ('Vacuums', 2006, 3, 108683.80);
insert into quarterly_sales values ('Vacuums', 2006, 4, 117743.27);

insert into quarterly_sales values ('Vacuums', 2007, 1, 104405.54);
insert into quarterly_sales values ('Vacuums', 2007, 2, 109876.14);
insert into quarterly_sales values ('Vacuums', 2007, 3, 118431.38);
insert into quarterly_sales values ('Vacuums', 2007, 4, 127482.94);

insert into quarterly_sales values ('Vacuums', 2008, 1, 122983.87);
insert into quarterly_sales values ('Vacuums', 2008, 2, 134746.65);
insert into quarterly_sales values ('Vacuums', 2008, 3, 138786.87);
insert into quarterly_sales values ('Vacuums', 2008, 4, 145873.47);

insert into quarterly_sales values ('Vacuums', 2009, 1, 138981.83);
insert into quarterly_sales values ('Vacuums', 2009, 2, 149040.07);
insert into quarterly_sales values ('Vacuums', 2009, 3, 156890.47);
insert into quarterly_sales values ('Vacuums', 2009, 4, 161043.58);

insert into quarterly_sales values ('Vacuums', 2010, 1, 159398.62);
insert into quarterly_sales values ('Vacuums', 2010, 2, 168340.58);
insert into quarterly_sales values ('Vacuums', 2010, 3, 181020.48);
insert into quarterly_sales values ('Vacuums', 2010, 4, 190471.73);

insert into quarterly_sales values ('Vacuums', 2011, 1, 184058.38);
insert into quarterly_sales values ('Vacuums', 2011, 2, 197454.59);
insert into quarterly_sales values ('Vacuums', 2011, 3, 202473.48);



insert into quarterly_sales values ('Mattresses', 2000, 1, 34873.33);
insert into quarterly_sales values ('Mattresses', 2000, 2, 47383.93);
insert into quarterly_sales values ('Mattresses', 2000, 3, 44893.84);
insert into quarterly_sales values ('Mattresses', 2000, 4, 32437.42);

insert into quarterly_sales values ('Mattresses', 2001, 1, 36747.44);
insert into quarterly_sales values ('Mattresses', 2001, 2, 37849.33);
insert into quarterly_sales values ('Mattresses', 2001, 3, 43923.82);
insert into quarterly_sales values ('Mattresses', 2001, 4, 41841.80);

insert into quarterly_sales values ('Mattresses', 2002, 1, 47383.23);
insert into quarterly_sales values ('Mattresses', 2002, 2, 46983.95);
insert into quarterly_sales values ('Mattresses', 2002, 3, 47323.73);
insert into quarterly_sales values ('Mattresses', 2002, 4, 44056.39);

insert into quarterly_sales values ('Mattresses', 2003, 1, 45889.79);
insert into quarterly_sales values ('Mattresses', 2003, 2, 49838.33);
insert into quarterly_sales values ('Mattresses', 2003, 3, 51048.49);
insert into quarterly_sales values ('Mattresses', 2003, 4, 47634.43);

insert into quarterly_sales values ('Mattresses', 2004, 1, 52090.87);
insert into quarterly_sales values ('Mattresses', 2004, 2, 51434.47);
insert into quarterly_sales values ('Mattresses', 2004, 3, 53894.68);
insert into quarterly_sales values ('Mattresses', 2004, 4, 49344.56);

insert into quarterly_sales values ('Mattresses', 2005, 1, 52094.28);
insert into quarterly_sales values ('Mattresses', 2005, 2, 56787.27);
insert into quarterly_sales values ('Mattresses', 2005, 3, 55783.21);
insert into quarterly_sales values ('Mattresses', 2005, 4, 52040.31);

insert into quarterly_sales values ('Mattresses', 2006, 1, 54640.53);
insert into quarterly_sales values ('Mattresses', 2006, 2, 58907.00);
insert into quarterly_sales values ('Mattresses', 2006, 3, 64009.09);
insert into quarterly_sales values ('Mattresses', 2006, 4, 62118.68);

insert into quarterly_sales values ('Mattresses', 2007, 1, 65001.71);
insert into quarterly_sales values ('Mattresses', 2007, 2, 68043.43);
insert into quarterly_sales values ('Mattresses', 2007, 3, 69873.75);
insert into quarterly_sales values ('Mattresses', 2007, 4, 64908.38);

insert into quarterly_sales values ('Mattresses', 2008, 1, 70040.53);
insert into quarterly_sales values ('Mattresses', 2008, 2, 72823.23);
insert into quarterly_sales values ('Mattresses', 2008, 3, 71843.86);
insert into quarterly_sales values ('Mattresses', 2008, 4, 68123.51);

insert into quarterly_sales values ('Mattresses', 2009, 1, 72045.84);
insert into quarterly_sales values ('Mattresses', 2009, 2, 74395.27);
insert into quarterly_sales values ('Mattresses', 2009, 3, 75116.83);
insert into quarterly_sales values ('Mattresses', 2009, 4, 68904.08);

insert into quarterly_sales values ('Mattresses', 2010, 1, 71083.25);
insert into quarterly_sales values ('Mattresses', 2010, 2, 75043.63);
insert into quarterly_sales values ('Mattresses', 2010, 3, 83704.46);
insert into quarterly_sales values ('Mattresses', 2010, 4, 77649.74);

insert into quarterly_sales values ('Mattresses', 2011, 1, 84109.38);
insert into quarterly_sales values ('Mattresses', 2011, 2, 86004.61);
insert into quarterly_sales values ('Mattresses', 2011, 3, 91014.52);



insert into quarterly_sales values ('Electronics', 2000, 1, 345873.14);
insert into quarterly_sales values ('Electronics', 2000, 2, 401144.56);
insert into quarterly_sales values ('Electronics', 2000, 3, 454987.33);
insert into quarterly_sales values ('Electronics', 2000, 4, 476539.23);

insert into quarterly_sales values ('Electronics', 2001, 1, 467043.14);
insert into quarterly_sales values ('Electronics', 2001, 2, 478239.13);
insert into quarterly_sales values ('Electronics', 2001, 3, 543039.34);
insert into quarterly_sales values ('Electronics', 2001, 4, 587383.38);

insert into quarterly_sales values ('Electronics', 2002, 1, 538399.38);
insert into quarterly_sales values ('Electronics', 2002, 2, 673839.83);
insert into quarterly_sales values ('Electronics', 2002, 3, 665839.73);
insert into quarterly_sales values ('Electronics', 2002, 4, 698193.32);

insert into quarterly_sales values ('Electronics', 2003, 1, 604832.43);
insert into quarterly_sales values ('Electronics', 2003, 2, 624831.23);
insert into quarterly_sales values ('Electronics', 2003, 3, 634839.23);
insert into quarterly_sales values ('Electronics', 2003, 4, 710283.84);

insert into quarterly_sales values ('Electronics', 2004, 1, 594878.97);
insert into quarterly_sales values ('Electronics', 2004, 2, 584812.23);
insert into quarterly_sales values ('Electronics', 2004, 3, 701833.96);
insert into quarterly_sales values ('Electronics', 2004, 4, 724749.64);

insert into quarterly_sales values ('Electronics', 2005, 1, 683987.76);
insert into quarterly_sales values ('Electronics', 2005, 2, 714452.52);
insert into quarterly_sales values ('Electronics', 2005, 3, 743232.13);
insert into quarterly_sales values ('Electronics', 2005, 4, 784404.04);

insert into quarterly_sales values ('Electronics', 2006, 1, 698004.62);
insert into quarterly_sales values ('Electronics', 2006, 2, 723434.87);
insert into quarterly_sales values ('Electronics', 2006, 3, 719542.57);
insert into quarterly_sales values ('Electronics', 2006, 4, 801014.68);

insert into quarterly_sales values ('Electronics', 2007, 1, 744764.84);
insert into quarterly_sales values ('Electronics', 2007, 2, 802383.44);
insert into quarterly_sales values ('Electronics', 2007, 3, 833445.73);
insert into quarterly_sales values ('Electronics', 2007, 4, 808844.44);

insert into quarterly_sales values ('Electronics', 2008, 1, 790333.32);
insert into quarterly_sales values ('Electronics', 2008, 2, 859887.47);
insert into quarterly_sales values ('Electronics', 2008, 3, 883433.83);
insert into quarterly_sales values ('Electronics', 2008, 4, 901493.29);

insert into quarterly_sales values ('Electronics', 2009, 1, 814949.82);
insert into quarterly_sales values ('Electronics', 2009, 2, 890009.39);
insert into quarterly_sales values ('Electronics', 2009, 3, 950388.38);
insert into quarterly_sales values ('Electronics', 2009, 4, 976645.38);

insert into quarterly_sales values ('Electronics', 2010, 1, 902332.83);
insert into quarterly_sales values ('Electronics', 2010, 2, 967483.62);
insert into quarterly_sales values ('Electronics', 2010, 3, 954383.52);
insert into quarterly_sales values ('Electronics', 2010, 4, 989403.48);

insert into quarterly_sales values ('Electronics', 2011, 1, 914848.37);
insert into quarterly_sales values ('Electronics', 2011, 2, 978382.83);
insert into quarterly_sales values ('Electronics', 2011, 3, 994403.27);



insert into quarterly_sales values ('Jewelry', 2000, 1, 240939.33);
insert into quarterly_sales values ('Jewelry', 2000, 2, 304984.38);
insert into quarterly_sales values ('Jewelry', 2000, 3, 283993.33);
insert into quarterly_sales values ('Jewelry', 2000, 4, 308939.23);

insert into quarterly_sales values ('Jewelry', 2001, 1, 348493.39);
insert into quarterly_sales values ('Jewelry', 2001, 2, 364983.54);
insert into quarterly_sales values ('Jewelry', 2001, 3, 386789.83);
insert into quarterly_sales values ('Jewelry', 2001, 4, 368321.09);

insert into quarterly_sales values ('Jewelry', 2002, 1, 354873.87);
insert into quarterly_sales values ('Jewelry', 2002, 2, 323939.83);
insert into quarterly_sales values ('Jewelry', 2002, 3, 387213.39);
insert into quarterly_sales values ('Jewelry', 2002, 4, 398143.48);

insert into quarterly_sales values ('Jewelry', 2003, 1, 378340.73);
insert into quarterly_sales values ('Jewelry', 2003, 2, 368843.63);
insert into quarterly_sales values ('Jewelry', 2003, 3, 383542.32);
insert into quarterly_sales values ('Jewelry', 2003, 4, 401040.94);

insert into quarterly_sales values ('Jewelry', 2004, 1, 384056.81);
insert into quarterly_sales values ('Jewelry', 2004, 2, 360198.03);
insert into quarterly_sales values ('Jewelry', 2004, 3, 369293.39);
insert into quarterly_sales values ('Jewelry', 2004, 4, 398321.75);

insert into quarterly_sales values ('Jewelry', 2005, 1, 404040.04);
insert into quarterly_sales values ('Jewelry', 2005, 2, 427023.93);
insert into quarterly_sales values ('Jewelry', 2005, 3, 414849.84);
insert into quarterly_sales values ('Jewelry', 2005, 4, 429232.13);

insert into quarterly_sales values ('Jewelry', 2006, 1, 398721.04);
insert into quarterly_sales values ('Jewelry', 2006, 2, 364561.98);
insert into quarterly_sales values ('Jewelry', 2006, 3, 339828.84);
insert into quarterly_sales values ('Jewelry', 2006, 4, 357221.41);

insert into quarterly_sales values ('Jewelry', 2007, 1, 303879.58);
insert into quarterly_sales values ('Jewelry', 2007, 2, 314873.74);
insert into quarterly_sales values ('Jewelry', 2007, 3, 298733.50);
insert into quarterly_sales values ('Jewelry', 2007, 4, 309883.37);

insert into quarterly_sales values ('Jewelry', 2008, 1, 287454.44);
insert into quarterly_sales values ('Jewelry', 2008, 2, 294004.27);
insert into quarterly_sales values ('Jewelry', 2008, 3, 317217.32);
insert into quarterly_sales values ('Jewelry', 2008, 4, 329029.02);

insert into quarterly_sales values ('Jewelry', 2009, 1, 303878.78);
insert into quarterly_sales values ('Jewelry', 2009, 2, 307434.26);
insert into quarterly_sales values ('Jewelry', 2009, 3, 356987.76);
insert into quarterly_sales values ('Jewelry', 2009, 4, 389064.64);

insert into quarterly_sales values ('Jewelry', 2010, 1, 424543.28);
insert into quarterly_sales values ('Jewelry', 2010, 2, 444847.74);
insert into quarterly_sales values ('Jewelry', 2010, 3, 463746.46);
insert into quarterly_sales values ('Jewelry', 2010, 4, 584746.85);

insert into quarterly_sales values ('Jewelry', 2011, 1, 530946.46);
insert into quarterly_sales values ('Jewelry', 2011, 2, 546842.37);
insert into quarterly_sales values ('Jewelry', 2011, 3, 567890.56);


