Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the following queries in SQL 1. Consider the following database schema describing students enrolled in sections of classes at a university. student (sid*, sname,

image text in transcribed

image text in transcribed

Write the following queries in SQL

1. Consider the following database schema describing students enrolled in sections of classes at a university. student (sid*, sname, sex, age, year, gpa) [Year is a number between 1 and 5). dept(dname*, numphds) prof(pname*, dname) course(cno*, cname, dname*) (Course numbers are unique within departments.] major(dname*, sid*) section(dname*, cno*, sectno*, pname) (Associates an instructor to a section.] enroll(sid*, grade, dname*, cno*, sectno*) (Associates students to sections. (8) Give the names of each professor who has in one of his/her classes a student older than 50. List each professor at most once, in alphabetical order. (h) Show the dname, cno and sectno of all course sections together with the total number of students enrolled in the section. Order the output in decreasing order of popularity. (1) Find all information about students who are not enrolled in any classes. G) List all pairs of professor names where the two professors teach the same course in the same department. Don't repeat any pairs

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

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions