diff --git "a/data/2.MySQL\344\270\255\351\230\266/6.\350\277\236\346\216\245\346\237\245\350\257\242/3. RIGHT JOIN/right_join.md" "b/data/2.MySQL\344\270\255\351\230\266/6.\350\277\236\346\216\245\346\237\245\350\257\242/3. RIGHT JOIN/right_join.md" index 43ca05f929770646fafe7b60a495f3ed70646c80..f5b6135d3f939abf7d4eaa69e8a69370938c6941 100644 --- "a/data/2.MySQL\344\270\255\351\230\266/6.\350\277\236\346\216\245\346\237\245\350\257\242/3. RIGHT JOIN/right_join.md" +++ "b/data/2.MySQL\344\270\255\351\230\266/6.\350\277\236\346\216\245\346\237\245\350\257\242/3. RIGHT JOIN/right_join.md" @@ -33,9 +33,9 @@ create table employee( ## 答案 ```sql -select e.id, e.name, e.dept +select e.id, e.name, e.dept_id, d.name from department as d - right join employee as e on d.id = e.dept + right join employee as e on d.id = e.dept_id where d.id is null; ``` @@ -44,27 +44,27 @@ where d.id is null; ### A ```sql -select e.id, e.name, e.dept +select e.id, e.name, e.dept_id, d.name from employee as e - right join department as d on d.id = e.dept + right join department as d on d.id = e.dept_id where e.id is null; ``` ### B ```sql -select e.id, e.name, e.dept +select e.id, e.name, e.dept_id, d.name from employee as e - right join department as d on d.id = e.dept + right join department as d on d.id = e.dept_id where d.id is null; ``` ### C ```sql -select e.id, e.name, e.dept +select e.id, e.name, e.dept_id, d.name from department as d - join employee as e on d.id = e.dept + join employee as e on d.id = e.dept_id where d.id is null; ``` @@ -72,8 +72,8 @@ where d.id is null; ### D ```sql -select e.id, e.name, e.dept +select e.id, e.name, e.dept_id, d.name from department as d - right join employee as e on d.id = e.dept + right join employee as e on d.id = e.dept_id where d.id is null; ``` \ No newline at end of file