There is a relational database with three basic tables. The table structure is as follows: table 1 student no. stu_id name age gender No. depart_id Table 2. SC student no. stu_id course No. course_code score Table 3. course
Www.2cto.com course No. course_code Course name course_name: Number of course hours course_hour1. Compile an SQL statement to query the student ID, name, course name, and score of a student whose number is 990020.
2. Compile an SQL statement to query the query results of a student whose student ID is 014206202216 years older than the student ID.
Student ID, name, age.
3. Search for the department number, student ID, name, lowest score, and highest score of the students whose elective courses are more than 10,
The average score and the total number of courses selected. The results are sorted by the system number and average score (in descending order ).
4. Please use the SQL language to search for at least the courses selected by students whose student ID is 014206202217
Student ID and name for all courses. [Answer] www.2cto.com (1) select a. stu_id, a. name, B. course_name, c. score from student a, course
B, SC c where a. stu_id = c. stu_id and c. course_code = B. course_code
And a. depart_id = 990020; (2) select stu_id, name, age from student where age> = 1 + (select age from
Student where stu_id = 014206202216); (3)
(4) www.2cto.com
[Note] for the complete SQL statement code used in this article, please download the attachment!
Http://up.2cto.com/2013/0206/20130206015802463.rar