Introduction to SQL
  • AI Chat
  • Code
  • Report
  • Beta
    Spinner

    Introduction to SQL

    Here you can access the books table used in the course.

    Take Notes

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

    Add your notes here

    Unknown integration
    DataFrameavailable as
    df
    variable
    This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
    Unknown integration
    DataFrameavailable as
    books
    variable
    -- Add your own queries here
    SELECT year, count(genre) filter (where genre = 'Fiction') as fiction_count,
    count(genre) filter (where genre = 'Non Fiction') as nonfiction_count,
    count(genre) as total_genre
    FROM books
    group by year
    having year > 0
    
    
    This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

    Explore Datasets

    Use the books table to explore the data and practice your skills!

    • Select only the title column.
    • Alias the title column as book_title.
    • Select the distinct author names from the author column.
    • Select all records from the table and limit your results to 10.