Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. Create the tables identified below in the following order: CampusName, Street, City, State, Zip, Phone, CampusDiscount) Campus Position (PositionID, Position, YearlyMembershipFee) Members (MemberID, LastName,
3. Create the tables identified below in the following order: CampusName, Street, City, State, Zip, Phone, CampusDiscount) Campus Position (PositionID, Position, YearlyMembershipFee) Members (MemberID, LastName, FirstName, CampusAddress, CampusPhone, CampusID, PositionID, ContractDuration) FK CampusID> Campus(CampusID) PositionID Position (PositionID) Prices (FoodItemTypeID, MealType, Meal Price) FoodItems (FoodItemID, FoodItemName, FoodItemTypeID) FK FoodItemTypeID > Prices(FoodItemTypeID) FK MemberID > Members(MemberID) FK OrderID Orders(OrderID) Orders (OrderID, MemberID, OrderDate) OrderLine (OrderID, FoodItemsID, Quantity) 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 Step 2 Use the Insert Into Command to add your data to each table. Add data to your primary tables first and then to your secondary tables. Also, remember to use the sequence code with your insert statement to add the auto number value to each primary key field
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