Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Which statement below would produce student names, the course titles, and sec

ID: 3711005 • Letter: 1

Question

1. Which statement below would produce student names, the course titles, and section IDs for all enrolled students?

SELECT Student_name, Course_title, Section_ID FROM Courses,Enrollment

WHERE Student.Student_ID = Enrollment.Student_ID;

SELECT Student_name, Course_title, Section_ID FROM Student, Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Enrollment.Section_ID = Sections.Section_ID AND

     Sections.Course_ID = Courses.Course_ID;

SELECT Student_name, Course_ID, Section_ID FROM Students, Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID;

SELECT Student_ID, Student_name, Course_ID, Section_ID FROM Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Sections.Course_ID = Courses.Course_ID;

2. Which SELECT statement below would produce the following result?

Thiel

Concepts in Art

Thiel

Survey of Art

Thiel

Intermediate Ceramics

SELECT Student_name, Course_title FROM Student, Courses

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Student_name = 'Thiel';

SELECT Student_name, Course_title FROM Student, Courses

     WHERE Student_name = 'Thiel';

SELECT Student_name, Course_title FROM Student, Enrollment, Courses

     WHERE Enrollment.Student_ID = '55560';

SELECT Student_name, Course_title FROM Student, Enrollment, Courses

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Enrollment.Section_ID = Sections.Section_ID AND

     Student_name = 'Thiel';

3.

Question 3

If a student's name changes, a) how many tables will need to be updated in this relational design and b) what problem does this prevent?

1 table; data relevance

1 table; data inconsistency

2 tables; data singularity

2 tables; data integrity

4. Another term for an inner join is a(n):

Cartesian product

Equi-join

Cross product

Cross join

5.

The number of rows returned by a table relationship without a join condition, where the rows retrieved will be all of the rows of the first table multiplied by all of the rows in the second table is known as a(n):

Cartesian product

Self-join

Intersection

Cross quantifier

6.

Which statement below would produce the course title, section ID, and number of students enrolled in each section? (Hint: you need an aggregate function and you need to organize the results by course title and then by section ID)

SELECT Course_title, Section_ID, COUNT(Student_ID) FROM Enrollment, Sections, Courses

     WHERE Enrollment.Section_ID = Sections.Section_ID AND

     Sections.Course_ID = Courses.Course_ID

GROUP BY Course_title, Section ID;

SELECT Course_title, Section_ID, COUNT(Student_ID) FROM Enrollment, Sections, Courses

     WHERE Enrollment.Section_ID = Sections.Section_ID AND

     Sections.Course_ID = Courses.Course_ID

ORDER BY Student_ID;

SELECT Course_title, Section_ID, Section_capacity FROM Courses, Sections

     WHERE Courses.Course_ID = Sections.Course_ID

GROUP BY Section_capacity;

SELECT Course_title, Student_name, COUNT(Student_ID) FROM Students, Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Sections.Section_ID = Enrollment.Section_ID

ORDER BY Sections;

7.

Which statement below shows the section IDs, course titles, and faculty IDs?

SELECT Section_ID, Course_title, Faculty_ID FROM Sections, Courses

     WHERE Sections.Course_ID = Courses.Course_ID;

SELECT Section_ID, Course_ID, Faculty_ID FROM Sections, Courses

     WHERE Sections.Course_ID = Courses.Course_ID;

SELECT Section_ID, Course_title, Faculty_ID FROM Sections, Courses, Faculty

     WHERE Sections.Course_ID = Courses.Course_ID AND

     Sections.Faculty_ID = Faculty.Faculty_ID;

SELECT Section_ID, Course_title, Faculty_phone FROM Sections, Courses

     WHERE Sections.Course_ID = Courses.Course_ID AND

     Sections.Faculty_ID = Faculty.Faculty_ID;

8.

Which statement below shows the section IDs and course titles for courses taught by Harris?

SELECT Section_ID, Course_title, FROM Sections, Courses, Faculty

     WHERE Sections.Course_ID = Courses.Course_ID AND

     Sections.Section_ID = Faculty.Faculty_ID AND

     Faculty_name <> 'Harris';

SELECT Section_ID, Faculty_name FROM Sections, Faculty

     WHERE Faculty.Faculty_ID = Sections.Faculty_ID AND

     Faculty_name = 'Harris';

SELECT Section_ID, Course_title FROM Sections, Courses, Faculty

     WHERE Sections.Course_ID = Courses.Course_ID AND

     Faculty_name = 'Harris';

SELECT Section_ID, Course_title FROM Sections, Courses, Faculty

     WHERE Sections.Section_ID = Courses.Course_ID AND

     Sections.Faculty_ID = Faculty.Faculty_ID

     AND Faculty_name = 'Harris';

Which statement below would produce a list of faculty names, course IDs, and course titles?

SELECT Faculty_name, Course_ID, Course_title FROM Faculty, Courses, Sections

     WHERE Faculty.Faculty_ID = Sections.Faculty_ID AND

     Sections.Faculty_ID = Courses.Course_ID;

SELECT Faculty_name, Course_ID, Course_title FROM Faculty, Courses, Sections

     WHERE Faculty.Faculty_ID = Sections.Faculty_ID AND

     Sections.Course_ID = Courses.Course_ID;

SELECT Faculty_name, Course_ID, Course_title FROM Faculty, Sections

     WHERE Faculty.Faculty_ID = Sections.Faculty_ID;

SELECT Faculty_name, Course_ID, Course_title FROM Faculty, Courses

     WHERE Faculty.Faculty_ID = Courses.Faculty_ID;

10.

______ means that the value of the foreign key in a related table must be either completely NULL (no value) or must exactly match its primary key value.

Referential integrity

Equi-join

Data redundancy

Normalization

A.

SELECT Student_name, Course_title, Section_ID FROM Courses,Enrollment

WHERE Student.Student_ID = Enrollment.Student_ID;

B.

SELECT Student_name, Course_title, Section_ID FROM Student, Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Enrollment.Section_ID = Sections.Section_ID AND

     Sections.Course_ID = Courses.Course_ID;

C.

SELECT Student_name, Course_ID, Section_ID FROM Students, Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID;

D.

SELECT Student_ID, Student_name, Course_ID, Section_ID FROM Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Sections.Course_ID = Courses.Course_ID;

2. Which SELECT statement below would produce the following result?

Thiel

Concepts in Art

Thiel

Survey of Art

Thiel

Intermediate Ceramics

A.

SELECT Student_name, Course_title FROM Student, Courses

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Student_name = 'Thiel';

B.

SELECT Student_name, Course_title FROM Student, Courses

     WHERE Student_name = 'Thiel';

C.

SELECT Student_name, Course_title FROM Student, Enrollment, Courses

     WHERE Enrollment.Student_ID = '55560';

D.

SELECT Student_name, Course_title FROM Student, Enrollment, Courses

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Enrollment.Section_ID = Sections.Section_ID AND

     Student_name = 'Thiel';

3.

Question 3

If a student's name changes, a) how many tables will need to be updated in this relational design and b) what problem does this prevent?

A.

1 table; data relevance

B.

1 table; data inconsistency

C.

2 tables; data singularity

D.

2 tables; data integrity

4. Another term for an inner join is a(n):

A.

Cartesian product

B.

Equi-join

C.

Cross product

D.

Cross join

5.

The number of rows returned by a table relationship without a join condition, where the rows retrieved will be all of the rows of the first table multiplied by all of the rows in the second table is known as a(n):

A.

Cartesian product

B.

Self-join

C.

Intersection

D.

Cross quantifier

6.

Which statement below would produce the course title, section ID, and number of students enrolled in each section? (Hint: you need an aggregate function and you need to organize the results by course title and then by section ID)

A.

SELECT Course_title, Section_ID, COUNT(Student_ID) FROM Enrollment, Sections, Courses

     WHERE Enrollment.Section_ID = Sections.Section_ID AND

     Sections.Course_ID = Courses.Course_ID

GROUP BY Course_title, Section ID;

B.

SELECT Course_title, Section_ID, COUNT(Student_ID) FROM Enrollment, Sections, Courses

     WHERE Enrollment.Section_ID = Sections.Section_ID AND

     Sections.Course_ID = Courses.Course_ID

ORDER BY Student_ID;

C.

SELECT Course_title, Section_ID, Section_capacity FROM Courses, Sections

     WHERE Courses.Course_ID = Sections.Course_ID

GROUP BY Section_capacity;

D.

SELECT Course_title, Student_name, COUNT(Student_ID) FROM Students, Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Sections.Section_ID = Enrollment.Section_ID

ORDER BY Sections;

Explanation / Answer

Answer:------------

1.  B. SELECT Student_name, Course_title, Section_ID FROM Student, Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Enrollment.Section_ID = Sections.Section_ID AND

     Sections.Course_ID = Courses.Course_ID;

2. A.  SELECT Student_name, Course_title FROM Student, Enrollment, Courses

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Enrollment.Section_ID = Sections.Section_ID AND

     Student_name = 'Thiel';

3. D.  2 tables; data integrity

4.   B. Equi-join

5. A. Cartesian product

6. D.  SELECT Course_title, Student_name, COUNT(Student_ID) FROM Students, Courses, Enrollment

     WHERE Student.Student_ID = Enrollment.Student_ID AND

     Sections.Section_ID = Enrollment.Section_ID

ORDER BY Sections;

7. C.  SELECT Section_ID, Course_title, Faculty_ID FROM Sections, Courses, Faculty

     WHERE Sections.Course_ID = Courses.Course_ID AND

     Sections.Faculty_ID = Faculty.Faculty_ID;

8. D.  SELECT Section_ID, Course_title FROM Sections, Courses, Faculty

     WHERE Sections.Section_ID = Courses.Course_ID AND

     Sections.Faculty_ID = Faculty.Faculty_ID

     AND Faculty_name = 'Harris';

9. B.  SELECT Faculty_name, Course_ID, Course_title FROM Faculty, Courses, Sections

     WHERE Faculty.Faculty_ID = Sections.Faculty_ID AND

     Sections.Course_ID = Courses.Course_ID;

10. A. Referential integrity