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. (c) For each course with an average grade of at least 3.0, print the course number, department name, enrollment and average grade. Assume that the enrollment of a course is the sum of the enrollment of all its sections. (d) For each department, show information about the student(s) with the highest gpa who major in the department. In particular, for each such student, we want to show the student id, student name and gpa, and the department name the student is major in. If there are ties, show all students with that gpa. (e) Find all courses whose titles contain the word "Programming" (f) How many different letters are used to start the names of students? Hint: In SQL you can get the first letter of a strings as substring(8,1,1)

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

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions

Question

=+employee to take on the international assignment?

Answered: 1 week ago

Question

=+differences in home- and host-country costs of living?

Answered: 1 week ago