সাপোর্ট ডেস্ক প্রতিটি কার্যকর অর্ডারের (paid/shipped) তিনটা সিগন্যাল এক নজরে চায়। প্রতি অর্ডারের order_id, has_paid (অর্ডারের কোনো পেমেন্ট paid হলে ১, নাহলে ০), shipment (শিপমেন্ট থাকলে তার status, না থাকলে none) আর return_count (এই অর্ডারের আইটেমগুলোর বিরুদ্ধে মোট return সংখ্যা) বের করো; অর্ডার আইডি অনুযায়ী সাজাও।
কোনো ইনপুট নেই — একটি SQL query লেখো।
প্রতি লাইনে order_id, has_paid, shipment, return_count — অর্ডার আইডি অনুযায়ী।
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)
1 1 delivered 1 3 1 delivered 0 4 1 shipped 1 6 1 delivered 1 7 1 shipped 1 8 1 delivered 0 9 1 delivered 0 10 1 pending 0
update payments set status='failed' where id=1;
1 0 delivered 1 3 1 delivered 0 4 1 shipped 1 6 1 delivered 1 7 1 shipped 1 8 1 delivered 0 9 1 delivered 0 10 1 pending 0