Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 4 Consider the following relational schema for a company: Customer (CustCode, CustName, CustAdress, Payment_Method) Product (ProductCode, ProductName, UnitPrice, UnitCost) CustomerOrder (OrderNo, CustCode, ProductCode, QtyOrdered)

QUESTION 4 Consider the following relational schema for a company: Customer (CustCode, CustName, CustAdress, Payment_Method) Product (ProductCode, ProductName, UnitPrice, UnitCost) CustomerOrder (OrderNo, CustCode, ProductCode, QtyOrdered) The primary keys are underlined. Write SQL queries to answer the following: (a) Create Customer, Product, and Order tables from the relational schema described above. Select appropriate data types for each attribute. Remember to set the primary and foreign keys. (10 marks) (b) List the Customers Name and address where the addresses contain the word Cork. (3 marks) (c) List the order Number and Net (Price of an item less its cost) profit of each Customer Order. (8 marks) (d) Write the statement to update the unit price of ProductCode S106 by 2. (4 marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

6. Identify the belly of the whale in Raiders of the Lost Ark.

Answered: 1 week ago

Question

7. Define cultural space.

Answered: 1 week ago

Question

8. Describe how cultural spaces are formed.

Answered: 1 week ago