Data-Driven Decision Making in SQL
  • AI Chat
  • Code
  • Report
  • Beta
    Spinner

    Data-Driven Decision Making in SQL

    Here you can access every table used in the course. To access each table, you will need to specify the movies schema in your queries (e.g., movies.movies for the movies table, and movies.customers for the customers table).

    Take Notes

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

    Add your notes here

    Công ty cho thuê phim viễn tưởng - “MovieNow”:

    • Cung cấp nền tảng để chiếu phim trực tuyến. Khách hàng có thể thuê 1 bộ phim trong 24 giờ.
    • Lưu trữ thông tin bổ sung như: thể loại, diễn viên chính, etc.
    • Lưu trữ thông tin khách hàng và xếp hạng của phim.

    Cấu trúc dữ liệu của MovieNow:

    • Bảng ‘customers’: thông tin về khách hàng, cột customer_id là khóa; date_account_start là ngày tài khoản được tạo.
    • Bảng ‘movies’: thông tin về các bộ phim, cột movie_id là khóa.
    • Bảng ‘renting’: thông tin về cho thuê và điểm xếp hạng (1-10).
    • Bảng ‘actors’: lưu thông tin của diễn viên trong phim.
    • Bảng ‘actsin’: cho biết diễn viên nào xuất hiện trong bộ phim nào.

    Mỗi bảng sẽ có khóa tương ứng với tên bảng.

    Database

    Unknown integration
    DataFrameavailable as
    actors
    variable
    SELECT *
    FROM movies.customers;
    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
    df
    variable
    SELECT *
    FROM movies.movies;
    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
    df1
    variable
    SELECT *
    FROM movies.renting;
    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
    df2
    variable
    SELECT *
    FROM movies.actors;
    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
    df3
    variable
    SELECT *
    FROM movies.actsin;
    This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

    Nháp

    Unknown integration
    DataFrameavailable as
    df43
    variable
    SELECT *
    FROM movies.movies;
    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
    df45
    variable
    SELECT genre, ROUND(AVG(runtime), 2)
    FROM movies.movies
    GROUP BY genre;
    This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.