Knowee
Questions
Features
Study Tools

SELECT * from movies WHERE imdb_rating > 7.95 + (select stddev(imdb_rating) from movies) OR imdb_rating < 7.95 - (select stddev(imdb_rating) from movies)

Question

SELECT * from movies WHERE imdb_rating > 7.95 + (select stddev(imdb_rating) from movies) OR imdb_rating < 7.95 - (select stddev(imdb_rating) from movies)

🧐 Not the exact question you are looking for?Go ask a question

Solution

To answer the question step by step:

  1. Start by calculating the standard deviation of the imdb_rating column in the movies table. This can be done using the following query:

    SELECT stddev(imdb_rating) FROM movies;
    
  2. Once you have the standard deviation value, you can use it to calculate the upper and lower bounds for the imdb_rating. Add the standard deviation to 7.95 to get the upper bound, and subtract it from 7.95 to get the lower bound.

  3. Now, you can use these upper and lower bounds in the main query to filter the movies. The query will select all columns from the movies table where the imdb_rating is either greater than the upper bound or less than the lower bound.

    SELECT * FROM movies WHERE imdb_rating > 7.95 + (SELECT stddev(imdb_rating) FROM movies) OR imdb_rating < 7.95 - (SELECT stddev(imdb_rating) FROM movies);
    
  4. Execute the query to retrieve the desired results.

This problem has been solved

Similar Questions

Which Sql Statement Retrieves Films With Rental Rates Between 2 And 5?

Consider the following database:MOVIE(id,title,yr)ACTOR(id,name)CASTING(movieid,actorid)Identify the SQL command which will return the titles of all 1959 Marilyn Monroe films.Option 1. The following SQL...SELECT title FROM movie,casting,actor WHERE movieid = movie.id<> AND name = 'Marilyn Monroe' ; Option 2. The following SQL...SELECT title FROM movie,actor WHERE name = 'Marilyn Monroe' AND yr = 1959 ; Option 3. The following SQL...SELECT title FROM movie,casting,actor WHERE movieid = movie.id AND actor.id = actorid AND name = 'Marilyn Monroe' AND yr = 1959 ; Option 4. The following SQL...SELECT title FROM movie,casting,actor WHERE movieid = movie.id AND actor.id = actorid AND movie.yr = casting.yr AND name = 'Marilyn Monroe' AND yr = 1959 ; Question 5Select one:a.Option 1b.Option 2c.Option 3d.Option 4

Not Boring MoviesX city opened a new cinema, many people would like to go to this cinema. Thecinema also gives out a poster indicating the movies’ ratings and descriptions.Please write a SQL query to output movies with an odd numbered ID and adescription that is not 'boring'. Order the result by rating.For example, table cinema:idmoviedescriptionrating1Wargreat 3D8.92Sciencefiction8.53Irishboring6.24Ice SongFantasy8.65House cardInteresting9.1For the example above, the output should be:idmoviedescriptionrating5House cardInteresting9.11Wargreat 3D8.9Optionsselect movie, description, ratingfrom cinemawhere id % 2 != 1 and description <> 'boring'order by rating asc;select id, movie, descriptionfrom moviewhere rating % 2 = 1 and description <> 'boring'order by rating;select id, movie, description, ratingfrom cinemawhere id % 2 = 1 and description <> 'boring'order by rating desc;select id, movie, description, ratingfrom ratingwhere id % 2 = 1 and description <> 'boring'order by cinema desc;

Write SQL query considering below schema of databaseFilm(film_id, title, legth, rental_rate), Actor(film_id, actor_id, first_name, last_name)Category(film_id, rating, language, release_year)Create tables with Primary Key, foreign key constraints in given schemas.i.Give the name of actors whose actor id is 23.ii.Give the title of films whose id is between 25 and 40.iii.Give the name of actor whose last name contains Kapoor.iv.Give the title of film which was released in 2022.v.Give the name of actors played who have role in film title ‘Chhello divas’

List titles of films with 10 or more actors playing the act. Sort the output on descending order of actors per film.will the below query will provide you the correct result SELECT  title as Film_Name, count(actor_id) as Total_ActorsFROM filmINNER JOINfilm_actorONfilm.film_id=film_actor.film_idGroup by  film.film_idhaving  Total_Actors > 9ORDER BYTotal_Actors DESC, titlea.Trueb.False

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.