61A Lecture 32
Announcements
Joining Tables
Reminder: John the Patriotic Dog Breeder E isenhower F illmore A braham D elano G rover B arack C linton H erbert 4
Reminder: John the Patriotic Dog Breeder E isenhower select "abraham" as parent, "barack" as child union F illmore select "abraham" , "clinton" union select "delano" , "herbert" union select "fillmore" , "abraham" union A braham D elano G rover select "fillmore" , "delano" union select "fillmore" , "grover" union B arack C linton H erbert select "eisenhower" , "fillmore"; 4
Reminder: John the Patriotic Dog Breeder E isenhower create table parents as select "abraham" as parent, "barack" as child union F illmore select "abraham" , "clinton" union select "delano" , "herbert" union select "fillmore" , "abraham" union A braham D elano G rover select "fillmore" , "delano" union select "fillmore" , "grover" union B arack C linton H erbert select "eisenhower" , "fillmore"; 4
Reminder: John the Patriotic Dog Breeder Parents: E isenhower Parent Child create table parents as abraham barack select "abraham" as parent, "barack" as child union F illmore abraham clinton select "abraham" , "clinton" union delano herbert select "delano" , "herbert" union fillmore abraham select "fillmore" , "abraham" union A braham D elano G rover fillmore delano select "fillmore" , "delano" union fillmore grover select "fillmore" , "grover" union B arack C linton H erbert select "eisenhower" , "fillmore"; eisenhower fillmore 4
Joining Two Tables 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union A 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union select "barack" , "short" union A B 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union select "barack" , "short" union select "clinton" , "long" union A B C 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union select "barack" , "short" union select "clinton" , "long" union select "delano" , "long" union A D B C 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union E select "barack" , "short" union select "clinton" , "long" union select "delano" , "long" union select "eisenhower" , "short" union A D B C 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union E select "barack" , "short" union select "clinton" , "long" union select "delano" , "long" union select "eisenhower" , "short" union F select "fillmore" , "curly" union A D B C 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union E select "barack" , "short" union select "clinton" , "long" union select "delano" , "long" union select "eisenhower" , "short" union F select "fillmore" , "curly" union select "grover" , "short" union A D G B C 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union E select "barack" , "short" union select "clinton" , "long" union select "delano" , "long" union select "eisenhower" , "short" union F select "fillmore" , "curly" union select "grover" , "short" union select "herbert" , "curly"; A D G B C H 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union E select "barack" , "short" union select "clinton" , "long" union select "delano" , "long" union select "eisenhower" , "short" union F select "fillmore" , "curly" union select "grover" , "short" union select "herbert" , "curly"; create table parents as select "abraham" as parent, "barack" as child union A D G select "abraham" , "clinton" union ...; B C H 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union E select "barack" , "short" union select "clinton" , "long" union select "delano" , "long" union select "eisenhower" , "short" union F select "fillmore" , "curly" union select "grover" , "short" union select "herbert" , "curly"; create table parents as select "abraham" as parent, "barack" as child union A D G select "abraham" , "clinton" union ...; Select the parents of curly-furred dogs B C H 5
Joining Two Tables Two tables A & B are joined by a comma to yield all combos of a row from A & a row from B create table dogs as select "abraham" as name, "long" as fur union E select "barack" , "short" union select "clinton" , "long" union select "delano" , "long" union select "eisenhower" , "short" union F select "fillmore" , "curly" union select "grover" , "short" union select "herbert" , "curly"; create table parents as select "abraham" as parent, "barack" as child union A D G select "abraham" , "clinton" union ...; Select the parents of curly-furred dogs B C H select parent from parents, dogs where child = name and fur = "curly"; 5
Recommend
More recommend