Question

In: Computer Science

Return the full names (first and last) of actors with “SON” in their last name, ordered...

  1. Return the full names (first and last) of actors with “SON” in their last name, ordered by their first name.
  2. Find all the addresses where the second address (i.e. address2) is not empty (i.e., contains some text), and return these second addresses sorted.
  3. Your Professor wants you to find all the information from rental table associated with those staff (or staff ID) whose address ID is 4 (in staff table). Professor wants you to use Sub-query function.
  4. Your Professor wants you to find out the first name and district of all the customers whose district ends on “ia” – such as California.
  5. Your Professor wants you to find all the payment-related information of customers other than the customer whose ID is 1.
  6. Your Professor wants you to find out the full name (i.e. combine the first and last name) and the district of all the customers that live in a district called California.
  7. Your Professor wants you to find the title, film id and category name (such as action) of those movies that are of the action genre (i.e. category name is Action).
  8. Return the first and last names of actors who played in a film involving a “Crocodile” and a “Shark”, along with the release year of the movie, sorted by the actors’ last names.
  9. Find all the film categories in which there are between 55 and 65 films. Return the names of these categories and the number of films per category, sorted by the number of films.
  10. In how many film categories is the average difference between the film replacement cost and the rental rate larger than 17?

Solutions

Expert Solution

  1. Select Concat(first_name," ", last_name) as "Full Name" from actor where last_name LIKE '%SON%' order by first_name;
  2. Select * from Address where Address2 IS NOT NULL order by Address2;
  3. Select * from Rental where staff_id IN( Select staff_id from Staff where address_id = 4);
  4. Select first_Name , District from Customer inner join Address on Customer.Address_id = Address.Address_id  where District like '%ia';
  5. Select * from Payment where Customer_ID != 1;
  6. Select Concat(first_Name," ", last_Name) as "Full Name"  , District from Customer inner join Address on Customer.Address_id = Address.Address_id  where District = 'California';
  7. Select Title , Category.Name from Film , Film_Category, Category where Category.Name = 'Action';
  8. Select first_name, last_name , release_year, title from film inner join  film_actor on film.film_id = film_actor.film_id inner join actor on film_actor.actor_id = actor.actor_id where Description like '%Crocodile%' and Description like '%Shark%' order by last_name;
  9. Select Category.name , Count(film_id) as Number_of_Films from Film_Category inner join Category on Film_Category.category_id = Category.category_id  group by Category.Name having Count(film_id) between and 65 order by Count(film_id);
  10. Select Category.name , Avg(replacement_cost) - Avg(rental_rate) from film_category inner join film on film_category.film_id = film.film_id inner join Category on film_category.category_id = Category.category_id group by Category.name having Avg(replacement_cost) - Avg(rental_rate) > 17;

Do ask if any doubt. Please up-vote.


Related Solutions

1. Write a query in SQL to find the full name of the “Actors” who appeared...
1. Write a query in SQL to find the full name of the “Actors” who appeared in the movie titled Star Wars (using JOIN ). 2.Write a SQL query to find the movie Title that has received Lowest rating from reviewers, but whose actors have received an award for their contribution in movie. (Expected Output: Fantastic Beasts and Where to Find Them) 3.Write a SQL query that display the list of genres, Number of movies in that genre grouped by...
Using Perl; Part 1: Allow the user to enter a full name in the “first last”...
Using Perl; Part 1: Allow the user to enter a full name in the “first last” format Print just the first name Print just the last name Print the name in “last, first” format Print the entire name out in all capital letters Use a single print statement to print out the first name on one line and the last name on the next line. There should be 5 print statements generating 6 lines of output. Part 2: Enter a...
List customer id, customer full name (Last name, full name, state) for those customers that have...
List customer id, customer full name (Last name, full name, state) for those customers that have ordered more than once. List customers (order id, customer id, and customer last name) that had more than 2 -- products in their order. Order your result based on customer id followed by order id SQL SERVER DATABASE
1. a) Name the following (with full names): (a) The amino acid without a primary amino...
1. a) Name the following (with full names): (a) The amino acid without a primary amino group (b) An amino acid that could form a salt bridge with an Asp residue in a protein interior: (c) The amino acid that contains sulfur that doesn’t make disulfide bonds: (d) Name one of the three amino acids that have hydroxylated R groups: e) Draw the structure of the tetrapeptide SKYP at a pH of 5, making sure you include the structures of...
The class Contact, shown below, which hold first names, last names, and mobile numbers. Using the...
The class Contact, shown below, which hold first names, last names, and mobile numbers. Using the built-in Java ArrayList<Contact> contacts Write a method     public static boolean contains(ArrayList<Contact> list, String firstOrLastName) public class Contact { private int mobileNumber; private String firstName; private String lastName; public int getMobileNumber() { return mobileNumber; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public Contact(int mobile, String first, String last) { mobileNumber = mobile; firstName = first; lastName...
Write a function that takes a person’s first and last names as input and (a) uses...
Write a function that takes a person’s first and last names as input and (a) uses lists to return a list of the common letters in the first and last names (the intersection). (b) uses sets to return a set that is the intersection of the characters in the first and last names. (c) uses sets to return the set that is the symmetric difference between the first and last names. please write in python program
11. First and Last Design a program that asks the user for a series of names...
11. First and Last Design a program that asks the user for a series of names (in no particular order). After the final person's name has been entered, the program should display the name that is first alphabetically and the name that is last alphabetically. For example, if the user enters the names Kristin, Joel, Adam, Beth, Zeb, and Chris, the program would display Adam and Zeb. #Sentinel value is DONE SENTINEL = "DONE" ls = [] prompt = "Enter...
You will ask the end user to type their first name and their last name and...
You will ask the end user to type their first name and their last name and store it on separate string variables, you will ask for the gender, you will then concatenate both strings into a third string variable. You will salute the end user as Mr. or Ms depending on the gender and last you will display the initials of the end user. (You must use methods of the string class in this lab)
Creating a list/tuple 3.Given a list of tuples containing student first names and last names e.g....
Creating a list/tuple 3.Given a list of tuples containing student first names and last names e.g. (“John”, “Doe”) that represents a class. Ask the user for a students first and last name and check if that student is a member of the class.
Write the pseudocode that prompts the user for their first and last name. Display the first...
Write the pseudocode that prompts the user for their first and last name. Display the first initial of their first name and their last name to the user. Ask the user to input a phone number. The program checks which part of Colorado a phone number is from using the values below. If the second digit of the phone number is one of the below digits, print the phone number and which part of Colorado it is from. If none...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT