Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started