Answered step by step
Verified Expert Solution
Question
1 Approved Answer
customer ( customerID , firstName, lastName, city ) supplier ( supplierID , name, street, city, phone, email ) product ( productID , name, unit _
customercustomerID firstName, lastName, city
suppliersupplierID name, street, city, phone, email
productproductID name, unitprice, stock, supplierID
customerordercustomerID productID, odate, quantity Assuming a PostgreSQL environment, write SQL code for each of the following:
a Give the details of products with a stock of less than
marks
b Give the details of products whose name contains kettle
marks
c For each supplierID, give the number of products supplied.
marks
d List the details of products supplied by supplier whose name is GalaxyAssume all tables have been created except for customerorder Create the
table customerorder The data type for customerID and productID is
VARCHAR
Ensure you choose appropriate data types for the other columns, and you
specify the primary key and any foreign keys. marks
f Delete records in the customerorder that dates up to the end of December
marks
g Create a view containing the productID, its name and stock. marks
h Give user john permission to access read only the view created in part g
You may assume that user john has already been created.
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