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;
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe46938a4-41c8-4e0a-8bdd-05339203ff7b%2Fcbb78179-561f-4aec-af97-85f2a9f56c04%2F6r2tyqg_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Oracle 12c: SQL](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![A Guide to SQL](https://www.bartleby.com/isbn_cover_images/9781111527273/9781111527273_smallCoverImage.gif)
![Oracle 12c: SQL](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![A Guide to SQL](https://www.bartleby.com/isbn_cover_images/9781111527273/9781111527273_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781285196145/9781285196145_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781305627482/9781305627482_smallCoverImage.gif)