-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsql-practice-3.com.json
1 lines (1 loc) · 14.8 KB
/
sql-practice-3.com.json
1
{"showTimer":false,"isDarkMode":true,"disableAds":true,"questionsSolved":[{"id":1,"skipped":false,"userSolution":"select first_name, last_name\nfrom patients\nwhere allergies is NUll;","hints":1,"solvedTime":65005,"completedWithoutSkipping":true},{"id":2,"skipped":false,"userSolution":"select first_name\nfrom patients\nwhere first_name like \"C%\";","hints":1,"solvedTime":43005,"completedWithoutSkipping":true},{"id":3,"skipped":false,"userSolution":"select first_name, last_name\nfrom patients\nwhere weight between 100 and 120;","hints":1,"solvedTime":76010,"completedWithoutSkipping":true},{"id":4,"skipped":false,"userSolution":"SELECT * FROM patients;\n\nselect first_name, last_name, gender\nfrom patients \nwhere gender = \"M\";\n\nselect first_name, last_name\nfrom patients\nwhere allergies is NUll;\n\nselect first_name\nfrom patients\nwhere first_name like \"C%\";\n\nselect first_name, last_name\nfrom patients\nwhere weight between 100 and 120;\n\nupdate patients\nset allergies = \"NKA\"\nwhere allergies is null","hints":1,"solvedTime":49006,"completedWithoutSkipping":true},{"id":5,"skipped":false,"userSolution":"select concat(first_name, \" \",last_name) as full_name\nfrom patients;","hints":1,"solvedTime":52008,"completedWithoutSkipping":true},{"id":6,"skipped":false,"userSolution":"select first_name, last_name, pr.province_name\nfrom patients\njoin province_names pr on pr.province_id = patients.province_id;","hints":1,"solvedTime":72995,"completedWithoutSkipping":true},{"id":23,"skipped":false,"userSolution":"select count(*) as birth_year\nfrom patients\nwhere year(birth_date) = 2010;","hints":1,"solvedTime":83009,"completedWithoutSkipping":true},{"id":33,"skipped":false,"userSolution":"select first_name, last_name, max(height)\nfrom patients;","hints":1,"solvedTime":80008,"completedWithoutSkipping":true},{"id":34,"skipped":false,"userSolution":"select * from patients\nwhere patient_id in (1,45,534,879,1000);","hints":1,"solvedTime":89012,"completedWithoutSkipping":true},{"id":35,"skipped":false,"userSolution":"select count(*) as total_admission\nfrom admissions;","hints":1,"solvedTime":83007,"completedWithoutSkipping":true},{"id":41,"skipped":false,"userSolution":"select * from admissions\nwhere admission_date = discharge_date;","hints":1,"solvedTime":114006,"completedWithoutSkipping":true},{"id":42,"skipped":false,"userSolution":"select patient_id, count(*) number_of_admission\nfrom admissions\nwhere patient_id = 579;","hints":1,"solvedTime":278021,"completedWithoutSkipping":true},{"id":32,"skipped":false,"userSolution":"select distinct city from patients\nwhere province_id = \"NS\";","hints":1,"solvedTime":81012,"completedWithoutSkipping":true},{"id":45,"skipped":false,"userSolution":"select first_name, last_name, birth_date\nfrom patients\nwhere height > 160\nand weight > 70;","hints":1,"solvedTime":95001,"completedWithoutSkipping":true},{"id":46,"skipped":false,"userSolution":"select first_name, last_name, allergies\nfrom patients\nwhere allergies is not null and city = \"Hamilton\";","hints":1,"solvedTime":82010,"completedWithoutSkipping":true},{"id":9,"skipped":false,"userSolution":"select patient_id, first_name\nfrom patients\nwhere length(first_name) >= 6 and first_name like \"S%S\";","hints":2,"solvedTime":344002,"completedWithoutSkipping":true},{"id":10,"skipped":false,"userSolution":"select patients.patient_id, first_name, last_name\nfrom patients\njoin admissions ad On ad.patient_id = patients.patient_id\nwhere ad.diagnosis = \"Dementia\";","hints":1,"solvedTime":145008,"completedWithoutSkipping":true},{"id":11,"skipped":false,"userSolution":"select first_name from patients\norder by len(first_name), first_name;","hints":2,"solvedTime":458007,"completedWithoutSkipping":true},{"id":12,"skipped":false,"userSolution":"select \ncount(case when gender = \"M\" then 1 end) as Numer_of_Men, \ncount(case when gender = \"F\" then 1 end) as Number_of_women\nfrom patients;","hints":2,"solvedTime":271070117,"completedWithoutSkipping":true},{"id":13,"skipped":false,"userSolution":"select first_name, last_name, allergies\nfrom patients\nwhere allergies IN (\"Penicillin\", \"Morphine\")\norder by 3, 1,2;","hints":2,"solvedTime":274006,"completedWithoutSkipping":true},{"id":14,"skipped":false,"userSolution":"select patients.patient_id, ad.diagnosis\nfrom patients\njoin admissions ad on ad.patient_id = patients.patient_id\ngroup by patients.patient_id, ad.diagnosis\nhaving count(*) >1;","hints":1,"solvedTime":790004,"completedWithoutSkipping":true},{"id":0,"skipped":false,"userSolution":"select first_name, last_name, gender\nfrom patients \nwhere gender = \"M\";","hints":1,"solvedTime":168014,"completedWithoutSkipping":true},{"id":7,"skipped":false,"userSolution":"select distinct year(birth_date) as birth_year\nfrom patients\norder by birth_year;","hints":1,"solvedTime":118004,"completedWithoutSkipping":true},{"id":15,"skipped":false,"userSolution":"select city, count(*) as city_pop\nfrom patients\ngroup by city\norder by city_pop desc, city;","hints":1,"solvedTime":259901770,"completedWithoutSkipping":true},{"id":16,"skipped":true,"userSolution":"select distinct year(birth_date) as birth_year\nfrom patients\norder by birth_year;\n\nselect city, count(*) as city_pop\nfrom patients\ngroup by city\norder by city_pop desc, city;\n\n\nselect first_name, last_name, \"Patient\" as role\nfrom patients\nunion\nselect first_name, last_name, \"Doctor\" as role\nfrom doctors;"},{"id":27,"skipped":false,"userSolution":"select first_name, last_name, birth_date\nfrom patients\nwhere year(birth_date) between 1970 and 1979\norder by birth_date;","hints":1,"solvedTime":351013,"completedWithoutSkipping":true},{"id":28,"skipped":false,"userSolution":"select concat(upper(last_name),\",\" , lower(first_name)) as full_name\nfrom patients\norder by first_name desc;","hints":1,"solvedTime":214006,"completedWithoutSkipping":true},{"id":30,"skipped":false,"userSolution":"select province_id, sum(height) as total_height\nfrom patients\ngroup by province_id\nhaving total_height >= 7000;","hints":2,"solvedTime":559003,"completedWithoutSkipping":true},{"id":31,"skipped":false,"userSolution":"select max(weight) - min(weight) as diff \nfrom patients\nwhere last_name like \"Maroni\";","hints":1,"solvedTime":86004,"completedWithoutSkipping":true},{"id":37,"skipped":false,"userSolution":"select day(admission_date) as days, count(*) as freg\nfrom admissions\ngroup by days\norder by freg desc;","hints":1,"solvedTime":296010,"completedWithoutSkipping":true},{"id":38,"skipped":false,"userSolution":"select * from admissions\nwhere patient_id = 542\norder by admission_date desc\nlimit 1;","hints":1,"solvedTime":173004,"completedWithoutSkipping":true},{"id":47,"skipped":false,"userSolution":"select first_name, last_name, count(*) nos_admission\nfrom doctors\njoin admissions on admissions.attending_doctor_id = doctors.doctor_id\ngroup by doctor_id;","hints":1,"solvedTime":647001,"completedWithoutSkipping":true},{"id":48,"skipped":false,"userSolution":"select doctor_id, concat(first_name,\" \", last_name) as full_name, \n\t\tmin(a.admission_date) as first_attendance,\n max(a.admission_date) as last_attended\nfrom doctors d\njoin admissions a on a.attending_doctor_id = d.doctor_id\ngroup by doctor_id;","hints":1,"solvedTime":205002,"completedWithoutSkipping":true},{"id":50,"skipped":false,"userSolution":"select doctor_id, concat(first_name,\" \", last_name) as full_name, \n\t\tmin(a.admission_date) as first_attendance,\n max(a.admission_date) as last_attended\nfrom doctors d\njoin admissions a on a.attending_doctor_id = d.doctor_id\ngroup by doctor_id;","hints":1,"solvedTime":51016,"completedWithoutSkipping":true},{"id":8,"skipped":false,"userSolution":"select first_name\nfrom patients\ngroup by first_name\nhaving count(*) = 1;","hints":1,"solvedTime":355005,"completedWithoutSkipping":false},{"id":22,"skipped":false,"userSolution":"select allergies, count(*) as popularity \nfrom patients\nwhere allergies is not null\ngroup by allergies\norder by popularity desc;","hints":1,"solvedTime":357011,"completedWithoutSkipping":true},{"id":40,"skipped":false,"userSolution":"select patient_id,attending_doctor_id, diagnosis\nfrom admissions\nwhere (\n patient_id % 2 != 0\nand attending_doctor_id in (1,5,19)\n )\nor (\n attending_doctor_id like \"%2%\"\nand len(patient_id) = 3\n );","hints":1,"solvedTime":588079,"completedWithoutSkipping":false},{"id":51,"skipped":false,"userSolution":"select concat(p.first_name, \" \",p.last_name) as patient_name,\n\t\tad.diagnosis, concat(d.first_name, \" \", d.last_name) as Doctor_name\nfrom admissions ad\njoin patients p on p.patient_id = ad.patient_id\njoin doctors d on d.doctor_id = ad.attending_doctor_id;","hints":2,"solvedTime":4895024,"completedWithoutSkipping":true},{"id":54,"skipped":false,"userSolution":"select first_name, last_name, count(*) as duplicate\nfrom patients\ngroup by first_name, last_name\nhaving duplicate > 1;","hints":1,"solvedTime":132015,"completedWithoutSkipping":true},{"id":55,"skipped":false,"userSolution":"select concat(first_name, \" \", last_name) as full_name,\n\t\tround((height / 30.48), 1) as height_In_feet,\n round((weight *2.205), 0) as weight_in_pounds,\n birth_date,\n case \n when gender = \"M\" then \"Male\"\n when gender = \"F\" then \"Female\" end as gender\nfrom patients;","hints":2,"solvedTime":31966367,"completedWithoutSkipping":true},{"id":70,"skipped":false,"userSolution":"select patient_id, first_name, last_name\nfrom patients\nwhere patient_id not in (select patient_id from admissions);","hints":1,"solvedTime":125012,"completedWithoutSkipping":true},{"id":17,"skipped":false,"userSolution":"select floor((weight /10) *10) as weight_group, count(*) as patients_in_group\nfrom patients\ngroup by weight_group\norder by weight_group desc;","hints":2,"solvedTime":1285011,"completedWithoutSkipping":true},{"id":18,"skipped":true,"userSolution":"SELECT * FROM patients\n\nselect floor((weight /10) *10) as weight_group, count(*) as patients_in_group\nfrom patients\ngroup by weight_group\norder by weight_group desc;\n\n\nselect patient_id, weight, height,\n\tcase \n\t\t when (weight/(height/10000)) >= 30 then 1\n else 0 end as isObese\nfrom patients;"},{"id":19,"skipped":false,"userSolution":"select p.patient_id, p.first_name, p.last_name, d.specialty\nfrom patients p\njoin admissions ad on ad.patient_id = p.patient_id\njoin doctors d on d.doctor_id = ad.attending_doctor_id\nwhere ad.diagnosis = \"Epilepsy\" and d.first_name = \"Lisa\";","hints":1,"solvedTime":225001,"completedWithoutSkipping":true},{"id":20,"skipped":false,"userSolution":"select distinct p.patient_id, \n\t concat(p.patient_id, len(p.last_name), year(birth_date)) as temp_password\nfrom patients p\njoin admissions ad on ad.patient_id = p.patient_id\nwhere ad.patient_id = p.patient_id;","hints":1,"solvedTime":300003,"completedWithoutSkipping":true},{"id":21,"skipped":false,"userSolution":"select \n\tcase when patient_id % 2 = 0 then \"Yes\"\n else \"No\" end as has_insurance,\n sum(case when patient_id % 2 = 0 then 10\n \t else 50 end) as cost_of_admission\nfrom admissions\ngroup by has_insurance;","hints":3,"solvedTime":864003,"completedWithoutSkipping":true},{"id":24,"skipped":true,"userSolution":"SELECT * FROM patients\n\nselect floor((weight /10) *10) as weight_group, count(*) as patients_in_group\nfrom patients\ngroup by weight_group\norder by weight_group desc;\n\n\nselect patient_id, weight, height,\n\tcase \n\t\t when (weight/power(height/100, 2)) >= 30 then 1\n else 0 end as isObese\nfrom patients;\n\n\nselect p.patient_id, p.first_name, p.last_name, d.specialty\nfrom patients p\njoin admissions ad on ad.patient_id = p.patient_id\njoin doctors d on d.doctor_id = ad.attending_doctor_id\nwhere ad.diagnosis = \"Epilepsy\" and d.first_name = \"Lisa\";\n\n\nselect distinct p.patient_id, \n\t concat(p.patient_id, len(p.last_name), year(birth_date)) as temp_password\nfrom patients p\njoin admissions ad on ad.patient_id = p.patient_id\nwhere ad.patient_id = p.patient_id;\n\nselect \n\tcase when patient_id % 2 = 0 then \"Yes\"\n else \"No\" end as has_insurance,\n sum(case when patient_id % 2 = 0 then 10\n \t else 50 end) as cost_of_admission\nfrom admissions\ngroup by has_insurance;\n\n\nselect pr.province_name\nfrom patients p\njoin province_names pr on pr.province_id = p.province_id\ngroup by p.gender"}],"autoRun":true,"autocomplete":true,"editorFontSize":14,"persistEditorText":false,"editorText":"SELECT * FROM patients\n\nselect floor((weight /10) *10) as weight_group, count(*) as patients_in_group\nfrom patients\ngroup by weight_group\norder by weight_group desc;\n\n\nselect patient_id, weight, height,\n\tcase \n\t\t when (weight/power(height/100, 2)) >= 30 then 1\n else 0 end as isObese\nfrom patients;\n\n\nselect p.patient_id, p.first_name, p.last_name, d.specialty\nfrom patients p\njoin admissions ad on ad.patient_id = p.patient_id\njoin doctors d on d.doctor_id = ad.attending_doctor_id\nwhere ad.diagnosis = \"Epilepsy\" and d.first_name = \"Lisa\";\n\n\nselect distinct p.patient_id, \n\t concat(p.patient_id, len(p.last_name), year(birth_date)) as temp_password\nfrom patients p\njoin admissions ad on ad.patient_id = p.patient_id\nwhere ad.patient_id = p.patient_id;\n\nselect \n\tcase when patient_id % 2 = 0 then \"Yes\"\n else \"No\" end as has_insurance,\n sum(case when patient_id % 2 = 0 then 10\n \t else 50 end) as cost_of_admission\nfrom admissions\ngroup by has_insurance;\n\n\nSELECT pr.province_name\nFROM patients AS pa\nJOIN province_names AS pr ON pa.province_id = pr.province_id\nGROUP BY pr.province_name\nHAVING\nCOUNT( CASE WHEN gender = 'M' THEN 1 END) > COUNT( CASE WHEN gender = 'F' THEN 1 END);\n \n \n\n ","queryTimes":[{"id":0,"time":168014},{"id":1,"time":65005},{"id":2,"time":43005},{"id":3,"time":76010},{"id":4,"time":49006},{"id":5,"time":52008},{"id":6,"time":72995},{"id":23,"time":83009},{"id":33,"time":80008},{"id":34,"time":89012},{"id":35,"time":83007},{"id":41,"time":114006},{"id":42,"time":278021},{"id":32,"time":81012},{"id":45,"time":95001},{"id":46,"time":82010},{"id":7,"time":118004},{"id":8,"time":355005},{"id":9,"time":344002},{"id":10,"time":145008},{"id":11,"time":458007},{"id":12,"time":271070117},{"id":13,"time":274006},{"id":14,"time":790004},{"id":15,"time":259901770},{"id":16,"time":715011},{"id":22,"time":357011},{"id":27,"time":351013},{"id":28,"time":214006},{"id":30,"time":559003},{"id":31,"time":86004},{"id":37,"time":296010},{"id":38,"time":173004},{"id":40,"time":588079},{"id":47,"time":647001},{"id":48,"time":205002},{"id":50,"time":51016},{"id":51,"time":4895024},{"id":54,"time":132015},{"id":55,"time":31966367},{"id":70,"time":125012},{"id":17,"time":1285011},{"id":18,"time":387014},{"id":19,"time":225001},{"id":20,"time":300003},{"id":21,"time":864003},{"id":24,"time":310004},{"id":25,"time":17002}],"filterState":{"selectedKeywordFilter":"ALL","selectedDifficultyFilter":"Hard","selectedCompletedFilter":"ALL","selectedDatabaseFilter":"Hospital"}}