Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Student ( sid , name, did, avgGrade ) Take ( sid , cid, grade ) Course ( cid , title, credits, did, avgGrade ) Department

Student (sid, name, did, avgGrade)
Take (sid, cid, grade)
Course (cid, title, credits, did, avgGrade)
Department (did, name, avgGrade)
Teacher (tid, name, did, avgGrade)
Teach (tid, cid)
Write the following questions in SQL using the database schema above.
1.(10) List the ID and grades of the student named 'Ali KURT' (name).
2.(10) List the records (i.e. all columns of the course table) of the courses taken by the student named 'Aye KURT' (name) but not taken by the student named 'Ali KURT'.
3.(10) List the students' SIDs and the number of courses they took, their GPA, their highest and lowest grades.
4. List the did's of the departments and the number of students in descending order according to the number of students (Do not write in relational algebra).
5.(10) List the sid's of the professors who teach more than 2 courses, the number of courses they teach and the number of students taking their courses.
6.(10) List the records (list all fields in the student table) of the fields (use take table) from the students in the department named 'Computer Engineering' (department.name) and the courses in the department named 'Electrical Engineering' (department.name).
7. Find the average of the number of students in each course (the number of students taking each course will be determined from the take table, and then the average of these numbers will be found) and list the enrollments of the courses with more students than this average. (first the cids of the courses with more students than the average will be found, then based on these cids the course records in the course table will be found)
8. List the records of students who took two different courses without using GROUP BY.(Since there are 2 different course subjects, the take table needs to be used twice! First, the sids of these students will be found with a (sub)query, then the records in the student table, that is, all columns, will be accessed through these sids.)
9. List the professors who do not teach any lessons (this means there is no record of this teacher in the teaching table).
10. List the records of the instructors (all columns in the teacher table).(That is, all teachers with tid in the teach table)Yukardaki veritabanemasn kullanarak aadaki sorular SQL ile yaznz.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

4. Model self-criticism of your own productions.

Answered: 1 week ago

Question

What do you think is likely to be Liams problem? Discuss.

Answered: 1 week ago

Question

What laws were passed because of domestic violence?

Answered: 1 week ago