Question

4. Write SQL queries to answer the following questions, a. How many students were enrolled in secoon 14 b. How many students

Problem 1-5 using the table below in the picture to be answered in Microsoft SQL. Thanks

0 0
Add a comment Improve this question Transcribed image text
Answer #1

PLEASE LIKE THIS ANSWER, IT HELPS ME A LOT. THANK YOU!!!

(1)

a.       Display the course ID and course name for all courses with an ISM prefix:

Query:

SELECT COURSE_ID, COURSE_NAME

                 FROM COURSE

                 WHERE COURSE_ID LIKE 'ISM%';

b.      Display all courses for which Professor Berndt has been qualified:

Query:

SELECT FACULTY_NAME, COURSE.COURSE_ID, COURSE_NAME

                 FROM FACULTY, COURSE, QUALIFIED

                 WHERE QUALIFIED.FACULTY_ID = 3467

                 AND FACULTY.FACULTY_ID= QUALIFIED.FACULTY_ID

                 AND COURSE.COURSE_ID=QUALIFIED.COURSE_ID;

c.       Display the class roster, including student name, for all students enrolled in section 2714 of ISM 4212:

Query:
SELECT STUDENT.STUDENT_ID, STUDENT_NAME,

                        SECTION.COURSE_ID, REGISTRATION.SECTION_NO, SEMESTER

                 FROM STUDENT, REGISTRATION, SECTION

                 WHERE SECTION.SECTION_NO= REGISTRATION.SECTION_NO

                 AND STUDENT.STUDENT_ID= REGISTRATION.STUDENT_ID AND REGISTRATION.SECTION_NO=2714

                 AND SECTION.SEMESTER='I-2008'

                 AND REGISTRATION.SEMESTER='I-2008'

                 ORDER BY STUDENT_NAME;

(2)

SELECT FacultyName
FROM FACULTY,QUALIFIED
WHERE QUALIFIED.FacultyID=FACULTY. FacultyID
AND QUALIFIED.CourseD='ISM 3113';

(3)

SELECT FACULTY.FacultyNAME
FROM FACULTY, QUALIFIED
WHERE QUALIFIED.FacultyID=FACULTY. FacultyID
AND QUALIFIED.CourseID='ISM 3113'
AND NOT (QUALIFIED.CourseID='ISM 4930')

(4)

a) SELECT COUNT (DISTINCT (StudentID))
        FROM REGISTRATION
        WHERE SectionNo = 2714
        AND SEMESTER = 'I-2008'

b) SELECT COUNT (DISTINCT (StudentID))
        FROM SECTION, REGISTRATION
        WHERE SECTION.SectionNO = REGISTRATION.SectionNO
        AND CourseID = 'ISM 3113'
        AND Semester = 'I-2008'

(5)

Select STUDENT.StudentID, STUDENT.StudentName from

STUDENT Where NOT EXISTS

(

Select * from REGISTRATION where REGISTRATION.StudentID = STUDENT.StudentID and REGISTRATION.Semester = 'I-2008')

PLEASE LIKE THIS ANSWER, IT HELPS ME A LOT. THANK YOU!!!

Add a comment
Know the answer?
Add Answer to:
Problem 1-5 using the table below in the picture to be answered in Microsoft SQL. Thanks...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT