-
Notifications
You must be signed in to change notification settings - Fork 0
/
freshalert.sql
567 lines (544 loc) · 48.8 KB
/
freshalert.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
-- Manager 테이블 생성
CREATE TABLE manager (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
code INT UNIQUE NOT NULL -- Integer 타입으로 변경
);
-- ProductName 테이블 생성
CREATE TABLE product_name (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(128) NOT NULL UNIQUE -- name은 VARCHAR(128) 타입으로 설정
);
-- Product 테이블 생성
CREATE TABLE product (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
product_name_id INT NOT NULL,
quantity INT,
expiration DATE, -- 날짜 형식
checked BOOLEAN DEFAULT FALSE, -- Boolean 필드, 기본값은 FALSE
created_at DATETIME DEFAULT CURRENT_TIMESTAMP, -- 생성 날짜, 기본값은 현재 시간
deleted_at DATETIME NULL, -- 삭제 날짜, NULL 허용
CONSTRAINT fk_product_name FOREIGN KEY (product_name_id) REFERENCES product_name(id) -- 외래키 설정
);
INSERT INTO product_name(name) VALUES
('서울우유 1.8L'),
('서울우유 목장 저지방'),
('서울우유 목장 신선'),
('서울우유 1000ml'),
('매일 엣지우유 (오리지널) 2묶음'),
('매일 소화가 잘되는 우유'),
('매일 두유 99.9 950ml'),
('매일 아몬드 브리즈 오리지널'),
('매일 허쉬 초콜릿 235ml'),
('남양 초코에몽 180ml'),
('매일 멸균우유 커피'),
('매일 멸균우유 딸기'),
('매일 멸균우유 초코'),
('빙그레 바이오플레인 (프로바이오틱스)'),
('엔요'),
('매일 바이오거트 플레인'),
('매일 바이오 플레인 무가당'),
('매일 바이오거트 딸기'),
('남양 이오 요구르트'),
('남양 프렌치카페(카페오레)'),
('매일 바이오드링킹 딸기 250ml'),
('매일 바이오드링킹 플레인 250ml'),
('서울우유 연유 500g'),
('서울우유 휘핑크림 1kg'),
('서울우유 쿠킹크림 1kg'),
('매일 바리스타 바닐라'),
('스타벅스 카페라떼 270ml'),
('빙그레 바나나맛 우유 240ml'),
('매일 대용량 요구르트 280ml'),
('동 이태리안 피자치즈 280g'),
('서울 요리왕 모짜 치즈 240g'),
('매일 모짜렐라 피자치즈 200g'),
('동 이태리안 피자치즈 70g'),
('서울 미니 슈레드 치즈 60g'),
('매일 체다 슬라이스 치즈 180g'),
('서울 체다 치즈 100g'),
('서울 아기 치즈 180g'),
('서울 필라델피아 크림치즈 190g'),
('서울 버터 240g'),
('롯데 홈버터 200g'),
('서울 버터 450g (무염)'),
('CJ 요거젤리 딸기 210g'),
('CJ 쁘띠첼 포도 210g'),
('CJ 쁘띠첼 복숭아 210g'),
('CJ 요거젤리 밀감 210g'),
('뚝배기 청국장 300g'),
('다담 우렁 강된장 양념'),
('CJ 다담 된장찌개 전용'),
('한 다진 마늘 (국산)'),
('종 다진 마늘'),
('웰빙 영양란 10구'),
('웰빙 영양란 15구'),
('메추리 20구'),
('매콤 바삭 먹태 60g'),
('지리 멸치 100g'),
('가이리 멸치 (소) 100g'),
('다시 멸치 100g'),
('조미 오징어 150g'),
('북어채 90g'),
('일 쌈무 (와) 350g'),
('일 쌈무 (새) 350g'),
('일 쫄깃 치자 단무지'),
('일 맛 단무지 250g'),
('일 깐 마늘 250g'),
('대 깐 메추리알 270g'),
('해인 떡볶이 소스 150g'),
('하림 닭볶음탕 양념'),
('CJ 다담 마파두부 양념'),
('CJ 다담 바지락 순두부'),
('CJ 다담 소고기 우렁 된장'),
('CJ 다담 냉이 된장 140g'),
('CJ 다담 정통 된장찌개'),
('CJ 다담 청국장 찌개'),
('CJ 다담 부대찌개 양념'),
('한 한끼 연근 조림 150g'),
('한 한끼 간장 깻잎 150g'),
('한 한끼 양념 깻잎 150g'),
('한 한끼 무말랭이 150g'),
('한 한끼 알 마늘 150g'),
('한 한끼 콩자반 150g'),
('한성 한끼 명이나물 150g'),
('요리한수 바지락 순두부'),
('요리한수 된장찌개 양념'),
('찰 옥수수 300g'),
('하림 닭가슴살 (오) 110g'),
('하림 닭가슴살 (훈제)'),
('대 스노우크랩 (오리지널)'),
('비엔나 기획 270g'),
('숯불구이 비엔나 100g'),
('의성 마늘 햄 60g'),
('미니 비엔나 140g'),
('빅 새우맛 바 120g'),
('오양 불고기맛 후랑크'),
('청정원 불고기 왕 꼬치 90g'),
('숯불구이 맛 후랑크 소시지'),
('의성 마늘 프랑크 70g'),
('휠터치-S 70g'),
('삼립 강릉식 장칼국수'),
('CJ 가쓰우동 465g'),
('송 추억 국물 떡볶이'),
('한 가쓰오 우동 1인분'),
('한 짬뽕 맛 우동 1인분'),
('한 튀김 맛 우동'),
('한 우동 사리 200g'),
('칠갑 감자 수제비'),
('목 오리훈제 (슬라이스)'),
('두레 족발 (슬라이스)'),
('평산 족발 350g'),
('대 주부 초밥짱 320g'),
('대 주부 초밥짱 160g'),
('한 전골 어묵 270g'),
('대 야채 사각 어묵 180g'),
('대 부산 어묵 얇은 사각'),
('대 국탕용 기획'),
('순두부'),
('청정원 찌개 두부'),
('청정원 부침 두부'),
('청정원 국산콩 두부'),
('종 숙주 나물 200g'),
('대 신선 콩나물 (수)'),
('청 안심 콩나물 350g'),
('칠갑 쫄면 1kg'),
('칠갑 냉면 1kg'),
('사해인 냉면 육수 (소고기)'),
('사해인 냉면 육수 (동치미)'),
('홍 쌀떡 500g'),
('칠 쌀떡 (쫄깃) 500g'),
('송 꼬마 쌀떡볶이 떡'),
('밀 떡볶이 떡'),
('감자 칼국수'),
('생 칼국수'),
('칠 들깨 수제비 455g'),
('청 숙성 동치미 물냉면'),
('CJ 볼로냐 스파게티'),
('청정원 매콤 새콤 쫄면'),
('송 매콤 국물 떡볶이 375g'),
('송학 쫄면 쌀떡볶이'),
('목우촌 안심 삼계탕'),
('종갓집 묵은지 김치찌개'),
('청정원 햄 김치 부대찌개'),
('축 진감자탕'),
('평양 물냉면'),
('함흥 비빔 냉면'),
('일 김밥 단무지 400g'),
('일 사각 단무지 550g'),
('일 치자 김밥 단무지'),
('일 우엉 플러스'),
('일 양념 우엉 (김밥)'),
('롯 알뜰 소시지 350g'),
('영성 영성 맛 김치 430g'),
('영성 영성 맛 김치 220g'),
('종가 맛 김치 200g'),
('종가 볶음 김치'),
('일 양념 깻잎 500g'),
('일 청량 고추 오이 250g'),
('일 마늘 쫑 무침 150g'),
('일 무말랭이 180g'),
('일 오이 피클 350g'),
('칠 참새우 젓 300g'),
('칠 참새우 젓 160g'),
('칠 특 낙지 젓갈 160g'),
('칠 특 창란 젓갈 160g'),
('오징어 젓갈'),
('대 크라비아 90g'),
('오양 맛살 190g'),
('목 불고기 햄 300g'),
('대 담백한 베이컨 140g'),
('대 숯불 김밥 햄 100g'),
('의성 마늘 김밥 햄 100g'),
('의성 마늘 프랑크'),
('목 프랑크 230g'),
('대림 하우스 그릴 부어'),
('청정원 양파 마늘 스모크'),
('동원 그릴 직화 부어스트'),
('롯 의성 마늘 햄 160g'),
('롯 의성 마늘 떡갈비 130g'),
('롯데 직꾸닭 200g'),
('한 명란 톡톡 떡갈비 120g'),
('진 바베큐 닭다리 170g'),
('대 스모크 치킨 180g'),
('진 포차 순대 500g');
insert into manager(code) values ('1111');
-- product 테이블에 정보 삽입
-- product 테이블에 제품 정보 삽입
INSERT INTO product(`product_name_id`, `expiration`, `quantity`,`checked`,`created_at`,`deleted_at`) VALUES
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('서울우유 1.8L',' ','')), '2024-09-22', 1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ' ,'') = REPLACE('서울우유 목장 신선',' ','')), '2024-09-21', 1,0, now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('서울우유 1000ml',' ','')), '2024-09-22', 3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 엣지우유 (오리지널) 2묶음',' ','')), '2024-09-23', 2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 소화가 잘되는 우유',' ','')), '2024-09-23', 2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 소화가 잘되는 우유',' ','')), '2024-09-25', 3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 두유 99.9 950ml',' ','')), '2024-12-04', 2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 아몬드 브리즈 오리지널', ' ', '')), '2025-02-28', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 허쉬 초콜릿 235ml', ' ', '')), '2024-10-29', 5, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('남양 초코에몽 180ml', ' ', '')), '2024-10-01', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 멸균우유 커피', ' ', '')), '2024-10-01', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 멸균우유 커피', ' ', '')), '2024-10-27', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 멸균우유 딸기', ' ', '')), '2024-11-18', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 멸균우유 초코', ' ', '')), '2024-11-19', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('빙그레 바이오플레인(프로바이오틱스)', ' ', '')), '2024-09-22', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('엔요', ' ', '')), '2024-09-15', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('엔요', ' ', '')), '2024-09-20', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('엔요', ' ', '')), '2024-09-23', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바이오거트 플레인', ' ', '')), '2024-09-23', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바이오거트 딸기', ' ', '')), '2024-09-22', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바이오 플레인 무가당', ' ', '')), '2024-09-17', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바이오거트 딸기', ' ', '')), '2024-09-23', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('남양 이오요구르트', ' ', '')), '2024-09-19', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바이오드링킹 딸기 250ml', ' ', '')), '2024-09-15', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바이오드링킹 딸기 250ml', ' ', '')), '2024-09-20', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바이오드링킹 플레인 250ml', ' ', '')), '2024-09-21', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울우유 연유 500g', ' ', '')), '2024-11-13', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울우유 휘핑크림 1kg', ' ', '')), '2025-01-14', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울우유 쿠킹크림 1kg', ' ', '')), '2024-10-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바리스타 바닐라', ' ', '')), '2024-11-04', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 바리스타 바닐라', ' ', '')), '2024-11-18', 10, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('남양 프렌치카페(카페오레)', ' ', '')), '2024-10-01', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('스타벅스 카페라떼 270ml', ' ', '')), '2024-10-20', 7, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('빙그레 바나나맛 우유 240ml', ' ', '')), '2024-09-22', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('빙그레 바나나맛 우유 240ml', ' ', '')), '2024-09-23', 8, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 대용량요구르트 280ml', ' ', '')), '2024-09-17', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('동 이태리안피자치즈 280g', ' ', '')), '2024-10-11', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울 요리왕모짜치즈 240g', ' ', '')), '2024-10-11', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 모짜렐라 피자치즈 200g', ' ', '')), '2024-10-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 모짜렐라 피자치즈 200g', ' ', '')), '2024-11-18', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('동 이태리안피자치즈 70g', ' ', '')), '2024-12-03', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울 미니슈레드치즈 60g', ' ', '')), '2024-10-14', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('매일 체다슬라이스치즈 180g', ' ', '')), '2024-10-16', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울 체다치즈 100g', ' ', '')), '2025-01-02', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울 아기치즈 180g', ' ', '')), '2024-11-09', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울 필라델피아크림치즈 190g', ' ', '')), '2025-01-05', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ', '') = REPLACE('서울 버터 240g',' ','')), '2024-10-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name, ' ','') = REPLACE('롯데 홈버터 200g',' ','')), '2025-01-16', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('서울 버터 450g(무염)',' ','')), '2024-12-19', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 요거젤리 딸기 210g',' ','')), '2024-10-01', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 요거젤리 딸기 210g',' ','')), '2024-12-27', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 쁘띠첼 포도 210g',' ','')), '2024-12-23', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 쁘띠첼 복숭아 210g',' ','')), '2024-11-17', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 쁘띠첼 복숭아 210g',' ','')), '2025-01-03', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 요거젤리 밀감 210g',' ','')), '2025-01-11', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('뚝배기 청국장 300g',' ','')), '2024-09-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('다담 우렁강된장 양념',' ','')), '2025-01-04', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 청국장찌개',' ','')), '2024-11-02', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 된장찌개전용',' ','')), '2025-01-02', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 된장찌개전용',' ','')), '2025-01-03', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 다진마늘(국산)',' ','')), '2024-11-03', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 다진마늘(국산)',' ','')), '2024-12-22', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종 다진마늘',' ','')), '2024-10-21', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('웰빙 영양란 10구',' ','')), '2024-10-20', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('웰빙 영양란 15구',' ','')), '2024-10-20', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('메추리 20구',' ','')), '2024-10-10', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('메추리 20구',' ','')), '2024-10-24', 5, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매콤 바삭먹태 60g',' ','')), '2024-12-20', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('지리멸치 100g',' ','')), '2025-02-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('지리멸치 100g',' ','')), '2025-03-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('가이리멸치(소) 100g',' ','')), '2024-11-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('다시멸치 100g',' ','')), '2024-12-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('다시멸치 100g',' ','')), '2025-03-25', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('조미오징어 150g',' ','')), '2025-04-08', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('북어채 90g',' ','')), '2024-12-10', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('북어채 90g',' ','')), '2025-04-21', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 쌈무(와) 350g',' ','')), '2024-10-10', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 쌈무(와) 350g',' ','')), '2024-11-30', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 쌈무(새) 350g',' ','')), '2024-12-10', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 쌈무(새) 350g',' ','')), '2025-02-20', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 쫄깃치자단무지',' ','')), '2024-10-15', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 맛단무지 250g',' ','')), '2025-01-15', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 맛단무지 250g',' ','')), '2025-01-30', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 깐마늘 250g',' ','')), '2025-04-30', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 깐마늘 250g',' ','')), '2025-05-30', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 깐메추리알 270g',' ','')), '2024-11-22', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('해인 떡볶이소스 150g',' ','')), '2024-12-14', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('하림 닭볶음탕양념',' ','')), '2024-10-08', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 마파두부양념',' ','')), '2024-10-24', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 바지락순두부',' ','')), '2025-04-22', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 소고기우렁된장',' ','')), '2025-05-15', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 소고기우렁된장',' ','')), '2025-02-16', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 냉이된장 140g',' ','')), '2025-04-03', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 정통된장찌개',' ','')), '2025-05-07', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 정통된장찌개',' ','')), '2025-05-11', 5, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 청국장찌개',' ','')), '2025-02-09', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 청국장찌개',' ','')), '2025-03-17', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 부대찌개양념',' ','')), '2025-03-12', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 한끼연근조림 150g',' ','')), '2025-05-10', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 한끼간장깻잎 150g',' ','')), '2024-10-11', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 한끼양념깻잎 150g',' ','')), '2025-05-30', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 한끼무말랭이 150g',' ','')), '2024-10-12', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 한끼무말랭이 150g',' ','')), '2024-12-28', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 한끼알마늘 150g',' ','')), '2024-11-20', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 한끼콩자반 150g',' ','')), '2025-01-02', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한성 한끼명이나물 150g',' ','')), '2025-01-02', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한성 한끼명이나물 150g',' ','')), '2024-10-07', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('요리한수 바지락순두부',' ','')), '2024-10-22', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('요리한수 된장찌개양념',' ','')), '2024-12-19', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('찰옥수수 300g',' ','')), '2024-11-20', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('하림 닭가슴살(오) 110g',' ','')), '2024-09-28', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('하림 닭가슴살(훈제)',' ','')), '2024-09-15', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 스노우크랩(오리지널)',' ','')), '2024-09-27', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('비엔나기획 270g',' ','')), '2024-09-25', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('숯불구이비엔나 100g',' ','')), '2024-09-16', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('숯불구이비엔나 100g',' ','')), '2024-09-20', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('의성마늘햄60g',' ','')), '2024-09-17', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('미니비엔나140g',' ','')), '2024-10-08', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('빅새우맛바120g',' ','')), '2024-09-15', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('오양 불고기맛후랑크',' ','')), '2024-10-05', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 불고기왕꼬치90g',' ','')), '2024-10-06', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('숯불구이맛후랑크소시지',' ','')), '2024-10-04', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('의성마늘프랑크70g',' ','')), '2024-10-01', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('휠터치-S70g',' ','')), '2024-09-17', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('휠터치-S70g',' ','')), '2024-09-27', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('삼립 강릉식 장칼국수',' ','')), '2024-09-30', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 가쓰우동465g',' ','')), '2025-01-11', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('송 추억국물떡볶이',' ','')), '2024-10-04', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 가쓰오우동1인분',' ','')), '2024-11-19', 5, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 짬뽕맛우동1인분',' ','')), '2024-10-23', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 튀김맛우동',' ','')), '2024-10-28', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 튀김맛우동',' ','')), '2024-12-17', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 우동사리200g',' ','')), '2024-12-26', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 우동사리200g',' ','')), '2025-01-09', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠갑 감자수제비',' ','')), '2024-10-31', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('목 오리훈제(슬라이스)',' ','')), '2024-09-20', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('두레 족발(슬라이스)',' ','')), '2025-01-21', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('두레 족발(슬라이스)',' ','')), '2025-02-03', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('평산 족발350g',' ','')), '2024-10-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('평산 족발350g',' ','')), '2024-11-01', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 주부초밥짱320g',' ','')), '2024-11-10', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 주부초밥짱160g',' ','')), '2024-10-19', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 전골어묵270g',' ','')), '2024-09-16', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 야채사각어묵180g',' ','')), '2024-09-14', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 야채사각어묵180g',' ','')), '2024-09-15', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 부산어묵얇은사각',' ','')), '2024-09-15', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 부산어묵얇은사각',' ','')), '2024-09-19', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 국탕용기획',' ','')), '2024-09-15', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('순두부',' ','')), '2024-09-20', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 찌개두부',' ','')), '2024-09-19', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 부침두부',' ','')), '2024-09-21', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 국산콩두부',' ','')), '2024-09-21', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종 숙주나물200g',' ','')), '2024-09-15', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 신선콩나물(수)',' ','')), '2024-09-17', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 신선콩나물(수)',' ','')), '2024-09-18', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청 안심콩나물350g',' ','')), '2024-09-12', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청 안심콩나물350g',' ','')), '2024-09-14', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청 안심콩나물350g',' ','')), '2024-09-16', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠갑 쫄면1kg',' ','')), '2024-10-31', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠갑 냉면1kg',' ','')), '2024-10-12', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠갑 냉면1kg',' ','')), '2024-11-08', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('사해인 냉면육수(소고기)',' ','')), '2025-06-16', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('사해인 냉면육수(소고기)',' ','')), '2025-07-08', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('사해인 냉면육수(소고기)',' ','')), '2025-08-21', 6, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('사해인 냉면육수(동치미)',' ','')), '2025-07-07', 7, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('홍 쌀떡500g',' ','')), '2024-11-11', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 쌀떡(쫄깃)500g',' ','')), '2024-11-12', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 쌀떡(쫄깃)500g',' ','')), '2024-11-17', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('송 꼬마쌀떡볶이떡',' ','')), '2024-11-21', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('밀 떡볶이떡',' ','')), '2024-11-08', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('감자칼국수',' ','')), '2024-09-17', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('생칼국수',' ','')), '2024-10-18', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 들깨수제비455g',' ','')), '2024-11-26', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 들깨수제비455g',' ','')), '2024-09-16', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청 숙성동치미 물냉면',' ','')), '2025-01-02', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ볼로냐스파게티',' ','')), '2024-11-06', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 매콤새콤쫄면',' ','')), '2024-10-26', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('송 매콤국물떡볶이375g',' ','')), '2024-09-24', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('송학 쫄면 쌀떡볶이',' ','')), '2024-10-21', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('목우촌 안심삼계탕',' ','')), '2025-07-11', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종갓집 묵은지김치찌개',' ','')), '2024-09-24', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 햄김치부대찌개',' ','')), '2024-09-20', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('축 진감자탕',' ','')), '2024-12-30', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('평양 물냉면',' ','')), '2024-09-24', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('평양 물냉면',' ','')), '2024-10-07', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('함흥비빔냉면',' ','')), '2024-10-07', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 김밥단무지400g',' ','')), '2025-02-15', 8, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 사각단무지550g',' ','')), '2024-11-30', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 치자김밥단무지',' ','')), '2024-09-15', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 치자김밥단무지',' ','')), '2024-10-30', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 우엉플러스',' ','')), '2025-01-30', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 양념우엉(김밥)',' ','')), '2025-04-15', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('롯 알뜰소시지350g',' ','')), '2024-11-07', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('롯 알뜰소시지350g',' ','')), '2024-11-19', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('롯 알뜰소시지350g',' ','')), '2024-12-03', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('영성 영성맛김치430g',' ','')), '2024-10-10', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('영성 영성맛김치220g',' ','')), '2024-09-22', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종가 맛김치200g',' ','')), '2024-09-24', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종가 맛김치200g',' ','')), '2024-09-28', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종가 볶음김치',' ','')), '2024-10-12', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종가 볶음김치',' ','')), '2024-11-11', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 양념깻잎500g',' ','')), '2025-06-30', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 양념깻잎500g',' ','')), '2025-07-30', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 청량고추오이250g',' ','')), '2025-02-28', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 청량고추오이250g',' ','')), '2025-04-30', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 마늘쫑무침150g',' ','')), '2025-03-30', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 마늘쫑무침150g',' ','')), '2025-06-30', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 무말랭이180g',' ','')), '2025-03-30', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 오이피클350g',' ','')), '2025-01-30', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 오이피클350g',' ','')), '2025-02-28', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 참새우젓300g',' ','')), '2025-04-02', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 참새우젓300g',' ','')), '2025-07-03', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 참새우젓160g',' ','')), '2025-05-01', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 특낙지젓갈160g',' ','')), '2025-10-31', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 특창란젓갈160g',' ','')), '2025-03-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('칠 특창란젓갈160g',' ','')), '2025-06-02', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('오징어젓갈',' ','')), '2025-04-02', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('오징어젓갈',' ','')), '2025-02-19', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 크라비아90g',' ','')), '2024-09-30', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('오양 맛살190g',' ','')), '2024-10-08', 10, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('목 불고기햄300g',' ','')), '2024-10-11', 5, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 담백한베이컨140g',' ','')), '2024-09-22', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 숯불김밥햄100g',' ','')), '2024-10-09', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 숯불김밥햄100g',' ','')), '2024-10-20', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('의성마늘김밥햄100g',' ','')), '2024-09-21', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('의성마늘김밥햄100g',' ','')), '2024-10-01', 4, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('의성마늘프랑크',' ','')), '2024-10-07', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('목 프랑크230g',' ','')), '2024-10-13', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대림 하우스그릴부어',' ','')), '2024-09-21', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대림 하우스그릴부어',' ','')), '2024-10-08', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 양파마늘스모크',' ','')), '2024-10-08', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('동원 그릴직화부어스트',' ','')), '2024-09-19', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('롯 의성마늘햄160g',' ','')), '2024-10-02', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('롯 의성마늘떡갈비130g',' ','')), '2024-09-28', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('롯 의성마늘떡갈비130g',' ','')), '2024-10-06', 3, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('롯데 직꾸닭200g',' ','')), '2024-10-11', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('한 명란톡톡떡갈비120g',' ','')), '2024-09-24', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('진 바베큐닭다리170g',' ','')), '2024-09-16', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 스모크치킨 180g',' ','')), '2024-09-21', 2, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('진 포차순대 500g',' ','')), '2024-09-25', 1, 0, now(), null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('진 포차순대 500g',' ','')), '2024-09-27', 1, 0, now(), null);
INSERT INTO product_name(name) VALUES
('매일 엣지우유(오리지날)'),
('빙그레 바이오플레인(사과)'),
('송 밀 떡볶이 400g'),
('대 칼집 그릴비엔나 280g'),
('청정원 왕 떡볶이 420g'),
('종 콩이 가득 두부 500g'),
('매일 바이오거트 딸기 로어');
INSERT INTO product(`product_name_id`, `expiration`, `quantity`,`checked`,`created_at`,`deleted_at`) VALUES
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('일 김밥단무지400g',' ','')),'2025-02-28',8,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('진 바베큐 닭다리 170g',' ','')),'2024-09-28',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('하림 닭가슴살 (오) 110g',' ','')),'2024-10-13',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('의성마늘햄60g',' ','')),'2024-09-26',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('의성마늘햄60g',' ','')),'2024-10-04',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 스모크 치킨 180g',' ','')),'2024-09-26',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('가이리 멸치 (소) 100g',' ','')),'2025-04-25',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('순두부',' ','')),'2024-10-01',5,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 국탕용 기획',' ','')),'2024-09-19',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 국탕용 기획',' ','')),'2024-09-20',10,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 부산 어묵 얇은 사각',' ','')),'2024-09-20',3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 부산 어묵 얇은 사각',' ','')),'2024-09-21',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 야채 사각 어묵 180g',' ','')),'2024-09-20',3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 야채 사각 어묵 180g',' ','')),'2024-09-21',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청 안심 콩나물 350g',' ','')),'2024-09-17',3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 신선 콩나물 (수)',' ','')),'2024-09-18',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 신선 콩나물 (수)',' ','')),'2024-09-20',4,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종 숙주 나물 200g',' ','')),'2024-09-19',3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('빅새우맛바120g',' ','')),'2024-10-13',3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 찌개두부',' ','')),'2024-09-20',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 찌개두부',' ','')),'2024-09-19',4,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 부침 두부',' ','')),'2024-09-25',3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 부침 두부',' ','')),'2024-09-22',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 엣지우유(오리지날)',' ','')),'2024-09-26',4,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('빙그레 바이오플레(사과)',' ','')),'2024-09-24',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('빙그레 바이오플레(사과)',' ','')),'2024-09-28',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 바이오거트 딸기',' ','')),'2024-10-02',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 허쉬 초콜릿 235ml',' ','')),'2024-12-03',4,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('빙그레 바나나맛 우유 240ml',' ','')),'2024-09-28',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('빙그레 바나나맛 우유 240ml',' ','')),'2024-09-28',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 바이오 플레인 무가당',' ','')),'2024-09-24',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('송 밀떡볶이400g',' ','')),'2024-11-19',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('송 밀떡볶이400g',' ','')),'2024-11-21',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('숯불구이 비엔나 100g',' ','')),'2024-10-01',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('숯불구이 비엔나 100g',' ','')),'2024-10-06',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('대 칼집 그릴비엔나 280g',' ','')),'2024-10-06',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('CJ 다담 바지락 순두부',' ','')),'2025-05-13',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('청정원 왕 떡볶이 420g',' ','')),'2024-10-21',2,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('종 콩이 가득 두부 500g',' ','')),'2024-10-01',8,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 소화가 잘되는 우유',' ','')),'2024-09-26',3,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 소화가 잘되는 우유',' ','')),'2024-09-25',1,0,now(),null),
((SELECT id FROM product_name WHERE REPLACE(name,' ','') = REPLACE('매일 바이오거트 딸기 로어',' ','')),'2024-09-22',3,0,now(),null);
use smallbut;
set session cte_max_recursion_depth=30000000;
-- 더미 데이터 삽입 쿼리
INSERT INTO product (`product_name_id`, `expiration`, `quantity`, `checked`, `created_at`, `deleted_at`)
WITH RECURSIVE cte (n) AS
(
SELECT 1
UNION ALL
SELECT n + 1 FROM cte WHERE n < 3000000 -- 원하는 데이터 개수
)
SELECT
(SELECT id FROM product_name ORDER BY RAND() LIMIT 1) AS product_name_id, -- product_name 테이블에서 랜덤 id 선택
DATE_ADD('2024-01-01', INTERVAL FLOOR(RAND() * 365) DAY) AS expiration, -- 최대 1년 이후의 랜덤 유통기한
FLOOR(1 + RAND() * 100) AS quantity, -- 1부터 100 사이의 랜덤 수량
FALSE AS checked, -- 체크 여부 false로 설정
NOW() AS created_at, -- 현재 시간
NULL AS deleted_at -- 삭제 시간은 NULL
FROM cte
LIMIT 3000000;
select count(*) from product;
select count(*) from product_name;
select * from product;
select p.id, pn.name, p.quantity, p.expiration, p.checked from product p
JOIN product_name pn ON p.product_name_id = pn.id
WHERE p.expiration > curdate()
ORDER BY p.id;
'-> Sort: p.id (actual time=15159..15354 rows=1.99e+6 loops=1)\n
-> Stream results (cost=532932 rows=507486) (actual time=1.59..13909 rows=1.99e+6 loops=1)\n
-> Nested loop inner join (cost=532932 rows=507486) (actual time=1.58..13408 rows=1.99e+6 loops=1)\n
-> Covering index scan on pn using name (cost=18.4 rows=181) (actual time=0.214..0.578 rows=181 loops=1)\n
-> Filter: (p.expiration > <cache>(curdate())) (cost=2105 rows=2804) (actual time=0.787..73.4 rows=11020 loops=181)\n
-> Index lookup on p using fk_product_name (product_name_id=pn.id) (cost=2105 rows=8412) (actual time=0.787..72.7 rows=11050 loops=181)\n'
select * from product;
'-> Sort: p.expiration (actual time=13695..13871 rows=1.99e+6 loops=1)\n
-> Stream results (cost=194 rows=166) (actual time=0.313..12560 rows=1.99e+6 loops=1)\n
-> Nested loop inner join (cost=194 rows=166) (actual time=0.303..12038 rows=1.99e+6 loops=1)\n
-> Covering index scan on pn using name (cost=19.2 rows=182) (actual time=0.0986..0.472 rows=182 loops=1)\n
-> Filter: (p.expiration > <cache>(curdate())) (cost=0.685 rows=0.913) (actual time=0.293..65.5 rows=10961 loops=182)\n
-> Index lookup on p using fk_product_name (product_name_id=pn.id) (cost=0.685 rows=2.74) (actual time=0.293..64.7 rows=10992 loops=182)\n'
'-> Sort: p.expiration (actual time=13695..13871 rows=1.99e+6 loops=1)\n
-> Stream results (cost=194 rows=166) (actual time=0.313..12560 rows=1.99e+6 loops=1)\n
-> Nested loop inner join (cost=194 rows=166) (actual time=0.303..12038 rows=1.99e+6 loops=1)\n
-> Covering index scan on pn using name (cost=19.2 rows=182) (actual time=0.0986..0.472 rows=182 loops=1)\n
-> Filter: (p.expiration > <cache>(curdate())) (cost=0.685 rows=0.913) (actual time=0.293..65.5 rows=10961 loops=182)\n
-> Index lookup on p using fk_product_name (product_name_id=pn.id) (cost=0.685 rows=2.74) (actual time=0.293..64.7 rows=10992 loops=182)\n'