Skip to content

Instantly share code, notes, and snippets.

@jay-babu
Created June 15, 2024 14:51
Show Gist options
  • Save jay-babu/f837a95aef619b46b108c5d68a3f923e to your computer and use it in GitHub Desktop.
Save jay-babu/f837a95aef619b46b108c5d68a3f923e to your computer and use it in GitHub Desktop.
INSERT INTO department (cohort_id, name, tax, bottledeposit, environmentfee)
VALUES
(16, 'CANNED COCKTAILS', 0.0635, 0.10, 0.05),
(16, 'MIXERS', 0.0635, 0.10, 0.05),
(16, 'WINE - DOMESTIC', 0.0635, 0.10, 0.05),
(16, 'AMARO', 0.0635, 0.10, 0.05),
(16, 'TEQUILA', 0.0635, 0.10, 0.05),
(16, 'WINE - IMPORTED', 0.0635, 0.10, 0.05),
(16, 'GIN', 0.0635, 0.10, 0.05),
(16, 'BOURBON', 0.0635, 0.10, 0.05),
(16, 'RYE', 0.0635, 0.10, 0.05),
(16, 'ALLOCATED ITEMS', 0.0635, 0.10, 0.05),
(16, 'PINTS', 0.0635, 0.10, 0.05),
(16, 'COCKTAILS', 0.0635, 0.10, 0.05),
(16, 'WINE - 187s', 0.0635, 0.10, 0.05),
(16, 'WINE - SPARKLING', 0.0635, 0.10, 0.05),
(16, 'CIDERS', 0.0635, 0.10, 0.05),
(16, 'CORDIALS', 0.0635, 0.10, 0.05),
(16, 'VODKA', 0.0635, 0.10, 0.05),
(16, 'STORE PICKS', 0.0635, 0.10, 0.05),
(16, 'NIPS', 0.0635, 0.10, 0.05),
(16, 'MEXCAL', 0.0635, 0.10, 0.05),
(16, 'WHISKEY', 0.0635, 0.10, 0.05),
(16, 'ETHNIC', 0.0635, 0.10, 0.05),
(16, 'SCOTCH', 0.0635, 0.10, 0.05),
(16, 'BEER - CRAFT', 0.0635, 0.10, 0.05),
(16, 'BEER - CT', 0.0635, 0.10, 0.05),
(16, 'ABSINTHE', 0.0635, 0.10, 0.05),
(16, 'RUM', 0.0635, 0.10, 0.05),
(16, 'SAKE', 0.0635, 0.10, 0.05),
(16, 'SODA', 0.0635, 0.10, 0.05),
(16, 'WINE MAGS - DOMESTIC', 0.0635, 0.10, 0.05),
(16, 'BRANDY', 0.0635, 0.10, 0.05),
(16, 'WINE - BOX', 0.0635, 0.10, 0.05),
(16, 'BEER - KEGS', 0.0635, 0.10, 0.05),
(16, 'SHERRY', 0.0635, 0.10, 0.05),
(16, 'WINE MAGSS - IMPORTED', 0.0635, 0.10, 0.05),
(16, 'TOBACCO', 0.0635, 0.10, 0.05),
(16, 'BEER - IMPORTED', 0.0635, 0.10, 0.05),
(16, 'WINE - SWEET', 0.0635, 0.10, 0.05),
(16, 'BITTERS', 0.0635, 0.10, 0.05),
(16, 'WINE - ORGANIC', 0.0635, 0.10, 0.05),
(16, 'SNACKS', 0.0635, 0.10, 0.05),
(16, 'WINE - BALLER!', 0.0635, 0.10, 0.05),
(16, 'VERMOUTH', 0.0635, 0.10, 0.05),
(16, 'NON ALC', 0.0635, 0.10, 0.05),
(16, 'MALTERNATIVES', 0.0635, 0.10, 0.05),
(16, 'WINE - SPLITS', 0.0635, 0.10, 0.05),
(16, 'HARD SELTZERS', 0.0635, 0.10, 0.05),
(16, 'BEER - NA', 0.0635, 0.10, 0.05),
(16, 'SINGLE MALT WHISKEY', 0.0635, 0.10, 0.05),
(16, 'IRISH WHISKEY', 0.0635, 0.10, 0.05),
(16, 'WINE - KOSHER', 0.0635, 0.10, 0.05),
(16, 'WINE - LOW CAL', 0.0635, 0.10, 0.05),
(16, 'FLAVORED WHISKEY', 0.0635, 0.10, 0.05),
(16, 'CANADIAN WHISKEY', 0.0635, 0.10, 0.05),
(16, 'BEER - DOMESTIC', 0.0635, 0.10, 0.05),
(16, 'PORT', 0.0635, 0.10, 0.05),
(16, 'COGNAC', 0.0635, 0.10, 0.05),
(16, 'MEAD', 0.0635, 0.10, 0.05),
(16, 'ACCESSORIES', 0.0635, 0.10, 0.05),
(16, 'WINE - LOCAL', 0.0635, 0.10, 0.05),
(16, 'MISC', 0.0635, 0.10, 0.05),
(16, 'THC', 0.0635, 0.10, 0.05),
(16, 'WINE - JUG', 0.0635, 0.10, 0.05),
(16, 'WINE - DESERT', 0.0635, 0.10, 0.05),
(16, 'GRAPPA', 0.0635, 0.10, 0.05),
(16, 'JUICE', 0.0635, 0.10, 0.05),
(16, 'BEER - GLUTEN FREE', 0.0635, 0.10, 0.05),
(16, 'BARWARE', 0.0635, 0.10, 0.05),
(16, 'ICE', 0.0635, 0.00, 0.00),
(16, 'WATER', 0.0635, 0.10, 0.05),
(16, 'DEPOSIT', 0.0635, 0.10, 0.05),
(16, 'COOLERS', 0.0635, 0.10, 0.05),
(16, 'EVENTS', 0.0635, 0.10, 0.05)
ON CONFLICT DO NOTHING;
inserts departments, then update items once i have dept ids
SELECT loyalty_customer.*
FROM loyalty_customer
LEFT JOIN loyalty_customer_points lcp ON loyalty_customer.id = lcp.loyalty_customer_id
WHERE loyalty_program_id = 34
AND lcp IS NULL
AND display_id NOT IN (
15828,
15556,
12183,
15554,
7916,
15585,
15587,
1,
15563,
15578,
15661,
15551,
15592,
15655,
15732,
15696,
15576,
15994,
15602,
12308,
15741,
15564,
15631,
15640,
15560,
15571,
15594,
7123,
15634,
15605,
15869,
15737,
15738,
15580,
15653,
15811,
15766,
15579,
13721,
15636,
15782,
15860,
15616,
15728,
15970,
15583,
15562,
15621,
15589,
15660,
15600,
15733,
15764,
15584,
15803,
15885,
15761,
15595,
15572,
15808,
15890,
15779,
15657,
15757,
15848,
15561,
13596,
13564,
15573,
15590,
10280,
15607,
15729,
10047,
15709,
15656,
15805,
15753,
9509,
15664,
15829,
15662,
15591,
15567,
15642,
15618,
9833,
15921,
15735,
14815,
15722,
15619,
15680,
44,
15762,
15826,
15909,
15638,
15613,
15938,
15601,
15681,
15777,
15577,
15812,
15817,
15941,
15625,
15672,
15907,
15887,
15710,
15742,
15647,
15677,
15736,
14832,
15659,
15615,
15588,
15683,
15791,
15712,
15646,
15651,
15626,
15855,
15555,
15711,
15727,
15624,
15569,
15894,
15612,
15623,
15687,
15713,
15916,
15871,
15566,
15797,
11555,
15940,
15671,
15879,
15689,
15574,
15806,
15839,
15852,
15724,
15843,
15867,
15888,
6203,
12159,
15965,
15614,
15582,
15575,
15878,
15730,
15990,
15633,
15568,
15947,
15726,
15746,
15772,
15597,
15639,
15846,
15837,
6504,
10910,
15824,
15686,
15734,
15945,
15684,
15847,
15719,
15893,
15858,
15795,
15622,
15815,
15641,
13102,
15663,
13503,
15840,
15609,
15701,
15868,
15743,
15877,
15740,
15910,
15755,
15172,
15645,
15896,
15611,
15752,
15570,
15992,
15905,
15884,
15827,
15866,
15715,
15975,
15989,
15948,
15832,
15780,
9493,
15835,
15649,
15767,
15807,
15565,
11454,
15716,
15784,
6409,
15946,
15820,
15698,
5649,
5216,
15617,
15845,
15928,
15899,
15750,
15620,
15836,
15768,
15881,
15606,
15559,
15932,
15900,
15774,
15821,
15816,
15682,
12642,
15936,
15984,
15937,
15697,
15870,
6698,
15980,
15700,
15669,
15670,
15901,
9407,
15380,
15973,
15628,
15694,
15603,
15790,
15810,
15771,
15865,
15908,
15919,
15695,
15787,
15833,
15654,
15688,
15830,
15748,
15986,
15693,
15987,
15690,
15831,
12608,
15841,
12476,
15635,
15898,
9341,
15714,
15925,
15666,
15969,
5765,
15851,
15914,
15644,
15796,
15731,
15794,
15819,
15676,
7640,
15874,
15667,
15864,
5587,
15962,
15922,
15931,
15889,
15802,
15637,
15627,
15759,
15926,
15976,
15895,
9147,
4359,
15891,
15581,
15718,
15959,
15783,
15861,
15966,
15675,
15960,
5844,
15964,
15904,
15955,
15801,
15789,
15770,
15804,
14574,
15763,
15798,
15773,
15781,
15720,
15792,
15604,
15760,
15800,
15799,
15778,
15769,
15765,
15853,
15758,
15785,
11578,
15793,
15776,
15814,
15834,
15723,
15788,
15775,
15756,
11109,
15974,
14564,
15685,
15705,
15674,
11969,
15983,
12447,
15668,
15702,
15786,
15557,
15956,
15652,
15658,
15708,
8136,
15949,
15880,
15608,
15985,
15923,
15967,
15673,
15897,
15968,
15954,
15977,
15953,
15707,
4280,
15862,
5218,
15558,
14338,
5836,
15979,
1604,
15818,
9601,
15924,
15886,
15844,
15717,
15934,
15957,
15944,
15875,
15882,
15863,
15754,
15873,
15972,
15939,
15699,
15679,
15704,
15692,
15703,
15854,
15991,
15911,
15838,
15942,
15678,
15665,
15933,
15935,
15747,
15930,
6986,
15988,
15593,
15823,
15951,
15725,
15952,
6328,
15650,
15857,
15902,
15813,
15993,
15906);
this is the select for customers without points. delete using the customer_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment