ওয়েব টিম ক্যাটাগরি মেনুর breadcrumb বানাচ্ছে — প্রতিটি ক্যাটাগরির নামের পাশে তার প্যারেন্ট ক্যাটাগরির নাম, আর যার প্যারেন্ট নেই (শীর্ষ স্তর) তার জায়গায় (root) দেখাবে। categories টেবিলকে নিজের সাথেই জোড়া দাও — শীর্ষ ক্যাটাগরির কোনো ম্যাচ না-থাকায় LEFT JOIN লাগবে; ক্যাটাগরির নাম অনুযায়ী সাজাও।
কোনো ইনপুট নেই — একটি SQL query লেখো।
প্রতি লাইনে category, parent — ক্যাটাগরির নাম অনুযায়ী সাজানো; প্যারেন্ট না থাকলে (root)।
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)
Audio Electronics Books (root) Electronics (root) Fashion (root) Fiction Books Headphones Audio Home (root) Men Fashion
update categories set parent_id=8 where id=3;
Audio Electronics Books (root) Electronics (root) Fashion (root) Fiction Books Headphones Home Home (root) Men Fashion