形式
Plain text
投稿日時
2022-06-27 05:01
公開期間
無期限
  1. Given the table Employee (employee_id, name) and Salary (employee_id, salary) with some extra info that aren't crucial, give the list of employee_id that do not have names or salaries in ascending order.
  2. select inner_select.employee_id from (
  3. select employee_id from Employees where employee_id not in (select employee_id from Salaries)
  4. union
  5. select employee_id from Salaries where employee_id not in (select employee_id from Employees)
  6. ) as inner_select order by inner_select.employee_id asc;
  7. I think it could be improved to be more efficient. One idea is to join Employee and Salary on the employees that are in both and then take a subtraction between all the employee_id and those in the join. But that operation may cost quite a bit as well (a join is not cheap and the diff is not cheap too).
  8. Idee it seems that it is possible to improve quite a bit.
  9. "Runtime: 596 ms, faster than 43.59% of MySQL online submissions for Employees With Missing Information.
  10. Memory Usage: 0B, less than 100.00% of MySQL online submissions for Employees With Missing Information."
ダウンロード 印刷用表示

このコピペの URL

JavaScript での埋め込み

iframe での埋め込み

元のテキスト