当前位置:网站首页>Mysql database - connection query

Mysql database - connection query

2022-04-23 19:42:00 X heart

The first 1 Turn off : Internal connection query

USE School;

##########  Query the students' names and corresponding classes in the data table  ##########
# Please add the implementation code here 
########## Begin ##########


select tb_student.name as studentName,tb_class.name as className from tb_student inner join tb_class on tb_student.class_id = tb_class.id;

########## End ##########

The first 2 Turn off : External connection query

USE School;

##########  Use the left outer connection to query the names of all students and the corresponding classes  ##########

# Please add the implementation code here 
########## Begin ##########
select tb_student.name as studentName,tb_class.name as className from tb_student left join tb_class on tb_student.class_id = tb_class.id;

select tb_student.name as studentName,tb_class.name as className from tb_student right join tb_class on tb_student.class_id = tb_class.id;

########## End ##########

##########  Use the right external connection to query all student names and corresponding classes  ##########

# Please add the implementation code here 
########## Begin ##########




########## End ##########

The first 3 Turn off : Composite conditional join query

USE School;

##########  Check the scores of all classes in 90 The name of the student with a score of above, the student's grade and the class in which the student belongs  ##########
# Please add the implementation code here 
########## Begin ##########
select tb_student.name as studentName,tb_student.score, tb_class.name as className from tb_student join tb_class on tb_student.class_id =tb_class.id  where score > 90 ;



########## End ##########

版权声明
本文为[X heart]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231927030753.html