error whenever I try to import it into MySQL using this code  SELECT store_id AS Store, COUNT(*) AS Num_Customers FROM sakila.customer GROUP BY store_id ORDER BY store_id DESC, COUNT(*) DESC; SELECT film.title AS Title, rental.rental_date AS Rental_Date, rental.return_date AS Return_Date FROM sakila.customer JOIN sakila.rental ON customer.customer_id = rental.customer_id JOIN sakila.inventory ON rental.inventory_id = inventory.inventory_id JOIN sakila.film ON inventory.film_id = film.film_id WHERE customer.first_name = 'JO' AND customer.last_name = 'FOWLER' ORDER BY rental.rental_date ASC; REPLACE VIEW top_rental_films AS CREATE OR SELECT film.title AS FilmTitle, COUNT(rental.rental_id) AS Num_Rentals, AVG(payment.amount) AS Avg_Amt FROM sakila.film JOIN sakila.inventory ON film.film_id = inventory.film_id JOIN sakila.rental ON inventory.inventory_id = rental.inventory_id JOIN sakila.payment ON rental.rental_id = payment.rental_id GROUP BY film.film_id ORDER BY AVG(payment.amount) DESC LIMIT 10;

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter6: Additional Database Objects
Section: Chapter Questions
Problem 6HOA: A new table has been requested to support tracking automated emails sent to customers. Create the...
icon
Related questions
Question

Hello I am receiving this error whenever I try to import it into MySQL using this code

 SELECT store_id AS Store, COUNT(*) AS Num_Customers
FROM sakila.customer
GROUP BY store_id
ORDER BY store_id DESC, COUNT(*) DESC;
SELECT film.title AS Title, rental.rental_date AS Rental_Date, rental.return_date AS Return_Date
FROM sakila.customer
JOIN sakila.rental ON customer.customer_id = rental.customer_id
JOIN sakila.inventory ON rental.inventory_id = inventory.inventory_id
JOIN sakila.film ON inventory.film_id = film.film_id
WHERE customer.first_name = 'JO' AND customer.last_name = 'FOWLER'
ORDER BY rental.rental_date ASC;
REPLACE VIEW top_rental_films AS
CREATE OR SELECT film.title AS FilmTitle, COUNT(rental.rental_id) AS Num_Rentals, AVG(payment.amount) AS Avg_Amt
FROM sakila.film
JOIN sakila.inventory ON film.film_id = inventory.film_id
JOIN sakila.rental ON inventory.inventory_id = rental.inventory_id
JOIN sakila.payment ON rental.rental_id = payment.rental_id
GROUP BY film.film_id
ORDER BY AVG(payment.amount) DESC
LIMIT 10;

Could someone help me out with this?

Error
Static analysis:
2 errors were found during analysis.
1. Unexpected keyword. (near "VIEW" at position 8)
2. Unrecognized statement type. (near "VIEW" at position 8)
SQL query: Copy →
REPLACE VIEW top_rental_films AS CREATE OR SELECT film.title AS FilmTitle, COUNT(rental.rental_id) AS Num_Rentals, AVG(payment.amount) AS Avg_Amt FROM sakila.film JOIN sakila.inventory ON film.film_id = inventory.film_id JOIN sakila.rental ON inventory.inventory_id = rental.inventory_id JOIN sakila.payment ON rental.rental_id = payment.rental_id GROUP BY film.film_id
ORDER BY AVG(payment.amount) DESC LIMIT 10;
MySQL said: Ⓡ
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'top_rental_films AS
CREATE OR SELECT film.title AS FilmTitle, COUNT (rental.rent' at line 1
Transcribed Image Text:Error Static analysis: 2 errors were found during analysis. 1. Unexpected keyword. (near "VIEW" at position 8) 2. Unrecognized statement type. (near "VIEW" at position 8) SQL query: Copy → REPLACE VIEW top_rental_films AS CREATE OR SELECT film.title AS FilmTitle, COUNT(rental.rental_id) AS Num_Rentals, AVG(payment.amount) AS Avg_Amt FROM sakila.film JOIN sakila.inventory ON film.film_id = inventory.film_id JOIN sakila.rental ON inventory.inventory_id = rental.inventory_id JOIN sakila.payment ON rental.rental_id = payment.rental_id GROUP BY film.film_id ORDER BY AVG(payment.amount) DESC LIMIT 10; MySQL said: Ⓡ #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'top_rental_films AS CREATE OR SELECT film.title AS FilmTitle, COUNT (rental.rent' at line 1
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Multiple table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning