Question ID 4964 | Examine the structure of the STUDENTS table:
STUDENT_ID NUMBER NOT NULL, Primary Key
STUDENT_NAME VARCHAR2(30)
COURSE_ID VARCHAR2(10) NOT NULL
MARKS NUMBER START_DATE DATE FINISH_DATE DATE
You need to create a report of the 10 students who achieved the highest ranking in the course INT SQL and who completed the course in the year 1999.
Which SQL statement accomplishes this task?
|
Option A | A. SELECT student_ id, marks, ROWNUM "Rank"
FROM students
WHERE ROWNUM <= 10
AND finish_date BETWEEN '01-JAN-99' AND '31-DEC-99
AND course_id = 'INT_SQL'
ORDER BY marks DESC;
|
Option B | B. SELECT student_id, marks, ROWID "Rank"
FROM students
WHERE ROWID <= 10
AND finish_date BETWEEN '01-JAN-99' AND '31-DEC-99'
AND course_id = 'INT_SQL'
ORDER BY marks;
|
Option C | C. SELECT student_id, marks, ROWNUM "Rank"
FROM (SELECT student_id, marks
FROM students
WHERE ROWNUM <= 10
AND finish_date BETWEEN '01-JAN-99' AND '31-DEC-
99'
AND course
_ id = 'INT_SQL'
ORDER BY marks DESC);
|
Option D | D. SELECT student_id, marks, ROWNUM "Rank”
FROM (SELECT student_id, marks
FROM students
WHERE (finish_date BETWEEN ’01-JAN-99 AND ’31-DEC-99’
AND course_id = ‘INT_SQL’
ORDER BY marks DESC)
WHERE ROWNUM <= 10 ;
|
Option E | E. SELECTstudent id, marks, ROWNUM “Rank”
FROM(SELECT student_id, marks
FROM students
ORDER BY marks)
WHEREROWNUM <= 10
ANDfinish date BETWEEN ’01-JAN-99’ AND ’31-DEC-99’
ANDcourse_id = ‘INT_SQL’;
|
Correct Answer | D |
Question ID 4965 | The STUDENT_GRADES table has these columns:
STUDENT_IDNUMBER(12) SEMESTER_ENDDATE GPANUMBER(4,3)
The registrar has asked for a report on the average grade point average (GPA), sorted from the highest grade point average to each semester, starting from the earliest date.
Which statement accomplish this?
|
Option A | A. SELECT student_id, semester_end, gpa FROM student_grades
ORDER BY semester_end DESC, gpa DESC;
|
Option B | B. SELECT student_id, semester_end, gpa FROM student_grades
ORDER BY semester_end, gpa ASC
|
Option C | C. SELECT student_id, semester_end, gpa FROM student_grades
ORDER BY gpa DESC, semester_end ASC;
|
Option D | D. SELECT student_id, semester_end, gpa FROM student_grades
ORDER BY gpa DESC, semester_end DESC;
|
Option E | E. SELECT student_id, semester_end, gpa FROM student_grades
ORDER BY gpa DESC, semester_end ASC;
|
Option F | F. SELECT student_id,semester_end,gpa FROM student_grades
ORDER BY semester_end,gpa DESC
|
Correct Answer | F |