时间:2021-07-01 10:21:17 帮助过:5人阅读
select w.fname, w.lname, j.job_name from worker w join job j;
| fname | lname | job_name | +-------+-------+----------+ | a | a | cleaner | | b | b | cleaner | | c | c | cleaner | | a | a | farmer | | b | b | farmer | | c | c | farmer | | a | a | boss | | b | b | boss | | c | c | boss |
select w.fname, w.lname, j.job_name from worker w join job j where w.wid = j.jid;
| fname | lname | job_name | +-------+-------+----------+ | a | a | cleaner | | b | b | farmer | | c | c | boss |
insert into worker (fname, lname) values (‘d‘, ‘d‘);
select w.fname, w.lname, j.job_name from worker w join job j where w.wid = j.jid;
| fname | lname | job_name | +-------+-------+----------+ | a | a | cleaner | | b | b | farmer | | c | c | boss |