ইনভেন্টরি টিম সাপ্তাহিক রিস্টক প্ল্যান বানাচ্ছে। products থেকে যেসব প্রোডাক্ট রিস্টক-তালিকায় পড়বে সেগুলো বের করো — শর্ত: stock ১২ বা তার কম, অথবা rating অন্তত ৪.৫। প্রতি প্রোডাক্টের name, stock, rating সাথে একটি priority কলাম দেখাও — স্টক ৫ বা তার কম হলে high, নাহলে normal। আগে সব high, তারপর normal — দুই গ্রুপের ভেতরেই স্টক ঊর্ধ্বক্রমে, একই স্টকে নাম অনুযায়ী।
কোনো ইনপুট নেই — একটি SQL query লেখো।
প্রতি লাইনে name, stock, rating, priority — আগে high গ্রুপ (স্টক ঊর্ধ্বক্রম, টাই-এ name), তারপর normal গ্রুপ একই নিয়মে।
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)
Webcam 2 4.0 high Wireless Mouse 3 4.0 high 27in Monitor 5 4.6 high Clay Dinner Set 6 4.8 normal Denim Jacket 7 4.5 normal USB-C Hub 8 4.2 normal SQL Handbook 9 4.5 normal Laptop Stand 11 4.3 normal Dune 12 4.9 normal Mechanical Keyboard 12 4.7 normal Clean Code 30 4.9 normal
update products set stock=4 where id=4;
Webcam 2 4.0 high Wireless Mouse 3 4.0 high Clean Code 4 4.9 high 27in Monitor 5 4.6 high Clay Dinner Set 6 4.8 normal Denim Jacket 7 4.5 normal USB-C Hub 8 4.2 normal SQL Handbook 9 4.5 normal Laptop Stand 11 4.3 normal Dune 12 4.9 normal Mechanical Keyboard 12 4.7 normal