Categories
Database Management

“Exploring Oracle Apex: A Comprehensive Guide to Building Web Applications”

The first part of the assignment will be done using Oracle Apex, adding screenshots for each question and finishing all parts as there are multiple. 

Categories
Database Management

SQL Queries for Movies Database SQL Movie Queries

It’s very easy. I have provided everything you needed. Just need to write sql queries that’s all. 
Movies
Write SQL queries to answer questions about a database of movies.
Getting Started
Download and unzip movies.zip from the blackboard.
Import into MysqL
2A. Under Server Administration on the Home window select the server instance you want to restore database to (Create New Server Instance if doing it first time).
2B. Click on Manage Import/Export
2C. Click on Data Import/Restore on the left side of the screen.
2D. Select Import from Self-Contained File radio button (right side of screen)
2E. Select the path of .sql
2F. Click Start Import button at the right bottom corner of window. (Note: It would take some time to import the file).
Now, you can use MYSQL Workbench to write queries.
Understanding
Notice that the movies table has an id column that uniquely identifies each movie, as well as columns for the title of a movie and the year in which the movie was released. The people table also has an id column, and also has columns for each person’s name and birth year.
Movie ratings, meanwhile, are stored in the ratings table. The first column in the table is movie_id: a foreign key that references the id of the movies table. The rest of the row contains data about the rating for each movie and the number of votes the movie has received on IMDb.
Finally, the stars and directors tables match people to the movies in which they acted or directed. (Only principal stars and directors are included.) Each table has just two columns: movie_id and person_id, which reference a specific movie and person, respectively.
The challenge ahead of you is to write SQL queries to answer a variety of different questions by selecting data from one or more of these tables.
Specification
For each of the following problems, you should write a single SQL query that outputs the results specified by each problem. Your response must take the form of a single SQL query, though you may nest other queries inside of your query. You should not assume anything about the ids of any particular movies or people: your queries should be accurate even if the id of any particular movie or person were different. Finally, each query should return only the data necessary to answer the question: if the problem only asks you to output the names of movies, for example, then your query should not also output the each movie’s release year.
You’re welcome to check your queries’ results against IMDb itself, but realize that ratings on the website might differ from those in the database, as more votes might have been cast since we downloaded the data!
Q1 write a SQL query to list the titles of all movies released in 2008.
Your query should output a table with a single column for the title of each movie.
Q2, write a SQL query to determine the birth year of Emma Stone.
Your query should output a table with a single column and a single row (plus optional header) containing Emma Stone’s birth year.
You may assume that there is only one person in the database with the name Emma Stone.
Q3 write a SQL query to list the titles of all movies with a release date on or after 2018, in alphabetical order.
Your query should output a table with a single column for the title of each movie.
Movies released in 2018 should be included, as should movies with release dates in the future.
Q4 write a SQL query to list the titles and release years of all Harry Potter movies, in chronological order.
Your query should output a table with two columns, one for the title of each movie and one for the release year of each movie.
You may assume that the title of all Harry Potter movies will begin with the words “Harry Potter”, and that if a movie title begins with the words “Harry Potter”, it is a Harry Potter movie.
Q5, write a SQL query to determine the number of movies with an IMDb rating of 10.0.
Your query should output a table with a single column and a single row (plus optional header) containing the number of movies with a 10.0 rating.
Q6, write a SQL query to determine the average rating of all movies released in 2012.
Your query should output a table with a single column and a single row (plus optional header) containing the average rating.
Q7, write a SQL query to list all movies released in 2010 and their ratings, in descending order by rating. For movies with the same rating, order them alphabetically by title.
Your query should output a table with two columns, one for the title of each movie and one for the rating of each movie.
Movies that do not have ratings should not be included in the result.
Q8, write a SQL query to list the names of all people who starred in Toy Story.
Your query should output a table with a single column for the name of each person.
You may assume that there is only one movie in the database with the title Toy Story.
Q9, write a SQL query to list the names of all people who starred in a movie released in 2004, ordered by birth year.
Your query should output a table with a single column for the name of each person.
People with the same birth year may be listed in any order.
No need to worry about people who have no birth year listed, so long as those who do have a birth year are listed in order.
If a person appeared in more than one movie in 2004, they should only appear in your results once.
Q10, write a SQL query to list the names of all people who have directed a movie that received a rating of at least 9.0.
Your query should output a table with a single column for the name of each person.
Q11, write a SQL query to list the titles of the five highest rated movies (in order) that Chadwick Boseman starred in, starting with the highest rated.
Your query should output a table with a single column for the title of each movie.
You may assume that there is only one person in the database with the name Chadwick Boseman.
Q12, write a SQL query to list the titles of all movies in which both Johnny Depp and Helena Bonham Carter starred.
Your query should output a table with a single column for the title of each movie.
You may assume that there is only one person in the database with the name Johnny Depp.
You may assume that there is only one person in the database with the name Helena Bonham Carter.
Q13, write a SQL query to list the names of all people who starred in a movie in which Kevin Bacon also starred.
Your query should output a table with a single column for the name of each person.
There may be multiple people named Kevin Bacon in the database. Be sure to only select the Kevin Bacon born in 1958.
Kevin Bacon himself should not be included in the resulting list.
Q14
write a SQL query to find all the movies that are better than the average ratings.
Q15 
Write a SQL query to find the average rating for each co-stars.
Q 16 
Write a SQL query that returns the highest and the lowest rated movies for each actor, sort by the difference in ratings.