1.
Student table: Student Student Table (school number, name, gender, age, Organization Department)
Course Curriculum (number, course name)
Sc Selected timetable (school number, course number, score)
The table structure is as follows:
(1). Write an SQL statement, query the "Computer principle" student number and name
(2). Write an SQL statement that queries the ' Stephen Chow Chi ' class name
(3). Write an SQL statement that queries the student number and name of 5 courses
(1)
Select sno,sname from student where sno in ( select sno from sc where cno = ( select cno from course where cname= ' Principles of computer ' ) )
(2)
Select cname from course where cno in ( select cno from sc where sno = ( select sno from student where sname= ' Stephen Chow Chi ' ) )
(3)
Select Sno,sname from Student Where Sno in (select Sno From SC GROUP by SNO have Count (Sno) =5)
This article is from a "stroll," blog, please be sure to keep this source http://macxiao.blog.51cto.com/9606147/1589170
Database Pen Questions