Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To be done on SQL** Create the tables identified below in the following order: Campus (CampusID, CampusName, Street, City, State, Zip, Phone, CampusDiscount) Position (PositionID,

To be done on SQL**

Create the tables identified below in the following order:

Campus (CampusID, CampusName, Street, City, State, Zip, Phone, CampusDiscount) Position (PositionID, Position, YearlyMembershipFee) Members (MemberID, LastName, FirstName, CampusAddress, CampusPhone, CampusID, PositionID, ContractDuration) FK CampusID --> Campus(CampusID) PositionID --> Position(PositionID) Prices (FoodItemTypeID, MealType, MealPrice) FoodItems (FoodItemID, FoodItemName, FoodItemTypeID) FK FoodItemTypeID --> Prices(FoodItemTypeID) Orders (OrderID, MemberID, OrderDate) FK MemberID --> Members(MemberID) OrderLine (OrderID, FoodItemsID, Quantity) FK OrderID --> Orders(OrderID) FoodItemsID --> FoodItems(FoodItemID)

STRUCTURE NOTES: Use the proper naming convention for your constraints: Example: Constraint TableName_FieldName_ConstraintID (Campus_CampusID_PK) Set up the Primary Keys for each table with Constraints listed. Note: The OrderLine Table has a composite Primary Key Add Your Foreign Keys for each table with your Constraints listed. Set up your Sequence for the Prices table ONLY. Remember to follow the proper naming convention. The Sequence will be used in the insert commands to add your auto numbering into the Primary Key (FoodItemTypeID) fields. Name the Sequence "Prices_FoodItemID_Seq" Make the Data Types for all the Primary Keys and their corresponding Foreign Keys Varchar2(5). Make the Data Type for OrderDate Varchar2(25). (we won't worry about the date format, way too complicated for what we are doing). Make the Data Types for the MealPrice and YearlyMembershipFee Decimal, 7 digits maximum with 2 digits to the right of the decimal place, so that we can perform calculations on them. Make the Data Types for ContractDuration, and Quantity Integer with 3 digits maximum for calculation purposes. Make the Data Type for CampusDiscount Decimal, 2 digits maximum with 2 digits to the right of the decimal place.

1.

List the OrderID, Order Date, Faculty Member's Name, Campus Name, each FoodItem that makes up a given order, the type of meal, cost of the meal, quantity ordered and the total line total (calculated field and column alias). Sort by Order IDs in descending order.

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

6. Explain how to train managers to coach employees.

Answered: 1 week ago

Question

5. Tell how job experiences can be used for skill development.

Answered: 1 week ago

Question

4. Explain the characteristics of successful mentoring programs.

Answered: 1 week ago