Skip to content

Course Notes

Use this workspace to take notes, store sample queries, and build your own interactive cheat sheet!

You will need to connect your SQL cells to an integration to run a query.

  • You can use a sample integration from the dropdown menu. This includes the Course Databases integration, which contains tables you used in our SQL courses.
  • You can connect your own integration by following the instructions provided here.

Note: When using sample integrations such as those that contain course data, you have read-only access. You can run queries, but cannot make any changes such as adding, deleting, or modifying the data (e.g., creating tables, views, etc.).

Take Notes

Add notes here about the concepts you've learned and SQL cells with code you want to keep.

Add your notes here

Spinner
Queryas
query
variable
-- A sample query for you to replace!
SELECT 
    *
FROM books

Will this save?

WHERE clause doesn't work when applying on an aggregate value. Instead we must use HAVING

Spinner
DataFrameas
df
variable
SELECT 
	title, year
FROM
	books
WHERE year > 2014
GROUP BY
	year, title;

The code below does the same thing using HAVING

Spinner
DataFrameas
df1
variable
SELECT title, year
FROM books
GROUP BY title, year
HAVING year > 2014;

When you want to use GROUP by, you must use HAVING when wanting to use certain criterion