FreshersQuestion 40 of 50
Sum of Movie Budgets
Problem
A film historian is writing a book on the financial history of cinema. They need to find the total budget spent across all movies in the database. Find the sum of the budget_millions of all movies in the movies table.
Database Schema
Table: movies
id(INT): Unique identifier for the movie.title(VARCHAR): Title of the movie.genre(VARCHAR): Genre of the movie.release_year(INT): The year the movie was released.director(VARCHAR): Director of the movie.budget_millions(INT): Movie budget in millions of dollars.
Table: actors
id(INT): Unique identifier for the actor.name(VARCHAR): Name of the actor.birth_year(INT): Birth year of the actor.primary_movie_id(INT): Foreign key referencing the movie they are best known for.
Table: ratings
id(INT): Unique identifier for the rating.movie_id(INT): Foreign key referencing the movie.source(VARCHAR): The source of the rating (e.g., Critics, Audience).score(DECIMAL): Numeric score.
Try It
Loading playground environment...