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

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
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.
With names and structures, enzyme name, intermediate names, cofactor name (but not their structure) describe the...
With names and structures, enzyme name, intermediate names, cofactor name (but not their structure) describe the anaplerotic reaction of the Krebs cycle. Describe the regulation of the enzyme, and the rationale behind this scheme
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...
SQL statmen: List the first name, the last name, the address, the city, the state, the...
SQL statmen: List the first name, the last name, the address, the city, the state, the branchNo, and the email of agents working in the branch B005 and having email addresses ending with extensions different from .com.
write a regular expression that will, using capturing groups, find: last name first name middle name...
write a regular expression that will, using capturing groups, find: last name first name middle name (if available) student ID rank home phone work phone (if available) email program (i.e., S4040) grade Replace the entire row with comma-delimited values in the following order: first name,middle name,last name,program,rank,grade,email,student ID,home phone,work phone Example substitution string for the first student Jane,V,Quinn,S4040,SO,B,[email protected],Q43-15-5883,318-377-4560,318-245-1144,Y
C++ Write a program that asks a teacher to input a student’s first name, last name,...
C++ Write a program that asks a teacher to input a student’s first name, last name, and four test scores. The program should find the average of the four test scores and should then write the following information to a file named “students.txt” last_name first_name average A student's first name of “XX” should be used as a sentinel value and no numeric grades less than 0 or greater than 100 should be accepted.  The program should then read the information in...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT