试题详情

Mysql中表student_table(id,name,birth,sex),插入如下记录:(‘1001‘,‘‘,‘2000-01-01‘,‘男‘);(‘1002‘,null,‘2000-12-21‘,‘男‘);(‘1003‘,NULL,‘2000-05-20‘,‘男‘);(‘1004‘,‘张三‘,‘2000-08-06‘,‘男‘);(‘1005‘,‘张三‘,‘2001-12-01‘,‘女‘);(‘1006‘,‘李四‘,‘2001-12-02‘,‘女‘);查询男生女生存在的相同姓名,比如‘张三‘,正确的是()?

A selectdistinctt1.namefrom(select*fromstudent_tablewheresex=‘女‘)t1innerjoin(select*fromstudent_tablewheresex=‘男‘)t2ont1.name=t2.name;

B selectdistinctt1.namefrom(select*fromstudent_tablewheresex=‘女‘)t1leftjoin(select*fromstudent_tablewheresex=‘男‘)t2ont1.name=t2.name;

C selectdistinctt1.namefrom(select*fromstudent_tablewheresex=‘女‘)t1fulljoin(select*fromstudent_tablewheresex=‘男‘)t2ont1.name=t2.name;

D selectdistinctt1.namefrom(select*fromstudent_tablewheresex=‘女‘)t1rightjoin(select*fromstudent_tablewheresex=‘男‘)t2ont1.name=t2.name;