Anda di halaman 1dari 1

1.

Create the following table with the suitable datatypes:


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)

Here underlined column name means Primary Key

2. Create a sequence for orderId of Orders table and write an insert statement using
the sequence.
3. Change the datatype of MealType and increase it with 5 more character than
whatever you have already kept.
4. Now I want order table to have OrderPrice as well. Alter the table to have one
more column as OrderPrice.
5. write one query which retrieves the data from tables for the row in which
memberID=10 and lastName=Kumar (insert the data appropriately first)

Anda mungkin juga menyukai