samplemid - 1 UCLA Computer Science Department Fall 2001...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 UCLA Instr: C. Zaniolo Computer Science Department TAs: P. Michael Fall 2001 Student Name and ID: CS143 MIDTERM EXAM: Closed Book, 2 Hours Attach extra pages as needed. Write your name and ID on the extra pages. Please, write neatly. Problem Score 1.1 (20%) 1.2 (15%) 1.3 (15%) 2.1 (10%) 2.2 (20%) 2.3 (10%) 2.4 (10%) Total (100%) Extra Credit: Midterm Score:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS143 Midterm, Fall 2001 — Page: 2 Problem 1 Given a relation describing the courses taken by each student: Student ( StudentID , Course , Grade ) 1. (20 points) Write an SQL query to find the ID of all students who (i) completed at least two classes, and (ii) took a grade of B or better in all classes he/she completed. (Therefore, students who got two As and two Cs would not satisfy this query. Also, the code for grades is numeric and the grade B is denoted by the number 3.0. Finally, you can assume that students only take a course once.) SELECT StudentID FROM Student AS S1 WHERE S1.StudentID NOT IN (SELECT S2.StudentID FROM Student AS S2
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/14/2008 for the course BIO 370 taught by Professor Edwards during the Spring '08 term at University of Texas at Austin.

Page1 / 4

samplemid - 1 UCLA Computer Science Department Fall 2001...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online