0% found this document useful (0 votes)
15 views1 page

SQLAssignment

This document describes tables for a student enrollment database including tables for students, courses, enrollments, and professors. It then lists 10 queries to run on this database including finding student names enrolled in a first year course taught by a specific professor, finding the oldest student majoring in a subject or enrolled in a professor's course, and finding course names, professor names, student names, ages and enrollment information while avoiding duplicates in the results.

Uploaded by

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

SQLAssignment

This document describes tables for a student enrollment database including tables for students, courses, enrollments, and professors. It then lists 10 queries to run on this database including finding student names enrolled in a first year course taught by a specific professor, finding the oldest student majoring in a subject or enrolled in a professor's course, and finding course names, professor names, student names, ages and enrollment information while avoiding duplicates in the results.

Uploaded by

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

Student

StudentN Sname major yearLevel age


o

Enroll
Sno Cname Grade

Course
CourseNam CourseTime CourseHall ProfNO
e

Professor
ProfID Pname CollageID

Write the following queries in SQL without duplications

1. Find the names students who are in the first year ( year = 1) and enrolled in a course
taught by professor Smith.
2. Find the age of the oldest student who is either majoring in “Information Systems” OR
enrolled in a course with Professor Smith
3. Find the names of all courses that are held in Hall 202 OR has 12 or more students
enrolled in it.
4. Find the students who have conflicting courses ‫ ( تعارض‬that has the same timing for
different courses )
5. Find the names of professor who teach all the courses.
6. Find the names of faculty members for whom the combined enrollment of the courses
that they teach is less than 10.
7. For each year level, print the level and the average age of students for that level.
8. For all levels except year 4, print the level and the average age of students for that level
9. Find the names of students enrolled in the maximum number of courses.
10. Find the names of students not enrolled in any course

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy