2019-10-01

Oct 2 In-Class Exercise Thread.

Post your solutions to the Oct 2 In-Class Exercise to this thread.
Best,
Chris
Post your solutions to the Oct 2 In-Class Exercise to this thread. Best, Chris
2019-10-02

-- Oct 2 In-Class Exercise Thread
{A}+ = {A} {B}+ = {B} {C}+ = {C} {A, B}+ = {A, B} {A, C}+ = {A, C} {B, C}+ = {B, C} {A, B, C}+ = {A, B, C}
{A}+ = {A} {B}+ = {B} {C}+ = {C} {A, B}+ = {A, B} {A, C}+ = {A, C} {B, C}+ = {B, C} {A, B, C}+ = {A, B, C}

-- Oct 2 In-Class Exercise Thread
Professor Class Title
Pollett CS157A Intro to databases
Pollett CS157B Databases management systems


Recipe Ingredient amount
sauteed scalops garlic 1
sauteed scalops scalops 10
Mushrooms a la creme creme 50ml
Mushrooms a la creme mushrooms 200g
(Edited: 2019-10-02)
{| |- | Professor || Class || Title |- | Pollett || CS157A || Intro to databases |- | Pollett || CS157B || Databases management systems |} <br> <br> {| |- | Recipe || Ingredient || amount |- | sauteed scalops || garlic || 1 |- | sauteed scalops || scalops || 10 |- | Mushrooms a la creme || creme || 50ml |- | Mushrooms a la creme || mushrooms || 200g |}

-- Oct 2 In-Class Exercise Thread
R(name, makeModel, year)
 
(Person1, Toyota Prius, 2012)
(Person1, Nissan Leaf, 2012)
(Person2, Toyota Prius, 2010)
(Person2, Nissan Leaf, 2010)
(Edited: 2019-10-02)
R(name, makeModel, year) (Person1, Toyota Prius, 2012) (Person1, Nissan Leaf, 2012) (Person2, Toyota Prius, 2010) (Person2, Nissan Leaf, 2010)

-- Oct 2 In-Class Exercise Thread
 Joseph|Nguyen|CS157a 
 Joseph|Nguyen|CS156
 Joseph|Tran|CS157a
 Joseph|Tran|CS156
 If we know Joseph we don't know the second column (A -\-> B)
(Edited: 2019-10-02)
Joseph|Nguyen|CS157a Joseph|Nguyen|CS156 Joseph|Tran|CS157a Joseph|Tran|CS156 If we know Joseph we don't know the second column (A -\-> B)

-- Oct 2 In-Class Exercise Thread
Product(Brand, Product Name, Color)
(Adidas, T-shirt, Blue)
(Adidas, Shorts, Blue)
(Adidas, T-shirt, black)
(Adidas, Shorts, black)
(Edited: 2019-10-02)
Product(Brand, Product Name, Color) (Adidas, T-shirt, Blue) (Adidas, Shorts, Blue) (Adidas, T-shirt, black) (Adidas, Shorts, black)

-- Oct 2 In-Class Exercise Thread
for R(A,B,C) => R(Class Code, Class Title and Year, Class Time)
Class Code Class Title and year Class Time
1432 Computer Networks (2018) M/W 9-10am
1432 Operating Systems (2019) M/W 9-10am
1121 Intro to Database (2018) F 6-9pm
1121 Data Structures (2019) F 6-9pm
(Edited: 2019-10-02)
for R(A,B,C) => R(Class Code, Class Title and Year, Class Time) {| |- ! Class Code !! Class Title and year !! Class Time |- | 1432 || Computer Networks (2018) || M/W 9-10am |- | 1432 || Operating Systems (2019) || M/W 9-10am |- | 1121 || Intro to Database (2018) || F 6-9pm |- | 1121 || Data Structures (2019) || F 6-9pm |}

-- Oct 2 In-Class Exercise Thread
  R(A, B, C)
  (Student1, Class1, Room1)
  (Student1, Class2, Room2)
  (Student1, Class1, Room3)
  (Student1, Class2, Room4)
A multivalue determines B. Yet, A does not fix B.
(Edited: 2019-10-02)
R(A, B, C) (Student1, Class1, Room1) (Student1, Class2, Room2) (Student1, Class1, Room3) (Student1, Class2, Room4) A multivalue determines B. Yet, A does not fix B.

-- Oct 2 In-Class Exercise Thread
This is an example of a multi-valued dependency (MVD) because the name of company (attribute A) fixes a list of possible field (attribute B), including food and cosmestics
A | B |C
Ali | Food | 4.0
Ali | Cosmetics | 2.3
Ali | Food | 3.0
Ali | Cosmetics | 4.3
(Edited: 2019-10-02)
This is an example of a multi-valued dependency (MVD) because the name of company (attribute A) fixes a list of possible field (attribute B), including food and cosmestics A | B |C Ali | Food | 4.0 Ali | Cosmetics | 2.3 Ali | Food | 3.0 Ali | Cosmetics | 4.3

-- Oct 2 In-Class Exercise Thread
R(colA, colB, colC) R(person, house type, purchase date)
 (tina, condo, 1928)
 (paul, townhouse, 2849)
 (tina, townhouse, 1928)
 (paul, condo, 2849)
(Edited: 2019-10-02)
R(colA, colB, colC) R(person, house type, purchase date) (tina, condo, 1928) (paul, townhouse, 2849) (tina, townhouse, 1928) (paul, condo, 2849)
[ Next ]
X