Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 4 Provided is the shorthand representation of a database for a customer's ordering system, use this to answer the questions below. Customer(CustomerKey, Firstname, Secondname,

QUESTION 4 Provided is the shorthand representation of a database for a customer's ordering system, use this to answer the questions below. Customer(CustomerKey, Firstname, Secondname, address, Mobile, Creditlimt, activeflag) Product(Productid, Description, Quantityinstock,price) Orders(Ordernumber, CustomerKey, Productid, Quantityordered, price, Order_date) The primary keys are underlined. Write SQL queries to answer the following: (a) Write CREATE TABLE statement for each table in the relational schema described above. Select appropriate data types for each attribute. Remember to set the primary and foreign keys. (10 marks) (b) Write an SQL statement that will increase all the product prices by 10%. (5 marks) (c) Write an SQL statement which update the order price on the order table, with this new price, if the order_date was this current year. (5 marks) (d) Write an SQL statement that will delete customer(s) that have their active flag set to 0. What are the special considerations when deleting tables?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions