Write the SQL statement to define a view for cheap computers, the view has model, speed, ram, hd, and price information for computers (PCs or Laptops) with price < $990. Write an SQL query using the above view to find manufacturers of cheap computers. Use ALTER TABLE to add a CHECK constraint to enforce that speed of a laptop must be greater than 2.1. Use ALTER TABLE to add a CHECK constraint to enforce that the type of a printer must be ‘ink-jet’, ‘laser’, or 'bubble-jet'. Use ALTER TABLE to add a CHECK constraint to enforce that the price of a PC must be at least $500, and at most $4000

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter4: Analyzing And Charting Financial Data
Section: Chapter Questions
Problem 3.15CP
icon
Related questions
Question

DROP TABLE Printer CASCADE CONSTRAINTS;
DROP TABLE Laptop CASCADE CONSTRAINTS;
DROP TABLE PC CASCADE CONSTRAINTS;
DROP TABLE Product CASCADE CONSTRAINTS;

CREATE TABLE Product ( maker VARCHAR(20),
model INT PRIMARY KEY,
type VARCHAR(10)
);

CREATE TABLE PC ( model INT PRIMARY KEY,
speed NUMBER (4,2),
ram INT,
hd INT,
price NUMBER (7,2)
);

CREATE TABLE Laptop ( model INT PRIMARY KEY,
speed NUMBER (4,2),
ram INT,
hd INT,

 

screen NUMBER (3,1),
price NUMBER (7,2)
);

CREATE TABLE Printer ( model INT PRIMARY KEY,
color CHAR (6),
type VARCHAR(10),
price NUMBER (7,2)
);

Write the SQL statement to define a view for cheap computers, the view has model,
speed, ram, hd, and price information for computers (PCs or Laptops) with price < $990.

Write an SQL query using the above view to find manufacturers of cheap computers.

Use ALTER TABLE to add a CHECK constraint to enforce that speed of a laptop must
be greater than 2.1.

Use ALTER TABLE to add a CHECK constraint to enforce that the type of a printer
must be ‘ink-jet’, ‘laser’, or 'bubble-jet'.

Use ALTER TABLE to add a CHECK constraint to enforce that the price of a PC must
be at least $500, and at most $4000

Expert Solution
steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning