Question: 1) Write SQL commands to create the type and type body for an object type called TotalSales that represents the sales of a bookstore. The

1) Write SQL commands to create the type and type body for an object type called TotalSales that represents the sales of a bookstore. The TotalSales type should have: three attributes called book, unitPrice and quantity with respective datatype; and one method called getTotalSales that returns the sales (as DECIMAL). The TotalSales type may not have subtypes.

2) Write an SQL statement to create table BookSales that has TWO (2) attributes: salespersonName of type varchar and SaleAmount of type TotalSales.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!