মার্কেটপ্লেস অপস টিম মাস শেষে র্যাংক করে কোন ভেন্ডরের প্রোডাক্ট সবচেয়ে বেশি ফেরত আসছে — বেশি রিটার্ন মানে হয় মান খারাপ, নয় বর্ণনায় ভুল। শুধু কার্যকর অর্ডার (paid বা shipped) ধরে প্রতি ভেন্ডরের জন্য বের করো: approved রিটার্নের সংখ্যা (returns), বিক্রি হওয়া অর্ডার-আইটেমের সংখ্যা (items) আর রিটার্নের হার শতাংশে (return_rate_pct, এক দশমিক ঘর)। আগে বেশি হার, সমান হলে ভেন্ডরের নাম অনুযায়ী। (যে ভেন্ডরের কার্যকর অর্ডারে অন্তত একটি আইটেম আছে, শুধু সে-ই তালিকায় আসবে।)
কোনো ইনপুট নেই — একটি SQL query লেখো।
প্রতি লাইনে vendor, returns, items, return_rate_pct — হার কমানো ক্রমে, সমান হারে vendor (নাম) অনুযায়ী।
Write your solution, test it against custom input, then submit for a real verdict.
Your submissions, verdicts, drafts and contest score are tied to your account. Registration is free.
ShopSphere fixture. Standard SQL (SQLite-compatible engine).
SQL samples run against the ShopSphere fixture. When a sample shows dataset setup, the judge applies it before running your query; the expected rows are TSV.
Base ShopSphere fixture (no changes)
HomeCraft 1 2 50.0 TechNest 1 4 25.0 BookBazar 0 2 0.0 GadgetPoint 0 1 0.0 StyleHub 0 4 0.0
update returns set status='approved' where id=4;
GadgetPoint 1 1 100.0 HomeCraft 1 2 50.0 TechNest 1 4 25.0 BookBazar 0 2 0.0 StyleHub 0 4 0.0