Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started