WorksheetsTable relationships, SQL and Pandas joins
Total questions: 10
Worksheet time: 5mins
What's your Valentine mood?
What sort of relationships can we have between tables?
One-to-one
Many-to-many
One-to-many
None of the above
INNER JOIN returns only those joined records where there is match in the condition we specify
True
False
RIGHT JOIN says 'keep all the records in the left table, adding in any matching records from the right table'.
True
False
FULL OUTER JOIN combines the results of both left and right outer joins and returns all (matched or unmatched) rows from the tables on both sides of the join
True
False
Which following code creates an empty database in ipython
%%sql
CREATE TABLE animals (
...
);
%sql posgresql://
sql sqlite://
%sql sqlite://
The pandas package contains functions to perform all of the joins you can have in SQL, which of these are True:
merge() for combining data on common columns or indices
merge() for combining DataFrames across rows or columns
concat() for combining data on common columns or indices
.join() for combining data on a key column or an index
What argument allows you to specify the type of merging with pandas? i.e. for a Full Outer Join
on='outer'
type='outer'
how='outer'
left_on='outer'
Which key declares that an index in one table is related to that in another?
primary
secondary
foreign
cross
How did you do in your test?
