Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Create a view named MAJOR CUSTOMER. It consists of the customer number, name,

ID: 3687727 • Letter: 1

Question


1. Create a view named MAJOR CUSTOMER. It consists of the customer number, name, bal. ance, credit limit, and rep number for every customer whose credit limit is $10,000 or less
a. Write and execute the CREATEVIEW command to create the MAJOR_CUSTOMERview.
b. Write and execute the command to retrieve the customer number and name of each      customer in the MAJOR CUSTOMER view with a balance that exceeds the credit limit.
c. Write and execute the query that the DBMS actually executes.
d. Does updating the database through this view create any problems? If so, what are they? If not, why not?

Explanation / Answer

Answer:


a)

CREATE VIEW MAJOR_CUSTOMERview
AS
SELECT CustomerNum, CustomerName, Balance, CreditLimit, repnNumber
FROM Customer where CreditLimit <= 10000

SELECT * FROM MAJOR_CUSTOMERview

b.
SELECT CustomerNum,CustomerName FROM MAJOR_CUSTOMERview where
Balance > CreditLimit

d. No problems will be created. Because,the query defining the view, doesn't contains SET or DISTINCT operators, a GROUP BY clause, or a group function.