Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finished #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ExpandedNodes": [
"",
"\\data"
],
"PreviewInSolutionExplorer": false
}
Binary file not shown.
Binary file added .vs/forage-walmart-task-4/v17/.wsuo
Binary file not shown.
12 changes: 12 additions & 0 deletions .vs/forage-walmart-task-4/v17/DocumentLayout.backup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\chuya\\source\\repos\\forage-walmart-task-4\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}
12 changes: 12 additions & 0 deletions .vs/forage-walmart-task-4/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\chuya\\source\\repos\\forage-walmart-task-4\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
46 changes: 46 additions & 0 deletions data/product_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
id,name
1,lotion
2,windows
3,skis
4,bikes
5,candy
6,capes
7,carnivorous plants
8,shoes
9,snakes
10,alternators
11,motor oil
12,trampolines
13,paint
14,hydroponic equipment
15,lamps
16,fruit
17,balloons
18,pants
19,apples
20,water bottles
21,pencil sharpeners
22,yarn
23,journals
24,socks
25,toys
26,coffee
27,board games
28,eggs
29,calculators
30,guitars
31,yoga mats
32,hvac
33,pencils
34,keyboards
35,earplugs
36,candles
37,fishing poles
38,hats
39,animal masks
40,furniture
41,baby food
42,microwaves
43,textbooks
44,keys
45,incense
155 changes: 155 additions & 0 deletions data/shipment_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
id,product_id,quantity,origin,destination
1,1,59,d5566b15-b071-4acf-8e8e-c98433083b2d,50d33715-4c77-4dd9-8b9d-ff1ca372a2a2
2,2,28,c42f0de8-b4f0-4167-abd1-ae79e5e18eea,172eb8f3-1033-4fb6-b66b-d0df09df3161
3,3,63,b145f396-de9b-42f1-9cc9-f5b52c3a941c,65e4544d-42ae-4751-9580-bdcb90e5fcda
4,4,47,f4372224-759f-43b3-bc83-ca6106bba1af,745bee4e-710c-4538-8df1-5c146e1092a6
5,5,73,49d0edae-9091-41bb-a08d-ab1c66bd08d5,425b7a1a-b744-4c6b-898e-d424dd8cf18e
6,6,35,b26d55e2-eb75-4bce-89cf-5cee095eaeea,0495233b-9470-4e1a-bb30-a1ee3150c092
7,7,5,6ae04f04-85df-4b89-b057-5cb0459baab7,b0fcee8c-9047-405c-8316-28a38292be9d
8,8,85,9a6ee454-f8ca-4a5a-b751-402ce8257b5b,5958bf67-e190-4171-91eb-298b69c89282
9,9,34,84003744-296e-4294-86a3-8a96439d4ee8,d15bcc56-8948-4c3d-98ae-925d64b3f539
10,10,88,b23deb12-0dc3-40c3-889c-8e8d3206dc4a,a22439e8-7918-4cae-806a-9f6ae0de6828
11,11,72,7cd8ea7c-cea3-46fa-a913-724d59233a43,5f3d5c26-5d8b-4e48-88b0-b89d6aa5848d
12,12,15,446119d3-b86d-4648-93e1-7c9104fe6462,7486257f-61aa-4829-bafa-3d46366ce403
13,8,68,c42e63e2-e613-45df-9321-09c58bcedcf4,a3421fb8-ec22-489a-b8b2-8760a0474175
14,13,58,742df199-0e51-44d2-93ba-a5e3885d79ed,2aba8b17-dd45-46e7-84df-701e2f319c1b
15,14,40,c32eed70-314d-4321-b3f3-ea6c673d1cd7,7563cab2-7380-4b36-a04a-624aa1cdb54c
16,10,71,2ba7bb1e-3a26-4638-850b-af1689dbf1f8,de08b73c-d432-4a4f-bb30-de1cecebb529
17,15,76,70aee49a-32ac-4b29-9f05-59de1c043a48,80aae915-f2ef-486d-b074-54106ac01532
18,16,82,fd861308-291c-435e-a11b-92cbba182fb4,c974d7dc-20af-4058-9383-01cdcd9494ad
19,17,58,6af1f98f-7555-430a-9d7f-d0f70f1b0a54,e7cb4714-32c9-476b-8af4-e994b391badc
20,18,83,73608d6a-cc61-4043-b95c-175ba478ba7c,0e00dc18-d5b9-4555-be83-cb7af77f2208
21,19,11,2316da83-4a83-497c-bdf4-55ca9e8cadb9,6d7f8b2b-42ae-4ff8-8183-26a3257a91a0
22,15,34,71a28ff5-ef5d-4279-b9b7-8afa7174f579,1e6c05e9-a48c-486c-8143-ed93c11c8b09
23,20,14,3f9c4c5a-b644-40ed-8c3e-4776bdcac303,ea316ba1-76cb-4139-b609-9c5a6d09563d
24,21,29,7103af48-0693-401e-a8a9-7063ff0d0722,7bd51828-f481-41de-97ac-8712792b2e57
25,22,31,fb374a17-e2b4-4274-b777-a09cccc8dc7b,f3a36c1d-ff0a-4ee8-b55b-7d43e8e7a73d
26,23,57,eea522eb-17c1-42e2-8e33-c33710b7d329,681aa23a-70ea-4b69-babb-3d14009779b3
27,24,38,23924ca0-acae-4a6a-aa64-8d47b169f078,69542d28-1cc7-439e-abfd-de0ea90636fb
28,15,48,6307c024-1705-4508-b05f-ac96dba72fca,73511170-19d5-4686-96d7-1dedcc3cb5cf
29,25,93,9b878a0f-d9e2-47be-bfd2-2fc381dba95a,aeda3a81-6cc3-4f26-8d5d-3abc117f4866
30,26,82,458efede-2515-46b3-87a4-9fd49e2d711b,b551ee49-8095-4c62-9876-409c029fd625
31,1,46,a8420740-3acf-4f09-8564-b2c1182b2299,dc95916d-7a45-4bb5-859c-3f2d5ad8ab14
32,4,8,42929165-b971-4546-b882-8f90e59c3e0f,53ff8d36-3cbd-47a4-9fd5-738e3b547fd7
33,18,77,53cfa054-aabc-41b6-a357-af13f2dc5770,75a59dfe-7946-4f3e-baaa-bcdf8e9a3026
34,27,70,7b346de1-fe35-4204-93d2-0cb2600b4213,0d9a9d9f-f2ea-43a0-8289-51baed42f345
35,17,71,eb1d7193-5c90-4fcf-b41b-a6a3d5f925df,3ff2bcdb-6959-44ca-b3f5-d386e1b2144b
36,23,52,f47e4ef6-e326-433f-884c-a3802095a502,a2079d4b-3e83-46b1-a176-ea43e2b931d7
37,14,52,a0d5e405-23fc-4c24-8c7f-bd0b40b3b724,a23f6c7b-888e-4fac-ae5a-1cb2a2ffcbc0
38,28,62,2ea0f049-e73e-4506-805c-4f12b4a7810b,ad4c02d5-62ae-4ddd-8df2-0a4566b4defe
39,18,23,6820af07-1d42-417d-97a3-176e30884c33,b5863d0e-93b8-41eb-b237-b92ae20513c2
40,2,75,48a1b6eb-bac0-4fe8-8dc0-dbf56a49a771,394d1002-25e7-48e0-9c3d-0f0b97eddbae
41,17,17,c7f14ee0-3187-4d74-8849-714c10e168ba,b7878195-8d8a-439e-a3b7-fc766ceb62ba
42,7,13,c3681bad-d1a9-4cc4-8d26-b00e51c0c7ee,a22b928a-a5d6-4fe8-9f7a-fab531f9543f
43,29,13,dc883f1f-7e8f-40bf-a4b0-b41328c675b6,889f6174-2256-4747-9156-8d3a3b0f5406
44,30,97,68dc7343-9c24-4c9b-bd29-acae05bf399c,dd83a1b4-c569-47a6-a705-8d424dc91fa2
45,31,31,b21bcc31-0451-4f80-963f-3087de248f8a,11d27aee-b7ce-43ba-8ddb-5a10ae151f8e
46,32,15,8dbbc936-6d70-46c8-8573-c0ca8825329f,f4cc408a-6f4f-4ebe-87f4-1f6b93ec0bee
47,26,89,1be3c9a2-37b8-4e24-a360-c4c7cc7ff713,1aa40626-9d29-4a29-a815-7788529a3a74
48,16,89,d808ffd0-d467-4bcc-8449-9e748b4a04ce,a1316db2-ab92-4569-9538-bf63f43e6a0b
49,2,52,7e79d23c-8877-4200-aeee-35a5934db1df,c9943890-9047-4346-87b2-77ddbb997350
50,14,9,4ece87fd-d687-4fa1-a217-7822923a1ade,f609d6d9-d7fa-4f5b-9dec-d4f016d1fa48
51,6,92,98811bfd-37d0-4895-bbeb-e8235602abbd,3c0effcc-e964-4631-975a-921cc9cda9d5
52,33,49,cebefc0d-2fb9-4e91-94fe-2fb720e8f058,25615e8c-ea06-491e-bcdf-9865bdd7e5ac
53,26,88,ff32be02-476b-4616-9dbd-78dd6f3d928b,0d770726-de32-4072-b9d1-87da26be6d42
54,16,71,b7ae2648-bc18-4b26-87cf-8f68b75a7888,f583d462-eb6a-416a-9c1a-98f496525d88
55,34,95,11382b86-0769-4f6e-afea-c921397a444a,71f7be6f-ae6a-4232-ad7a-78c3cb77c754
56,26,42,68da2756-09f4-49fa-b3d9-f6b8798da0ac,a8ffbfd5-dc8b-4ec3-b2bf-c99649303da2
57,18,49,6656251a-ca70-401b-9dc1-5b5d892ea630,d60fa858-eea6-4807-a25d-638bd793a0a1
58,35,67,5ebd7a1c-2d62-406e-b2b4-c250625e6287,8397177a-86f1-4da9-802c-e3866867ac94
59,36,80,8d73d024-6813-44e6-93f2-9ee8cb20718f,fbd86280-4d9c-4c94-a886-8c7046f715b7
60,20,86,0095d8da-3246-4f33-b76d-990b5ac46dc9,c4c7595f-4d8f-4aaf-b7eb-b1437008ff31
61,2,50,02e5081e-abf3-4e23-a9ef-47b0949f31b9,c84a77f1-94e7-45e4-b187-640aaa465ca0
62,37,46,44080c04-3ad0-43bb-a40d-d37e35e032f2,eed45163-9a39-4b1c-8b88-45ec4eb9b6ce
63,21,92,a6174fda-397f-4e9a-9fed-75166bca2c16,0d8f57e2-cd6a-4e9d-8f16-45723b54be73
64,38,78,52075ab4-f664-416f-b583-a366b168bc5e,0f4d47b0-f097-4966-9f29-78415e2e9e7c
65,39,60,43e66a58-b6ef-40da-ac74-6516dd0d6830,922e8e10-7ca8-4c94-b1e5-0249db05a8c1
66,12,99,e2055730-995c-4180-894f-116aec59bbab,4ab87e71-14af-4e71-9929-36a226282246
67,23,98,8826333b-cf1f-44ee-98db-cc159e5afa5f,d672e1cf-afe7-43ab-8c37-5494c5865529
68,40,93,80c0f4e4-3001-4983-91a9-44b1742e6f6b,ceb2015f-39cc-405b-b5d5-85689389a990
69,6,61,4684e7d3-c044-4a98-80e9-5f43e9ff23d3,9db9f884-b940-428b-b57d-f019859cfbce
70,22,21,dc85afa8-4888-4e1f-8cdd-470879901108,1ceb1c5d-ec87-43b9-9a8c-2731f3fbd1e2
71,10,9,d7739dfe-596f-4527-a0ae-83a5b2f32b0d,2d1ab995-977f-4f05-a5e0-80f9d2e8fff7
72,2,99,f933a1d6-0b38-427a-9fd0-297d8eb94918,6d5ea524-75df-4404-b07b-0df1a9cd0121
73,38,45,c2503d64-0050-4d35-822c-6a540272fe1a,0f8c5154-7f7b-46ab-ad4d-d5c993e2c84e
74,6,21,89a6aaff-4a87-400f-915f-9e6f2d263a32,9a614d0d-12bc-4de7-84da-5def82a15c74
75,34,41,5edca4f4-c65a-4936-8c63-0694ba8245cb,fedd55d5-e1cc-42d4-9a14-c36ba242f32d
76,30,38,125958b0-d8fd-4dcb-826b-a5f8f39a9956,dd93f3be-7e31-4600-bfab-eab48fac2e30
77,6,88,2581514a-9e27-4d03-9943-478f2e059151,0c64ec45-1b2c-46a6-a3b8-8b1f9987b8c1
78,16,88,22b17302-3ea2-4bf4-b5a9-50b4efd0bbc7,990c258c-276b-4e97-8ea8-a6eeb127377b
79,26,41,c47b1521-0d18-410e-908b-780e91a78118,cf4386a1-9272-4141-884a-089164d72923
80,16,17,f473d983-eb17-4b62-85fd-76b31540e41d,8ee29392-1b02-4940-801e-3d27c5c0e885
81,5,21,af1a5839-9736-4c7d-b48c-8c3c560bbf02,cdcac61f-a48e-4de5-bdd6-f6e733716395
82,41,75,39053f90-0c8f-4e5e-b8b2-4b51c82d7014,5ee93361-df63-45cf-84ea-8102ce020bd5
83,39,8,d45c1fc9-2b06-4a2b-9625-7a8bda5b2be7,f9bc33c3-399c-497c-9587-59194f9c2bcf
84,36,42,b7392abc-151f-43fe-97d8-aee98f46f246,cf05fc39-3809-47b1-bf2b-3fb743493575
85,27,90,ff60676a-e25d-4628-84e9-203c98225944,1a8d7f91-898e-4c9b-9ea3-96b57d6c1c3c
86,41,80,bad8935d-55aa-49aa-81d9-d42c3410b108,1b9491ef-60f8-480e-b063-060029f6532c
87,40,61,0338aff7-ed92-4128-9957-24e109b1aa5b,bc0dc730-aab8-4fb1-94ef-24350c6cd850
88,38,87,7d12aa83-b1c4-4c6c-a3e6-b7cd6f26498c,3ebbac00-534f-4c13-bef0-4b495a264851
89,20,87,72ea2fbd-b7e1-4c61-8292-a8924d6ee8f0,f87b387f-3709-4406-9839-5045631bd4e4
90,8,14,a3e21e04-b65b-47da-845a-4cdaf559f5f2,4c4721d5-eabb-44c6-83a2-5b8ea7039e69
91,16,55,e2ee7c06-c34e-42e7-8e35-055953addca3,9f129880-ede4-4c4d-adbe-c0d04e75cf1c
92,6,41,aa0823cf-e8a7-4500-934a-b18b42036d2e,b971a15c-87ef-4e79-814d-228534ad2c1a
93,12,44,a7523398-8ffe-49bb-bec2-ba85709bd3d9,97fab43b-c89a-459c-a700-e5bb645fb557
94,2,70,e9bee4c1-c56a-4e8e-8e91-79d8f6a98b5b,82982f6a-bf45-443f-84f2-47f9f78fdce9
95,16,43,d7d52dc6-d13e-4a07-aa6a-934642b20473,b4c2d12a-b9fa-4143-b411-69032cdd5927
96,8,16,d247fff7-d785-4593-aad9-ddb3f6d0a809,640beb45-2e69-4ff4-b01c-37cd9c0c2427
97,42,25,e92bc306-314e-4853-8728-0107aa27b936,f94fbe6a-3f7a-4141-8405-9748f55ac880
98,13,26,333bc679-0295-49cd-ad2e-cbb89a65bd99,b6acb8d3-1efd-4496-b0e7-5f2d4be9ff45
99,24,40,b7f83fe7-6ae2-4e75-81e1-8440d26778c2,d72c004c-6999-4ffb-b291-1bd581c65d95
100,8,42,d26316d2-19e2-45c0-9ada-b92ba56a4da2,3343a3b9-be11-4276-bca9-d7f4dd0b40aa
101,5,84,b65da068-cfdf-4247-84db-91232e610217,d74dc441-1948-4ba8-aeef-843bd074e246
102,34,14,fc629195-daf2-465a-91bd-330719735bb1,60df7002-bc50-4357-8014-02e42f5a5ab6
103,35,25,ee0f4141-13ad-4289-a414-f1756a5748ef,3264f6eb-ce55-44da-845b-32cbf99da950
104,43,39,c6d4e9d1-45a7-4948-9ec6-be687c4b8bba,fdc68f90-b2e4-483b-985d-b237467e8d9a
105,6,16,bad3d1a2-b14d-4efa-8f81-5270ee921ae6,d7a8eb36-e00d-484f-b21e-a2ab742f8a2a
106,13,95,d2ee1b75-2218-4753-9487-dcca23d667c6,0a994581-341f-43bf-979d-ece1e58de7ec
107,9,54,6a6d3fce-c5aa-4154-a6a3-b56cb41f709f,403bf915-a897-4918-933b-3996e144e960
108,10,20,b19cec0d-357e-4c6b-9257-8be52b1c71b5,d3b17672-60fb-443f-a047-2c379132dcb1
109,21,7,d2a2460e-00d1-41f2-84cc-eba01eb88d75,b9f78d5b-79ae-441e-9dbf-592767af34a5
110,19,35,75891066-59b4-437b-951f-ec553fb26b94,28fff0d2-38ea-40a7-b2ef-c2a2f7e69370
111,18,3,bb75bf7d-c008-4267-bf92-6089cff5fe56,5e9405de-a078-4b00-99c6-96564568b63c
112,34,2,bb75bf7d-c008-4267-bf92-6089cff5fe56,5e9405de-a078-4b00-99c6-96564568b63c
113,41,1,372fd2b1-b2a7-4553-b6d7-426a1bc88e56,e34973c8-9ca9-4a06-b497-7a8b49625fc2
114,13,3,469d957f-28ef-4eac-956a-d2a42b06d3ab,fcadc756-61e9-41bb-871b-d3546c5aa981
115,20,2,469d957f-28ef-4eac-956a-d2a42b06d3ab,fcadc756-61e9-41bb-871b-d3546c5aa981
116,23,1,cd140190-a53b-4660-a5b4-cc844a6506f0,89ba200c-ca90-443a-b64f-397bce091eae
117,1,4,cd140190-a53b-4660-a5b4-cc844a6506f0,89ba200c-ca90-443a-b64f-397bce091eae
118,34,4,cd140190-a53b-4660-a5b4-cc844a6506f0,89ba200c-ca90-443a-b64f-397bce091eae
119,1,3,c6addf8b-eea6-43b8-9040-b5620b1a0d99,7aebe820-8478-4a29-a606-7c59af677e24
120,44,3,c6addf8b-eea6-43b8-9040-b5620b1a0d99,7aebe820-8478-4a29-a606-7c59af677e24
121,15,3,5d64f731-cb01-4992-a27c-a6e1342f4913,d57d76d8-7dca-4ee4-84c0-1745fb4c8779
122,14,1,5d64f731-cb01-4992-a27c-a6e1342f4913,d57d76d8-7dca-4ee4-84c0-1745fb4c8779
123,17,2,5d64f731-cb01-4992-a27c-a6e1342f4913,d57d76d8-7dca-4ee4-84c0-1745fb4c8779
124,45,3,abc09fec-2fa0-48f6-b7c4-913620785520,52479603-9957-4e4b-91eb-337c358d1755
125,19,1,abc09fec-2fa0-48f6-b7c4-913620785520,52479603-9957-4e4b-91eb-337c358d1755
126,5,4,abc09fec-2fa0-48f6-b7c4-913620785520,52479603-9957-4e4b-91eb-337c358d1755
127,28,2,bb53f18b-e3c5-48c1-900e-e8ed623ca467,1add84b7-14f5-4857-903b-578408246946
128,12,2,bb53f18b-e3c5-48c1-900e-e8ed623ca467,1add84b7-14f5-4857-903b-578408246946
129,43,4,bb53f18b-e3c5-48c1-900e-e8ed623ca467,1add84b7-14f5-4857-903b-578408246946
130,6,1,ee67c3b0-aa89-4b3b-8bbc-9d70695c132b,fa0ce0bb-b0d8-469d-8d42-e1153fc48272
131,18,2,ee67c3b0-aa89-4b3b-8bbc-9d70695c132b,fa0ce0bb-b0d8-469d-8d42-e1153fc48272
132,20,4,ee67c3b0-aa89-4b3b-8bbc-9d70695c132b,fa0ce0bb-b0d8-469d-8d42-e1153fc48272
133,35,2,f04f3daf-8ede-4787-a3ad-6ff06274229d,130208de-fef4-46cd-8b9b-1ea5b939895b
134,41,2,48c4ca28-4db8-420e-af57-241818a81194,dc042557-cbee-4743-9b72-2c0a34a99cc2
135,24,1,48c4ca28-4db8-420e-af57-241818a81194,dc042557-cbee-4743-9b72-2c0a34a99cc2
136,15,2,48c4ca28-4db8-420e-af57-241818a81194,dc042557-cbee-4743-9b72-2c0a34a99cc2
137,7,1,57001f3e-d6be-4031-9295-a6b208c0ad46,49714439-c858-4e61-b7c6-f4d4c848c46b
138,43,4,c42221be-4851-42df-9184-1b4f96962bb7,134fb73e-fc99-41e4-92c4-6ecbada5574f
139,22,3,c42221be-4851-42df-9184-1b4f96962bb7,134fb73e-fc99-41e4-92c4-6ecbada5574f
140,7,1,c42221be-4851-42df-9184-1b4f96962bb7,134fb73e-fc99-41e4-92c4-6ecbada5574f
141,25,3,20efa3c2-c498-4908-8af4-f81c76781912,0167b0c3-60fd-4fbd-b378-fba0ceac39ff
142,28,3,20efa3c2-c498-4908-8af4-f81c76781912,0167b0c3-60fd-4fbd-b378-fba0ceac39ff
143,9,2,f156fb67-e7e7-448c-b9c3-0b5f0425d134,2ba952cd-d5bf-4bb4-96fe-02fd4e166d12
144,19,3,f156fb67-e7e7-448c-b9c3-0b5f0425d134,2ba952cd-d5bf-4bb4-96fe-02fd4e166d12
145,22,2,c44107fb-70a4-4ff2-bedb-48b9ecfd3d6d,479bfe4c-7137-44dd-bb42-a4ab7900aa24
146,18,1,026ffd7c-cff2-4daa-ae76-6768d3283861,d33a7b5d-15e5-4ba6-93ef-136bbcbf4946
147,33,4,026ffd7c-cff2-4daa-ae76-6768d3283861,d33a7b5d-15e5-4ba6-93ef-136bbcbf4946
148,18,5,950db98c-fb0f-4b78-bbee-bf9ae97faeca,5b9e2a68-7967-46e0-8e35-bc993a1f07e6
149,41,3,950db98c-fb0f-4b78-bbee-bf9ae97faeca,5b9e2a68-7967-46e0-8e35-bc993a1f07e6
150,24,4,b377e5d5-563f-475d-8c6d-b9f85ad861fd,fa60bc82-665e-4fe0-8f1f-b8a7675c2e2a
151,10,1,b377e5d5-563f-475d-8c6d-b9f85ad861fd,fa60bc82-665e-4fe0-8f1f-b8a7675c2e2a
152,34,4,b377e5d5-563f-475d-8c6d-b9f85ad861fd,fa60bc82-665e-4fe0-8f1f-b8a7675c2e2a
153,39,1,5158fc84-71e0-47a1-84e9-b3e446a391ae,76f02f30-28cd-4f15-88be-9c64860d1fce
154,40,3,5158fc84-71e0-47a1-84e9-b3e446a391ae,76f02f30-28cd-4f15-88be-9c64860d1fce
137 changes: 137 additions & 0 deletions insert_data_from_csv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
import sqlite3
import csv

# Connect to SQLite database
conn = sqlite3.connect("./shipment_database.db")
cursor = conn.cursor()

# Process shipping_data_0.csv
with open("./data/shipping_data_0.csv", 'r') as file:
reader = csv.reader(file)
next(reader) # Skip the header row
for row in reader:
origin_warehouse = row[0]
destination_store = row[1]
product_name = row[2]
product_quantity = int(row[4])

# Insert product if not exists
cursor.execute("INSERT OR IGNORE INTO product (name) VALUES (?)", (product_name,))
conn.commit()
cursor.execute("SELECT id FROM product WHERE name = ?", (product_name,))
product_id_row = cursor.fetchone()
if product_id_row:
product_id = product_id_row[0]

# Insert shipment
cursor.execute("INSERT INTO shipment (product_id, quantity, origin, destination) VALUES (?, ?, ?, ?)",
(product_id, product_quantity, origin_warehouse, destination_store))
conn.commit()

shipment_dictionary = {}

# Process shipping_data_1.csv
with open("./data/shipping_data_1.csv", 'r') as file:
reader = csv.reader(file)
next(reader) # Skip the header row
for row in reader:
shipment_identifier = row[0]
product_name = row[1]

# Insert product if not exists
cursor.execute("INSERT OR IGNORE INTO product (name) VALUES (?)", (product_name,))
conn.commit()
cursor.execute("SELECT id FROM product WHERE name = ?", (product_name,))
product_id_row = cursor.fetchone()
if product_id_row:
product_id = product_id_row[0]

if shipment_identifier in shipment_dictionary:
if product_id in shipment_dictionary[shipment_identifier]:
shipment_dictionary[shipment_identifier][product_id] += 1
else:
shipment_dictionary[shipment_identifier][product_id] = 1
else:
shipment_dictionary[shipment_identifier] = {product_id: 1}

# Process shipping_data_2.csv
with open("./data/shipping_data_2.csv", 'r') as file:
reader = csv.reader(file)
next(reader) # Skip the header row
for row in reader:
shipment_identifier = row[0]
origin_warehouse = row[1]
destination_store = row[2]

# Insert to database
if shipment_identifier in shipment_dictionary:
# insert one product for each shipment
for product_id in shipment_dictionary[shipment_identifier]:
cursor.execute("INSERT INTO shipment (product_id, quantity, origin, destination) VALUES (?, ?, ?, ?)",
(product_id, shipment_dictionary[shipment_identifier][product_id], origin_warehouse, destination_store))
conn.commit()

# Close the connection
conn.close()


# connect sqllite database "./shipment_database.db"

# shipping_data_0 = read "./data/shipping_data_0.csv"
# skip row 0, start from row 1
# for each row in shipping_data_0
# # retrieve excel data
# origin_warehouse = column 0
# destination_store = column 1
# product_name = column 2
# product_quantity = column 4

# # insert product if not exist
# insert(name) value (product_name) if not exist into product
# product_id = select id from product where name = product_name

# # insert shipment
# insert(product_id, quantity, origin, destination)
# value (product_id, product_quantity, origin_warehouse, destination_store)
# into shipment

# shipment_dictionary = {}

# shipping_data_1 = read "./data/shipping_data_1.csv"
# skip row 0, start from row 1
# for each row in shipping_data_1
# # retrieve excel data
# shipment_identifier = column 0
# product_name = column 1

# # insert product if not exist
# insert(name) value (product_name) if not exist into product
# product_id = select id from product where name = product_name


# if shipment_identifier in shipment_dictionary:
# # add product to shipment
# if product_id in shipment_dictionary[shipment_identifier]:
# shipment_dictionary[shipment_identifier][product_id] += 1
# else:
# shipment_dictionary[shipment_identifier][product_id] = 1
# else:
# # create shipment
# shipment_dictionary[shipment_identifier][product_id] = 1


# shipping_data_2 = read "./data/shipping_data_2.csv"
# skip row 0, start from row 1
# for each row in shipping_data_2
# # retrieve excel data
# shipment_identifier = column 0
# origin_warehouse = column 1
# destination_store = column 2

# # insert to database
# if shipment_identifier in shipment_dictionary:
# # insert one product for each shipment
# for product_id in shipment_dictionary[shipment_identifier]:
# insert(product_id, quantity, origin, destination)
# value (product_id, shipment_dictionary[shipment_identifier][product_id], origin_warehouse, destination_store)
# into shipment
Binary file modified shipment_database.db
Binary file not shown.