Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Consider the following schema: Product(maker, model, type) PC(model, speed, ram, hd, price) Laptop(model, speed, ram, hd, screen, price) Printer(model, color, type, price) The key

1. Consider the following schema:

Product(maker, model, type)

PC(model, speed, ram, hd, price)

Laptop(model, speed, ram, hd, screen, price)

Printer(model, color, type, price)

The key fields are underlined. Write the following queries in SQL:

a. Find the maker of the color printer which has the lowest price among all the color printers (assume coloris a Boolean typed attribute).

b. Find the maker who makes the most number of products.

c. Find the models of PCs which have the highest price among all the PCs of the same speed, the same ram, and the same hd.

2. Consider the following relational schema, where the primary keys are underlined,

Students(sid, sname, address, department_id)

Courses(cid, cname, department_id)

Grades(sid, cid, semester, year, grade)

Write the following query in SQL.

Give all students who selected Database course (cname = Database) in Spring 2018 a 20 percent grade raise (oh, yeah!).

Pictures links if it helps :

https://ibb.co/easuCS

https://ibb.co/jLwbRn

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 Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

Does the duty to accommodate apply in this case?

Answered: 1 week ago