Dataset Viewer
Auto-converted to Parquet Duplicate
data_source
stringclasses
1 value
prompt
listlengths
2
2
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
bird_critic/sqlite_train
[ { "content": "You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n\nWhen given a problematic SQL query, you should:\n1. Analyze the query to identify what's wrong\n2. Provide detailed, high-level reasoning about the problem and solution\n3. Generate a corrected SQL query\n\nSt...
sql_debugging
{ "ground_truth": "DROP TRIGGER IF EXISTS tr_change_author_lname;\nCREATE TRIGGER tr_change_author_lname AFTER UPDATE OF au_lname ON authors FOR EACH ROW WHEN NEW.au_lname <> OLD.au_lname BEGIN INSERT INTO author_audits(author_id, old_author_lname, changed_on) VALUES(OLD.au_id, OLD.au_lname, CURRENT_TIMESTAMP); END;" }
{ "clean_up_sql": [ "DROP TABLE IF EXISTS author_audits" ], "db_id": "book_publishing_company", "index": 0, "instance_id": "PostgreSQL_40_1", "issue_sql": "DROP TRIGGER IF EXISTS tr_change_author_lname;\nCREATE TRIGGER tr_change_author_lname AFTER UPDATE OF au_lname ON authors FOR EACH ROW BEGIN INSERT INTO author_audits(author_id, old_author_lname, changed_on) VALUES(NEW.au_id, NEW.au_lname, CURRENT_TIMESTAMP); END;", "preprocess_sql": [ "CREATE TABLE IF NOT EXISTS authors (au_id TEXT PRIMARY KEY, au_fname TEXT, au_lname TEXT, au_phone TEXT, au_address TEXT, city TEXT, state TEXT, zip TEXT, contract INTEGER);", "CREATE TABLE IF NOT EXISTS author_audits (audit_id INTEGER PRIMARY KEY AUTOINCREMENT, author_id TEXT, old_author_lname TEXT, changed_on TIMESTAMP, change_type TEXT DEFAULT 'UPDATE', changed_by TEXT, change_reason TEXT DEFAULT 'Regular maintenance', system_version TEXT DEFAULT '1.0.0', client_ip TEXT DEFAULT '0.0.0.0', is_approved INTEGER DEFAULT 0, approval_date TEXT, metadata TEXT, revision_number INTEGER DEFAULT 1, is_significant_change INTEGER DEFAULT 0, audit_hash TEXT, previous_audit_id INTEGER, notes TEXT, priority INTEGER DEFAULT 3);", "INSERT OR REPLACE INTO authors (au_id, au_fname, au_lname, au_phone, au_address, city, state, zip, contract) VALUES ('172-32-1176', 'John', 'Smith', '415 555-4723', '10 Mississippi Dr', 'Lawrence', 'KS', '66044', 1);", "DELETE FROM author_audits;" ], "query": "I am new to triggers in SQLite. I am trying to create a trigger to log changes in the author's last name in the authors table. I followed a tutorial but encountered an error. The code block and the error are provided below. The authors table contains detailed information about authors. The author_audits table is intended to keep track of any changes to the author's last name along with the timestamp of the change.", "schema": "CREATE TABLE \"movie\" (\nid integer(64) NOT NULL,\ncreated_date text(6) NOT NULL,\nmodified_date text(6) NOT NULL,\navailable_globally INTEGER NULL,\nlocale text(10) NULL,\noriginal_title text(255) NULL,\nrelease_date TEXT NULL,\nruntime integer(64) NULL,\ntitle text(255) NOT NULL,\n PRIMARY KEY (id)\n);\nFirst 3 rows:\n id created_date modified_date available_globally locale original_title release_date runtime title\n 1 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 2024-03-08 110 Damsel\n 2 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 2024-01-12 107 Lift\n 3 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 La sociedad de la nieve 2024-01-04 146 Society of the Snow\n...\n\nCREATE TABLE \"season\" (\nid integer(64) NOT NULL,\ncreated_date text(6) NOT NULL,\nmodified_date text(6) NOT NULL,\noriginal_title text(255) NULL,\nrelease_date TEXT NULL,\nruntime integer(64) NULL,\nseason_number integer(32) NULL,\ntitle text(255) NOT NULL,\ntv_show_id integer(64) NULL,\n PRIMARY KEY (id),\n FOREIGN KEY (tv_show_id) REFERENCES tv_show(id)\n);\nFirst 3 rows:\n id created_date modified_date original_title release_date runtime season_number title tv_show_id\n 1 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 2024-01-01 385 nan Fool Me Once: Limited Series 1\n 2 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 2024-05-16 479 3 Bridgerton: Season 3 2\n 3 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 2024-04-11 238 nan Baby Reindeer: Limited Series 3\n...\n\nCREATE TABLE \"tv_show\" (\nid integer(64) NOT NULL,\ncreated_date text(6) NOT NULL,\nmodified_date text(6) NOT NULL,\navailable_globally INTEGER NULL,\nlocale text(10) NULL,\noriginal_title text(255) NULL,\nrelease_date TEXT NULL,\ntitle text(255) NOT NULL,\n PRIMARY KEY (id)\n);\nFirst 3 rows:\n id created_date modified_date available_globally locale original_title release_date title\n 1 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 en Fool Me Once\n 2 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 en Bridgerton\n 3 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 en Baby Reindeer\n...\n\nCREATE TABLE \"view_summary\" (\nid integer(64) NOT NULL,\ncreated_date text(6) NOT NULL,\nmodified_date text(6) NOT NULL,\ncumulative_weeks_in_top10 integer(32) NULL,\nduration text(20) NOT NULL,\nend_date TEXT NOT NULL,\nhours_viewed integer(32) NOT NULL,\nstart_date TEXT NOT NULL,\nview_rank integer(32) NULL,\nviews integer(32) NULL,\nmovie_id integer(64) NULL,\nseason_id integer(64) NULL,\n PRIMARY KEY (id),\n FOREIGN KEY (season_id) REFERENCES season(id),\n FOREIGN KEY (movie_id) REFERENCES movie(id)\n);\nFirst 3 rows:\n id created_date modified_date cumulative_weeks_in_top10 duration end_date hours_viewed start_date view_rank views movie_id season_id\n 1 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 SEMI_ANNUALLY 2024-06-30 263700000 2024-01-01 143800000 1\n 2 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 SEMI_ANNUALLY 2024-06-30 230800000 2024-01-01 129400000 2\n 3 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 SEMI_ANNUALLY 2024-06-30 252500000 2024-01-01 103800000 3\n...\n\nCREATE TABLE \"tv_show_audits\" (\ntv_show_id INTEGER NULL,\nold_tv_show_title TEXT NULL,\nchanged_on TEXT NULL,\naudit_id INTEGER NULL,\nchange_type TEXT NULL DEFAULT 'UPDATE',\nchanged_by TEXT NULL,\nchange_reason TEXT NULL DEFAULT 'Regular maintenance',\nsystem_version TEXT NULL DEFAULT '1.0.0',\nclient_ip TEXT NULL DEFAULT '0.0.0.0',\nis_approved INTEGER NULL DEFAULT 0,\napproval_date TEXT NULL,\nmetadata TEXT NULL,\nrevision_number INTEGER NULL DEFAULT 1,\nis_significant_change INTEGER NULL DEFAULT 0,\naudit_hash TEXT NULL,\nprevious_audit_id INTEGER NULL,\nnotes TEXT NULL,\npriority INTEGER NULL DEFAULT 3,\n PRIMARY KEY (audit_id)\n);\n\n", "selected_database": "book_publishing_company", "split": "train", "test_cases": [ "def test_case(pred_sqls, sol_sqls, db_path, conn, conditions):\n res, exec_err, timeout_err = execute_queries([\"SELECT au_lname FROM authors WHERE au_id = '172-32-1176';\"], db_path, conn, logger=None)\n assert not exec_err and not timeout_err, \"Failed to retrieve author last name\"\n old_a_lname = res[0][0]\n \n execute_queries([\"UPDATE authors SET au_lname = 'White' WHERE au_id = '172-32-1176';\"], db_path, conn, logger=None)\n \n execute_queries([\"DELETE FROM author_audits;\"], db_path, conn, logger=None)\n \n check_sql = [\"UPDATE authors SET au_lname = '\" + old_a_lname + \"' WHERE au_id = '172-32-1176';\"]\n execute_queries(check_sql, db_path, conn, logger=None)\n res, exec_err, timeout_err = execute_queries([\"SELECT * FROM author_audits\"], db_path, conn, logger=None)\n assert not exec_err and not timeout_err, \"Failed to query author_audits\"\n assert len(res) == 0, f\"The trigger conditioning does not work. Audit table should be empty.\"\n \n check_sql = [\"UPDATE authors SET au_lname = 'Whitesmith' WHERE au_id = '172-32-1176';\"]\n execute_queries(check_sql, db_path, conn, logger=None)\n res, exec_err, timeout_err = execute_queries([\"SELECT old_author_lname FROM author_audits LIMIT 1\"], db_path, conn, logger=None)\n assert not exec_err and not timeout_err, \"Failed to query author_audits\"\n assert len(res) == 1, f\"The trigger did not insert into audit table.\"\n old_name_audited = res[0][0]\n assert old_name_audited == 'White', f\"The trigger does not work correctly. Expected old name 'White' but got '{old_name_audited}'.\"\n \n execute_queries([\"UPDATE authors SET au_lname = 'White' WHERE au_id = '172-32-1176';\"], db_path, conn, logger=None)\n \n return 1" ] }
bird_critic/sqlite_train
[ { "content": "You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n\nWhen given a problematic SQL query, you should:\n1. Analyze the query to identify what's wrong\n2. Provide detailed, high-level reasoning about the problem and solution\n3. Generate a corrected SQL query\n\nSt...
sql_debugging
{ "ground_truth": "SELECT edition_code FROM book_editions ORDER BY CAST(SUBSTR(edition_code, 1, INSTR(edition_code, '.') - 1) AS INTEGER) DESC, CAST(SUBSTR(edition_code, INSTR(edition_code, '.') + 1, INSTR(SUBSTR(edition_code, INSTR(edition_code, '.') + 1), '.') - 1) AS INTEGER) DESC, CAST(SUBSTR(edition_code, INSTR(edition_code, '.') + INSTR(SUBSTR(edition_code, INSTR(edition_code, '.') + 1), '.') + 1, INSTR(SUBSTR(edition_code, INSTR(edition_code, '.') + INSTR(SUBSTR(edition_code, INSTR(edition_code, '.') + 1), '.') + 1), '-') - 1) AS INTEGER) DESC, CAST(SUBSTR(edition_code, INSTR(edition_code, '-') + 1, CASE WHEN INSTR(SUBSTR(edition_code, INSTR(edition_code, '-') + 1), '-') > 0 THEN INSTR(SUBSTR(edition_code, INSTR(edition_code, '-') + 1), '-') - 1 ELSE LENGTH(SUBSTR(edition_code, INSTR(edition_code, '-') + 1)) END) AS INTEGER) DESC, CASE WHEN INSTR(SUBSTR(edition_code, INSTR(edition_code, '-') + 1), '-') > 0 THEN SUBSTR(edition_code, INSTR(edition_code, '-') + 1 + INSTR(SUBSTR(edition_code, INSTR(edition_code, '-') + 1), '-')) ELSE '' END ASC;" }
{ "clean_up_sql": [ "DROP TABLE book_editions" ], "db_id": "book_publishing_company", "index": 1, "instance_id": "PostgreSQL_46_1", "issue_sql": "SELECT edition_code FROM book_editions ORDER BY edition_code DESC;", "preprocess_sql": [ "CREATE TABLE book_editions (edition_code TEXT);", "INSERT INTO book_editions (edition_code) VALUES ('3.0.5-1-test-dev'), ('3.0.6-1'), ('3.0.7-1-test'), ('3.0.8-1-test-dev-test23'), ('3.0.9-1'), ('3.0.13-2'), ('3.0.4-1-1'), ('3.0.10-1'), ('3.0.11-2'), ('3.0.11-1');" ], "query": "In the Book Publishing database, we have simulated a table named 'book_editions' which contains information about book editions. Each entry includes an 'edition_code' column that records the edition code, potentially for software included with the book or different print runs. The edition codes are in a format similar to '3.0.5-1-test-dev' and need to be sorted correctly to determine the latest edition. However, a simple sorting method might not handle multi-digit numbers correctly and could fail when the code includes additional string information after the numeric parts. The task is to write a query that correctly sorts these edition codes. If the table is sorted correctly, I can get the latest edition code by selecting the first one.", "schema": "CREATE TABLE \"movie\" (\nid integer(64) NOT NULL,\ncreated_date text(6) NOT NULL,\nmodified_date text(6) NOT NULL,\navailable_globally INTEGER NULL,\nlocale text(10) NULL,\noriginal_title text(255) NULL,\nrelease_date TEXT NULL,\nruntime integer(64) NULL,\ntitle text(255) NOT NULL,\n PRIMARY KEY (id)\n);\nFirst 3 rows:\n id created_date modified_date available_globally locale original_title release_date runtime title\n 1 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 2024-03-08 110 Damsel\n 2 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 2024-01-12 107 Lift\n 3 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 La sociedad de la nieve 2024-01-04 146 Society of the Snow\n...\n\nCREATE TABLE \"season\" (\nid integer(64) NOT NULL,\ncreated_date text(6) NOT NULL,\nmodified_date text(6) NOT NULL,\noriginal_title text(255) NULL,\nrelease_date TEXT NULL,\nruntime integer(64) NULL,\nseason_number integer(32) NULL,\ntitle text(255) NOT NULL,\ntv_show_id integer(64) NULL,\n PRIMARY KEY (id),\n FOREIGN KEY (tv_show_id) REFERENCES tv_show(id)\n);\nFirst 3 rows:\n id created_date modified_date original_title release_date runtime season_number title tv_show_id\n 1 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 2024-01-01 385 nan Fool Me Once: Limited Series 1\n 2 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 2024-05-16 479 3 Bridgerton: Season 3 2\n 3 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 2024-04-11 238 nan Baby Reindeer: Limited Series 3\n...\n\nCREATE TABLE \"tv_show\" (\nid integer(64) NOT NULL,\ncreated_date text(6) NOT NULL,\nmodified_date text(6) NOT NULL,\navailable_globally INTEGER NULL,\nlocale text(10) NULL,\noriginal_title text(255) NULL,\nrelease_date TEXT NULL,\ntitle text(255) NOT NULL,\n PRIMARY KEY (id)\n);\nFirst 3 rows:\n id created_date modified_date available_globally locale original_title release_date title\n 1 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 en Fool Me Once\n 2 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 en Bridgerton\n 3 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 1 en Baby Reindeer\n...\n\nCREATE TABLE \"view_summary\" (\nid integer(64) NOT NULL,\ncreated_date text(6) NOT NULL,\nmodified_date text(6) NOT NULL,\ncumulative_weeks_in_top10 integer(32) NULL,\nduration text(20) NOT NULL,\nend_date TEXT NOT NULL,\nhours_viewed integer(32) NOT NULL,\nstart_date TEXT NOT NULL,\nview_rank integer(32) NULL,\nviews integer(32) NULL,\nmovie_id integer(64) NULL,\nseason_id integer(64) NULL,\n PRIMARY KEY (id),\n FOREIGN KEY (season_id) REFERENCES season(id),\n FOREIGN KEY (movie_id) REFERENCES movie(id)\n);\nFirst 3 rows:\n id created_date modified_date cumulative_weeks_in_top10 duration end_date hours_viewed start_date view_rank views movie_id season_id\n 1 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 SEMI_ANNUALLY 2024-06-30 263700000 2024-01-01 143800000 1\n 2 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 SEMI_ANNUALLY 2024-06-30 230800000 2024-01-01 129400000 2\n 3 2024-01-01 00:00:00+08 2024-01-01 00:00:00+08 SEMI_ANNUALLY 2024-06-30 252500000 2024-01-01 103800000 3\n...\n\nCREATE TABLE \"temp_table\" (\nversion TEXT NULL\n);\nFirst 3 rows:\nversion\n3.0.5-1-test-dev\n3.0.6-1\n3.0.7-1-test\n...", "selected_database": "book_publishing_company", "split": "train", "test_cases": [ "def test_case(pred_sqls, sol_sqls, db_path, conn, conditions):\n pred_sqls_result, pred_exec_err, pred_timeout_err = execute_queries(pred_sqls, db_path, conn, logger=None)\n sol_sqls_result, sol_exec_err, sol_timeout_err = execute_queries(sol_sqls, db_path, conn, logger=None)\n \n assert not pred_exec_err and not pred_timeout_err, \"Predicted SQL execution failed\"\n assert not sol_exec_err and not sol_timeout_err, \"Solution SQL execution failed\"\n \n assert pred_sqls_result == sol_sqls_result, f\"Expected pred_result and sol_result are the same but pred_result is {pred_sqls_result} and sol_result is {sol_sqls_result}.\"\n return 1" ] }
bird_critic/sqlite_train
[{"content":"You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n(...TRUNCATED)
sql_debugging
{"ground_truth":"WITH RECURSIVE actor_order_parsed AS (SELECT film_id, actor_order, CAST(SUBSTR(acto(...TRUNCATED)
{"clean_up_sql":["DROP TABLE film_actor_order"],"db_id":"movie_3","index":2,"instance_id":"PostgreSQ(...TRUNCATED)
bird_critic/sqlite_train
[{"content":"You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n(...TRUNCATED)
sql_debugging
{"ground_truth":"DROP TRIGGER IF EXISTS trigger_insert_shipment;\nCREATE TRIGGER trigger_insert_ship(...TRUNCATED)
{"clean_up_sql":["DROP TABLE IF EXISTS book_shipment","DROP TABLE IF EXISTS book_stock"],"db_id":"bo(...TRUNCATED)
bird_critic/sqlite_train
[{"content":"You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n(...TRUNCATED)
sql_debugging
{"ground_truth":"CREATE VIEW overview AS SELECT (SELECT COUNT(*) FROM zip_data) AS zip_data_count, ((...TRUNCATED)
{"clean_up_sql":[],"db_id":"address","index":4,"instance_id":"PostgreSQL_257_0","issue_sql":"CREATE (...TRUNCATED)
bird_critic/sqlite_train
[{"content":"You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n(...TRUNCATED)
sql_debugging
{"ground_truth":"SELECT CAST(price AS REAL) FROM titles WHERE price GLOB '[0-9]*.[0-9]*' OR price GL(...TRUNCATED)
{"clean_up_sql":["DELETE FROM titles WHERE title_id = 'INVALID99'","ALTER TABLE titles ALTER COLUMN (...TRUNCATED)
bird_critic/sqlite_train
[{"content":"You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n(...TRUNCATED)
sql_debugging
{"ground_truth":"INSERT OR IGNORE INTO games (id, games_year, games_name, season) VALUES (50, 2024, (...TRUNCATED)
{"clean_up_sql":["DROP TABLE IF EXISTS failure"],"db_id":"olympics","index":6,"instance_id":"Postgre(...TRUNCATED)
bird_critic/sqlite_train
[{"content":"You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n(...TRUNCATED)
sql_debugging
{"ground_truth":"WITH RECURSIVE expanded_items(item_name, item_cost, item_index) AS (SELECT item_nam(...TRUNCATED)
{"clean_up_sql":["DROP TABLE temp_business_items"],"db_id":"public_review_platform","index":7,"insta(...TRUNCATED)
bird_critic/sqlite_train
[{"content":"You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n(...TRUNCATED)
sql_debugging
{"ground_truth":"DROP TRIGGER IF EXISTS titles_before_insert;\nCREATE TRIGGER titles_before_insert B(...TRUNCATED)
{"clean_up_sql":["DROP TRIGGER IF EXISTS titles_before_insert ON titles","DROP FUNCTION IF EXISTS fo(...TRUNCATED)
bird_critic/sqlite_train
[{"content":"You are an expert SQL debugger. Your task is to identify and fix bugs in SQL queries.\n(...TRUNCATED)
sql_debugging
{"ground_truth":"SELECT u.user_yelping_since_year AS \"year\", SUM(CASE WHEN r.review_stars > CAST(u(...TRUNCATED)
{"clean_up_sql":[],"db_id":"public_review_platform","index":9,"instance_id":"Oracle_42_7","issue_sql(...TRUNCATED)
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
8