মার্কেটিং ড্যাশবোর্ডে 'টপ প্রোডাক্ট' তালিকা প্রতি পেজে ঠিক ৫টি করে দেখায় — প্রথম পেজে শীর্ষ ৫, দ্বিতীয় পেজে তার পরের ৫। কার্যকর (paid বা shipped) অর্ডারের আইটেম থেকে প্রতি প্রোডাক্টের মোট আয় হিসাব করো (quantity × unit_price_cents), আয়ের কমানো ক্রমে পূর্ণ তালিকা সাজাও — তারপর দ্বিতীয় পেজের ৫টি প্রোডাক্ট দেখাও: product, revenue_cents। সমান আয়ের প্রোডাক্ট নাম অনুযায়ী সাজাবে — নইলে ৫ম-৬ষ্ঠ স্থানের সীমানায় কে থাকবে তা অনির্দিষ্ট হয়ে যায়।
কোনো ইনপুট নেই — একটি SQL query লেখো।
প্রতি লাইনে product, revenue_cents — আয়ের কমানো ক্রমে, সমান আয়ে product (নাম) অনুযায়ী।
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)
Clay Dinner Set 320000 SQL Handbook 285000 Leather Wallet 240000 Table Lamp 220000 Clean Code 180000
update orders set status='paid' where id=2;
Clean Code 360000 Clay Dinner Set 320000 SQL Handbook 285000 Leather Wallet 240000 Table Lamp 220000