Documente Academic
Documente Profesional
Documente Cultură
i)Write appropriate SQL DDL statements for declaring the above database.
SQL> create table student(name varchar(20),student_no number(2),class
number(1),major varchar(10));
Table created.
Table created.
Table created.
Table created.
STUDENT_NO SECTION_NO G
---------- ---------- -----------------------
17 112 B
17 119 C
8 85 A
8 92 A
8 102 B
8 135 A
ii)Write SQL statements to retrieve the names of all courses taught by a particular
instructor in 1998 and 1999.
SQL> select course_name, instructor, year from course, section where
course.course_no=section.course
_no and year in (1998,1999) AND instructor='&instructor';
Enter value for instructor: Anderson
old 1: select course_name, instructor, year from course, section where
course.course_no=section.co
new 1: select course_name, instructor, year from course, section where
course.course_no=section.co
iii)Write SQL statement to retrieve the name and transcript of each senior student
(class=4) majoring in CS.
Transcript should include course_name, course_no, credit, semester and grade for
each student.