Question: Using DB Browser for SQlite queries that will retrieve the relevant information from the database, e . g . SELECT A 2 . actor _

Using DB Browser for SQlite queries that will retrieve the relevant information from the database, e.g.
SELECT A2.actor_id, A2.first_name, A2.last_name, COUNT(*) AS tot FROM actor A1, actor A2, film_actor FA1, film_actor FA2
WHERE A1.first_name = 'STAN' AND A1.last_name = 'LAUREL' AND A1.actor_id = FA1.actor_id
AND FA1.film_id = FA2.film_id AND FA2.actor_id = A2.actor_id AND A1.actor_id <> A2.actor_id
GROUP BY A2.actor_id, A2.first_name, A2.last_name ORDER BY tot DESC;
Table 1: The film table provides information about a film. A film is related to language. There are two relationships in the ER diagram, one for an original language the film was recorded in and the other one for the language it is available in. Both relationships are modelled in the table below by means of the corresponding foreign keys.
Table 2: The category table describes different categories of films.
Table 3: Each film may belong to multiple categories. This relationship is represented by the
film_category table. Each row of this table links a film to a category.
Questions
1. What is the first name of the customer who lives in the same city as MATTIE HOFFMAN?
2. To find the median, you need to order numbers and find the middle value. What is the median of film cast size?
3. What category of films is most expensive to replace on average? Provide the name of such category.
4. Which country (from the ones listed in the country table) has no customers?
5. How much money was earned by renting the film HOBBIT ALIEN?
6.*** Find all customers who rented a film whose title contains the name of the country they live in. Out of these customers, what is the last name of the customer who returned such movie most recently.
7.*** What is the title of the most frequently rented Sports movie in Russian Federation?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!