1. Use the following table to answer the questions below. Table name: Products Column Role Data Type Length Constraint Name P_ID P_Name Stores the ID of a product Stores the name of a product P_entryDate Stores the entry date of a |product Stores the expiry date of a product Number Varchar2 Primary key 25 Date Cannot be null P_Expiry date should be greater than P_entryDate Cannot be null P_Expiry Date P_Price Stores the price of a product Number 32 a Write a SQL query that displays the number of products that will expire in the year 2021 | a. Write in SQL a query that displays the ids of the most expensive products c Create a view named 'ProductDetails' to hold all the details of products whose names start with 'DELL' a their prices are between 200 and 500 Omani Rials

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter8: Sql Functions And Procedures
Section: Chapter Questions
Problem 6CAT
icon
Related questions
icon
Concept explainers
Question
1. Use the following table to answer the questions below:
Table name: Products
Column
Data Type Length
Constraint
Role
Name
Stores the ID of a product
P ID
P_Name
Primary key
Number
Stores the name of a
Varchar2
25
product
P_entryDate Stores the entry date of a
product
Date
Cannot be null
P_Expiry
Stores the expiry date of a
product
Date
P_Еxpiry date
should be greater
than P_entryDate
P_Price
Stores the price of a product Number
3,2
Cannot be null
a. Write a SQL query that displays the mumber of products that will expire in the year 2021
b. Write in SQL a query that displays the ids of the most expensive products
c. Create a view named ProductDetails' to hold all the details of products whose names start with 'DELL' and
their prices are between 200 and 500 Omani Rials
Transcribed Image Text:1. Use the following table to answer the questions below: Table name: Products Column Data Type Length Constraint Role Name Stores the ID of a product P ID P_Name Primary key Number Stores the name of a Varchar2 25 product P_entryDate Stores the entry date of a product Date Cannot be null P_Expiry Stores the expiry date of a product Date P_Еxpiry date should be greater than P_entryDate P_Price Stores the price of a product Number 3,2 Cannot be null a. Write a SQL query that displays the mumber of products that will expire in the year 2021 b. Write in SQL a query that displays the ids of the most expensive products c. Create a view named ProductDetails' to hold all the details of products whose names start with 'DELL' and their prices are between 200 and 500 Omani Rials
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Query Syntax
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
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning