Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

This assignment uses a database with data about a university; the database resides in our Oracle servers. The schema of the database is provided below. Keys are in bold face and underlined, field types are omitted; assume that appropriate foreign key constraints have been defined in the full version of the schema (for example, a dname in the prof table does indeed references a department that exists in the dept table):

  • student(sid, sname, sex, age, year, gpa)
  • dept(dname, numphds)
  • prof(pname, dname)
  • course(cno, cname, dname)
  • major(dnamesid)
  • section(dnamecnosectno, pname)
  • enroll(sid, grade, dnamecno, sectno)

We ask that you write the following queries in SQL. Each question is worth 2 points.

Print the sid and name of students who have enrolled in at least one course offered by the 'Chemical Engineering' department and at least one course offered by the 'Industrial Engineering' department.

Print the name and age of the student(s) with the highest GPA among all students of the same age.

Top students per major. For each department with more than 8 students majoring in the department, print the following information about the student(s) with the highest GPA within the department: the student id, student name and GPA, and the department name the student is major in.

Difficult courses. For each department offering more than 2 courses, print the department name, course number, and course average grade of each course that has an average grade that is at least 5% less than the average grade obtained by students in all courses offered by the same department.

Top 2 unpopular courses. Print the department name, course number, and course enrollment of each course that has an enrollment equal to the lowest or second to the lowest enrollment of all courses offered by the same department. The enrollment of a course is the sum of the enrollment of all its sections. Note: for this query, you should consider all courses, including those with zero enrollment. [Hint: You will need to use outer joins for this query; see class notes on the subject and for more the Oracle's online manual on Outer Joins and Using Outer Joins: Examples.]

What to do

  • Write one SQL query for each question above.
  • Run your SQL queries on one of our Oracle servers (choose any one, they are all identical) using the web interface that we have set up at:
  • http://w4111a.cs.columbia.edu/~af2728/hw2.php
  • http://w4111e.cs.columbia.edu/~af2728/hw2.php
  • http://w4111h.cs.columbia.edu/~af2728/hw2.php
  • http://w4111i.cs.columbia.edu/~af2728/hw2.php
  • http://w4111l.cs.columbia.edu/~af2728/hw2.php
  • http://w4111d.cs.columbia.edu/~af2728/hw2.php

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91520104
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in DBMS

Data mining assignment -in this assignment you are asked to

Data Mining Assignment - In this assignment you are asked to explore the use of neural networks for classification and numeric prediction. You are also asked to carry out a data mining investigation on a real-world data ...

Questionsuppose a prolog database exists that gives

Question: Suppose a Prolog database exists that gives information about states and capital cities. Some cities are big, others small. Some states are eastern, others are western. a. Write a query to find all the small ca ...

Question we can sort a given set of n numbers by first

Question : We can sort a given set of n numbers by first building a binary search tree containing these numbers (using TREE-INSERT repeatedly to insert the numbers one by one) and then printing the numbers by an inorder ...

Query 1 the bookstore has decided to keep track of the

Query 1: The bookstore has decided to keep track of the vendors' information. In order to do this, one new table will be added to the database. The schema for this table, as related to the existing tables, is the followi ...

Question talk about the importance of pulling data from

Question : Talk about the importance of pulling data from worksheets into a single sheet also the ways excel could be a solution to a complex challenge. The response must be typed, single spaced, must be in times new rom ...

Suppose that you have designed a database for morgan

Suppose that you have designed a database for Morgan Importing that has the following tables: EMPLOYEE (EmployeeID, LastName, FirstName, Department, Phone, Fax, EmailAddress) STORE (StoreName, City, Country, Phone, Fax, ...

This is a starting out with visual basic programming

This is a starting out with visual basic programming problem, meaning its a basic programming nothing advanced. Question: Add a linq statement to the combo box text-changed event to dispaly the city field of the selected ...

You can work on this assignment individually or in a group

You can work on this assignment individually or in a group of 2. If you are working in a group please establish a group in Assignment 2 Group on Canvas In this assignment you are asked to explore the use of neural networ ...

Question 1 describe 1nf 2nf 3nf2 explain why 4nf is a

Question: 1: Describe 1NF, 2NF, 3NF. 2: Explain why 4NF is a normal form more desirable than BCNF. The response must be typed, single spaced, must be in times new roman font (size 12) and must follow the APA format.

Question 1 what isdata-manipulation language dml there are

Question: 1. What isData-Manipulation Language (DML)? There are four types of access in DML, explain each one. 2. Assume we have a Library Database consists of the following relations: author(author_id, first_name, last_ ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As