Write each query here, and run it on a real Postgres database in your browser.
Write the condition for each question, and get back exactly the videos that pass it.
Scenario
Simplified's team is checking its videos before it records more. Each question it asks is one query, and you write it.
Simplified keeps its videos in a table called videos, with each one's chapter and its length in seconds.
Can you write the condition for each question the team asks?
Each step runs your query on this table, in real Postgres.
First, the team wants its longer videos.
Send back the title and seconds of every video longer than 110 seconds.
Now the team wants the short ones: every video of 95 seconds or less.
Send back their title and seconds.
Chapter 3 was recorded last week, so the team checks the others first.
Send back the title of every video that isn't in chapter 3.
The team wants the videos of chapter 1 that run for less than 130 seconds.
Send back their title.
Send back the title and seconds of every video from 100 to 120 seconds, both ends included.
Write the range the short way.
The team wants every video in chapter 2, and also any video of exactly 150 seconds.
An assistant wrote this query for it.
Predict what it sends back, run it, then fix it.
The team records three videos again: Servers, Queries and results and Generated ids.
Send back their title and seconds, using one list of titles.
Not yet: a video right on the number is missing, or shouldn't be there
> and < leave the number itself out.
>= and <= let it pass.
syntax error at or near ","
BETWEEN takes AND between its two numbers, not a comma: BETWEEN 100 AND 120.
column "servers" does not exist
Each title in the list is text, so each goes in its own single quotes.
Each step passes once its query sends back the right rows. Then mark the lab complete to unlock the next lesson.