COMPSCI 186 Study Guide - Midterm Guide: External Sorting, Sequential Access, Unique Key

17 views13 pages
8 Jan 2019
School
Professor

Document Summary

Cs 186/286 spring 2018 midterm 1: do not turn this page until instructed to start the exam, you should receive 1 single-sided answer sheet and a 13-page exam packet, all answers should be written on the answer sheet. For the following questions, we consider the following schema: Create table player( pid integer primary key, name text. Create table relationship( pid1 integer references player(pid), pid2 integer references player(pid), type text, time timestamp, Players may be part of a relationship (with the type being either friend or enemy ) with other players. A single row in the relationship table represents the start of a relationship between two players. The most current relationship between players a and b is the row in relationship with a, b, and the latest timestamp. Relationships are always mutual: if there is a row with pid1=3 and pid2=4, there will be a corresponding row with the same type/time and with pid1=4 and pid2=3.