0% found this document useful (0 votes)
6 views

IFT - Assignment 6

The document contains a series of SQL queries designed to extract specific information from a database related to students, courses, sections, and grades. The queries include selections based on various conditions such as class, major, instructor, and year. Overall, the document demonstrates how to retrieve data from multiple tables using joins and conditions in SQL.

Uploaded by

gjacks17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

IFT - Assignment 6

The document contains a series of SQL queries designed to extract specific information from a database related to students, courses, sections, and grades. The queries include selections based on various conditions such as class, major, instructor, and year. Overall, the document demonstrates how to retrieve data from multiple tables using joins and conditions in SQL.

Uploaded by

gjacks17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

​ Select name

From student

Where class = 4 and major = ‘CS’;

2.​ Select course_number

From section

Where instructor = ‘King’ and (year = 2007 or year = 2008);

3.​ Select grade

From grade_report

Where student_number = 8;

4.​ Select prerequisite_number

From prerequisite

Where course_number = ‘CS3380’;

5.​ Select course_name

From course

Where department = ‘CS’;

6.​ Select course_number, semester, year

From section

Where instructor = ‘King’;

7.​ Select s.student_number, s.name, c.course_name, c.course_number, c.credit_hours,

se.semester, se.year

From student s, grade_report g, section se, course c

Where s.student_number = g.student_number


And g.section_identifier = se.sections_identifer

And se.course_number = c.course_number

And s.major = ‘cs’

And s.class = 2;

8.​ Select c.course_number, c.course_name

From course c, section s, grade_report g

Where c.course_number = s.course_number

And s.section_identifier = g.section_identifer

And s.semester = ‘fall’

And s.year = ‘2008’

And g.student_number = 8;

9.​ Select s.name

From student s, grade_report g, section se

Where s.student_number = g.student_year

And g.section_identifer = s.section_identifer

And g.grade = ‘a’

And s.course_number = ‘CS1310’;

10.​Select count(*)

From student;

11.​Select max(course_hours)

From course;

12.​Select count(*)
From course

Where credit_hours = 3;

13.​Select course_number

From section

Where instructor = ‘Anderson’;

14.​Select c.course_name

From course c, section se

Where c.course_number = se.course_number

And se.instructor = ‘Anderson’;

15.​Select count(student_number)

From grade_report

Where grade = ‘A’

And count(section_identifier) =

(select count(section_identifier)

From section

Where course_number = ‘MATH240’);

You might also like