Back to General discussions forum
Dear all, i am trying to solve missing in SQL and i suspect to have the right answer yet the entry is deemed wrong every time.
I have this data:
create table package (pkg_id int, sender text, weight int, trackcode text);
create table attempt (att_id int, pkg_id int, provider text);
create table event (evt_id int, att_id int, status text);
insert into package values (127, 'ann', 582, 'tm2567124');
insert into attempt values (813, 127, 'bl');
insert into event values (4160, 813, 'created');
insert into attempt values (828, 127, 'rps');
insert into event values (4236, 828, 'created');
insert into event values (4414, 828, 'picked up');
insert into event values (4499, 828, 'left at door');
insert into package values (134, 'eve', 420, 'jn8373625');
insert into attempt values (841, 134, 'capost');
insert into package values (140, 'eve', 350, 'es8453740');
insert into attempt values (863, 140, 'dhl');
insert into event values (4581, 863, 'created');
insert into package values (146, 'frank', 730, 'b47976245');
insert into package values (151, 'bob', 420, 'on8645327');
insert into attempt values (882, 151, 'capost');
insert into event values (4691, 882, 'created');
insert into event values (4847, 882, 'at airport');
And the right answer i presume would be: es8453740
This seems to work for all entries even the test entries when is copy them in my SQL sandbox. Yet it keeps telling me that i get it wrong. What is the style if answer expected? Is it only the trackcode or did i get the idea completely wrong and another entry is expected.
Thanks for your help in advance, Best regards,
Lukas
For example, why is b47976245
not part of your output?
Ah i did the joining wrong and did not see that. Thank you so much, works like a charm now :-)