CFTROU
SQL
SQL Lessons
Lesson 1 / 5Fetching and capping data

SELECT * + LIMIT

Get every column from a table, then cap how many rows come back.

Why this is used

SELECT * is how you explore a new table. It shows you everything at once. Pair it with LIMIT right away so you don't accidentally load thousands of rows. These two almost always go together when you're getting familiar with unfamiliar data.

How it works

SELECT *(every column)
FROM businesses;(every row)
businesses
brand_namerevenue
SKIMS1100
Good American201
818 Tequila60
Kylie Cosmetics380
Yeezy565
✓ 5 rows · all columns returned

Tasks

1Task 1
2Task 2
3Task 3

Your task

Get every column from the businesses table, just the first 3 rows.

SQL editor

⌘ Enter

①The data

②Result