Problem 3: Sentences (100 pts)
There are two pairs of siblings that have the same size. Create a table that contains a row with a string for each of these pairs. Each string should be a sentence describing the siblings by their size.
-- Sentences about siblings that are the same size
CREATE TABLE sentences AS
SELECT "REPLACE THIS LINE WITH YOUR SOLUTION";
Each sibling pair should appear only once in the output but in any order, and siblings should be listed in alphabetical order (e.g. "barack plus clinton..."
instead of "clinton plus barack..."
), as follows:
sqlite> select * from sentences;
The two siblings, barack plus clinton have the same size: standard
The two siblings, abraham plus grover have the same size: toy
Hint1: First, create a helper table containing each pair of siblings. This will make comparing the sizes of siblings when constructing the main table easier.
Hint2: If you join a table with itself, use
AS
within theFROM
clause to give each table an alias.Hint3: In order to concatenate two strings into one, use the
||
operator.