Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the below schema of the university database (keys are in bold and underline): Students(stuID: String, stuName: String, gender: String, birthdate: Date, enterYear: Year, gpa:

Consider the below schema of the university database (keys are in bold and underline): Students(stuID: String, stuName: String, gender: String, birthdate: Date, enterYear: Year, gpa: Float) Departments(deptName: String, numPhDs: Integer) ProfessorWorks(profID: String, profName: String, deptName: String) CourseOffers(cNo: String, cTitle: String, deptName: String) Majors(deptName: String, stuID: String, degreeProgram: String, attendSemester: String, attendYear: String) Sections(cNo: String, academicYear: String, semester: String, sectNo: String, profID: String, meetsAt: String, room: String) Enrolls(stuID: String, cNo: String, academicYear: String, semester: String, sectNo: String, grade: String) These tables have been created and the data have been populated using MySQL server. Download DBHW4s17.sql to your computer and run it on MySQL. Execute your SQL statements based on these tables. Turn in your SQL queries statements and the results of these queries to the assignment link. Write the following queries in SQL statements. The query answers must not contain duplicates, but you should use the SQL keyword DISTINCT only when necessary. When your SQL query statement is not accepted by MySQL, it will display error messages. You need to read that message and fix all problems accordingly. Note that MySQL does not support INTERSECT and EXCEPT currently. When you need to find the intersection and difference of two result sets, you can use IN and NOT IN instead. In addition, for this assignment, creation of temporary tables is not allowed, i.e., for each question you have to write exactly one SQL statement.

1. Print the name(s) of professor(s) who teaches class(es) for the Information Technology department. Note that Information Technology is a department name.

2. Print the names of departments that have one or more students whose GPA is above 3.50.

3. Print the age of the oldest and youngest student(s) per department. Note that MySQL provides several functions for performing calculations on DATE. The function TIMESTAMDIFF() can be used to convert the date of birth to age. Several examples are available at https://dev.mysql.com/doc/refman/5.7/en/date-calculations.html

. 4. Print the name(s) and sid(s) of the student(s) enrolled in at least three classes in Fall 2016. 5. Find the names of students who have enrolled in both ITT 226 and Math 461 in Fall 2016. Note that ITT 226 and Math 461 are course numbers (cNo).

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_2

Step: 3

blur-text-image_3

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

7. What is coaching? Is there only one type of coaching? Explain.

Answered: 1 week ago