Question

Need MySql commands for Use a UNION statement. Display the address ID, address, and district from...

Need MySql commands for

  1. Use a UNION statement. Display the address ID, address, and district from the address table where the district is California or Alberta. Display the address ID, address, and district only from the address table where the address contains Jol.

  2. Display the language ID and name from the language table and the film ID from the film table. Display all languages whether they have an associated film or not. Order results by language ID in ascending order.

  3. List the actor ID, their first and last name of all actors and a count of the films they have done. Result set should be sorted descending by the actor’s first name and new column should be named FilmCount. The objective you are to show here is how to use a subquery in an expression.

  1. Show the customer ID, their first and last name, and the date of their last payment (name this column RecentPayment) of all those that are inactive customers sorted descending by last name and then ascending by first name. The objective you are to show here is how to use a subquery in an expression.

  2. List the film ID, title, and description from the film_text table for those films that have Zero Cage as the actor. Order your results set by the film description. The objective you are to show here is how to use a subquery in a filter.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. SELECT address ID, address, district

FROM address WHERE district = "California" OR district = "Alberta"

UNION

SELECT  address ID, address, district

FROM address WHERE address = "Jol" ;

2.

SELECT language.language ID, language.name,film.film ID

FROM language,film

ORDER BY language ID ASC;

The later questions will need the name of the columns of each table, primary key and foreign key description to write executable SQL query.

Add a comment
Know the answer?
Add Answer to:
Need MySql commands for Use a UNION statement. Display the address ID, address, and district from...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • USING SQL 4. Show me the maximum rental duration and minimum rental duration from the film...

    USING SQL 4. Show me the maximum rental duration and minimum rental duration from the film table. Name the columns MaxRentalDuration and MinRentalDuration respectively. 5. List the actor ID, last name, and first name of each actor and the count of films (name column FilmCount) each is in for those actors who acted in more than 35 films. Order results by FilmCount. (Hint: You will need to use GROUP BY and HAVING in your query.)

  • SQL Queries – in this assignment you will be asked to create several SQL queries relating...

    SQL Queries – in this assignment you will be asked to create several SQL queries relating to the Sakila database that we installed in class. You may freely use DBeaver to create these queries, but I will expect your solution to show me the SQL code to answer or complete the tasks below. Write a query that produces the last name, first name, address, district, and phone number for every customer in the customer table. (You don’t need to include...

  • Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display...

    Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the employee number, last name, email address, title, and department name of each employee whose job title ends in the word “ASSOCIATE.” Sort the output by department name and employee title Problem 36, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the number of products within each base and type combination, sorted by base and then by type...

  • Write just one SQL statement per question 1. Display Publisher ID, Publisher Name and Total Number...

    Write just one SQL statement per question 1. Display Publisher ID, Publisher Name and Total Number of Books published by each publisher. 2. List Publisher ID, Publisher Name, Title and price of the highest priced book. 3. List Order ID, Customer ID, Order Date, and Number of Items in each order. Order the data by Customer ID in ascending (A – Z) order. 4. Display Title, Category and Profit for each book in the children and computer category. 5. Display...

  • 1) Write SQL to return the first and last name of all actors with a first...

    1) Write SQL to return the first and last name of all actors with a first name of "ADAM" (use the ACTOR table) 2) Write SQL with the LIKE operator to return addresses that are in the "Dhaka" district and have street addresses that do not contain the character sequence "Loop". You can return all information from the ADDRESS table that matches this criteria. 3) Write SQL with the BETWEEN and ORDER BY clause to return the payments in descending...

  • CIS336: Lab 6: Group Functions and Subqueries I desperatly need help with this MYSQL lab. Any...

    CIS336: Lab 6: Group Functions and Subqueries I desperatly need help with this MYSQL lab. Any help is appreciated. I don't need the outputs, I just need working codes. 1.Write a query to display the description of a product and the number of orders for that product. Sort the display by the description. 2.Redo the previous problem but this time just display those product names and the number of sales that have more than 3 sales. 3. Use a SubQuery...

  • (TCO 7) Write a JOIN to display the instructor first and last names and the course...

    (TCO 7) Write a JOIN to display the instructor first and last names and the course description for the course the instructor is teaching Student Instructor Zipcode PK Student ID PK Instructor ID PK Zip Salutation First Name Last Name Street Address Phone Employer Registration Date Salutation First_Name Last_Name Street Address City State FK1 Zip FK1 Zip Section PK Section ID Course Course Section_Num Enrollment Start Date_Time Location PK Course ID PK,FK1 Section ID PK,FK2 Student ID Capacity FKI |...

  • You work for a DVD rental company. Your manager has asked you to pull some data on the company, i...

    You work for a DVD rental company. Your manager has asked you to pull some data on the company, its inventory, and customers. You will complete this by developing and running SQL queries. Initialize Your Database (NOTE: If you alreody did this in Project 1, you do not need to do this step again): 1. Download RentalCompany.sql from Doc Sharing. Run the script to create tables and data. You should not receive errors. There may be a few warnings, but...

  • In this assignment you will combine HTML, PHP, and SQL in order to create a web...

    In this assignment you will combine HTML, PHP, and SQL in order to create a web form that allows a manager to add films to the sakila database. You will also create a method to allow the manager to view a list of all films along with their related information, and a list of actors in the movies. Task 1 Create an initial HTML page titled manager.html with 2 buttons. The first button will be labeled “View Films”, and the...

  • Can you please write the MySQL Query sentences for the following items below? For example: SELECT...

    Can you please write the MySQL Query sentences for the following items below? For example: SELECT * FROM employees; Generate a list of salespeople sorted descending by hire date. Show the ID, first name, last name, hire date, and salary for each salesperson. Generate a list of customers whose last name begins with the letter “M.” Show the first and last names of these customers. Sort the list of customers descending by last name. C. Generate a list of customers...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT