AssignmentComplete & ContinueEnable fullscreen1.Write a SQL query to find the actors who were cast in the movie 'Annie Hall'. Return actor first name, last name and role.2.From the following tables, write a SQL query to find the director who directed a movie that casted a role for 'Eyes Wide Shut'. Return director first name, last name and movie title.3.Write a SQL query to find who directed a movie that casted a role as ‘Sean Maguire’. Return director first name, last name and movie title.4.Write a SQL query to find the actors who have not acted in any movie between 1990 and 2000 (Begin and end values are included.). Return actor first name, last name, movie title and release year.
Question
AssignmentComplete & ContinueEnable fullscreen1.Write a SQL query to find the actors who were cast in the movie 'Annie Hall'. Return actor first name, last name and role.2.From the following tables, write a SQL query to find the director who directed a movie that casted a role for 'Eyes Wide Shut'. Return director first name, last name and movie title.3.Write a SQL query to find who directed a movie that casted a role as ‘Sean Maguire’. Return director first name, last name and movie title.4.Write a SQL query to find the actors who have not acted in any movie between 1990 and 2000 (Begin and end values are included.). Return actor first name, last name, movie title and release year.
Solution
To answer these questions, I'll assume that you have the following tables:
movieswith columnsmovie_id,title,release_year,director_iddirectorswith columnsdirector_id,first_name,last_nameactorswith columnsactor_id,first_name,last_nameroleswith columnsrole_id,actor_id,movie_id,role_name
- SQL query to find the actors who were cast in the movie 'Annie Hall':
SELECT a.first_name, a.last_name, r.role_name
FROM actors a
JOIN roles r ON a.actor_id = r.actor_id
JOIN movies m ON r.movie_id = m.movie_id
WHERE m.title = 'Annie Hall';
- SQL query to find the director who directed a movie that casted a role for 'Eyes Wide Shut':
SELECT d.first_name, d.last_name, m.title
FROM directors d
JOIN movies m ON d.director_id = m.director_id
JOIN roles r ON m.movie_id = r.movie_id
WHERE r.role_name = 'Eyes Wide Shut';
- SQL query to find who directed a movie that casted a role as ‘Sean Maguire’:
SELECT d.first_name, d.last_name, m.title
FROM directors d
JOIN movies m ON d.director_id = m.director_id
JOIN roles r ON m.movie_id = r.movie_id
WHERE r.role_name = 'Sean Maguire';
- SQL query to find the actors who have not acted in any movie between 1990 and 2000:
SELECT a.first_name, a.last_name, m.title, m.release_year
FROM actors a
LEFT JOIN roles r ON a.actor_id = r.actor_id
LEFT JOIN movies m ON r.movie_id = m.movie_id
WHERE m.release_year < 1990 OR m.release_year > 2000;
Please note that these queries are based on assumptions about your database schema. You may need to adjust them to fit your actual schema.
Similar Questions
cAN YOU GIVE EXAMPLEOF HOW THE ASSIGNMENT SHOULD LOOK LIKE
Plagiarizing an assignment can result in:Question 29Select one:a.Failing the assignmentb.Failing the coursec.Getting suspendedd.Getting expellede.All of the above
Researchers have used assignment problems to help them address decision-making problems.a.Trueb.Falsec.Can't sayd.None of these
To see a quick overview of an assignment, click on the blue arrow on the far right-hand side of the screen.Group startsTrue or FalseTrue, selectedFalse, unselected
Assignment 1 - 30 MarksDue before 5pm, Friday 9th August, 2024Your answers to all questions should be submitted to myUni as a single R markdown file with the file suffix .Rmd. [1 mark]A compiled html, MS Word or PDF document is not required, but will be generated when marking.[1 mark]Ensure your submitted file includes the assignment cover sheet text (text version) [5 marks], Add appropriate text and/or comments making your thoughts clear to any collaborators. [2 marks]Obtaining Your DataAll data is in the file available here. Please extract the complete set of files, and use the file labelled with your student id. Do not change the name of the file you obtain, but continue to work with this file as a1xxxxxx.csv.Please note that R Markdown will require this file to be in the same directory as the markdown file itself is in. Your file can be uploaded to your VM using the Upload button in the RStudio Files pane. We strongly suggest creating a directory called Assignment_1 on your VM and placing both your RMarkdown and your file in this directory.Tasks in RLoad your allocated file removing all comments, blank rows and changing any encoded missing values to NA. [4 marks]Extract the CellType and Treatment information from the sample names, placing them in separate columns after converting from wide to long form. [4 marks]Create a correctly labelled boxplot of your dCt values for each of the four conditions. [4 marks]Conduct a simple linear regression on your data using the model dCt~CellType + Treatment + CellType:Treatment and include the model output from the function summary() without interpretation. [2 marks]Research questionsPlease answer on the same *.Rmd file as the first section, using a new markdown heading for this section.Two common file types are .csv and .tsv. What is the difference between the two, and can you suggest a function for loading a .tsv file into R? [3 marks]Three types of message commonly seen in the R Console are 1) error messages, 2) warnings and 3) general messages. Briefly describe the importance of each type of message and what information they are conveying. [3 marks]What is the difference between an integer and a floating point value? Floats are sometimes called “doubles”. What does this mean? [2 marks]
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.