student(stu_id,stu_name),course(cou_id,cou_name),stu_cou(stu_id,cou_id)(stu_cou为学生选课表)
一条sql语句选择出学生姓名和他的选择科目名称,怎么做??

解决方案 »

  1.   

    select stu_name,cou_name
    from student s ,course,stu_cou sc
    where s.stu_id=sc.stu_id and c.cou_id=sc.cou_id 
      

  2.   

    select stu_name,cou_name
    from student s ,course c ,stu_cou sc
    where s.stu_id=sc.stu_id and c.cou_id=sc.cou_id 
      

  3.   

    SELECT stu_name,cou_name FROM student S JOIN stu_cou  C ON  S.stu_id=C.stu_id JOIN course CC ON CC.cou_id=C.cou_id
      

  4.   

    select  a.stu_name, c.cou_name from student a
    left join stu_cou b on a.stu_id=b.stu_id
    left join course c on b.cou_id=c.cou_id
      

  5.   


    SELECT stu_name,cou_name from student a
    join stu_cou b on a.stu_id=b.stu_id
    join course c  on c.cou_id=b.cou_id
      

  6.   

    SELECT student.stu_name
       ,course.cou_name
    FROM stu_cou 
    INNER JOIN student ON student.stu_id=stu_cou.stu_id
    INNER JOIN course ON course.cou_id=stu_cou.cou_id
      

  7.   

    select stu_name,cou_name
    from student s ,course c ,stu_cou sc
    where s.stu_id=sc.stu_id and c.cou_id=sc.cou_id 
      

  8.   

    select a.stu_name,b.course from student a ,course b,stu_cou c
    where a.stu_id=c.stu_id and b.cou_id=c.cou_id
      

  9.   


    select a.stu_name,b.course from student a ,course b,stu_cou c
    where a.stu_id=c.stu_id and b.cou_id=c.cou_id