Test 2 Sample note: additional questions may also feature in the text
Given a database (see next slide), how do you add/change rows in one or more tables
There is a new faculty member named “Dr. Martha Henderson.” She is a new Assistant Professor in the Accounting department and her office is 535 Alter Hall. Her phone number is Her address is
INSERT INTO facultystaff (FacStaffID,FirstName,LastName, ShortTitle, OfficeNumber, BuildingCode, Phone, , FacultyCode, StaffCode) VALUES (109, “Martha”, “Henderson”,”Dr.”,535,3,” ”,” Insert into facultystaff_department (DeptFacKey, FacStaffID, DepartmentID, Primary Appointment) VALUES (5, 109, 3, 1)
Given a star schema (see next slide) – What is the fact in this schema? – Which one is the fact table?
Hotels Hotel_id Country_code Hotel_name Hotel_address Hotel_city Hotel_zipcode Average_star_rating Guests Guest_number Guest_firstname Guest_lastname Guest_address Guest_city Guest_zipcode Guest_ Time TimeID Month Day Year Reservation Reservation_id Hotel_id Guest_number Time_id Smoking_code (Average) room_rate Number_days Smoking Smoking_code Smoking_YN
Choose fields to draw a Pivot Table to answer the following questions (see next slide): – Which products sold most in January in zip code – Which product did 20 year old customers buy most in Northeast Region?
BMW Dealerships Dimension 1: Location There are locations: Philadelphia, Atlanta, San Francisco, New York Dimension 2: Product There are three models of cars: X5, 5 series, 7 series Dimension 3: Time There are three time periods: October 2011, November 2011, December 2011 Fact: Quantity and Revenue
Represent this information in the data cube? What does the shaded area represent?