Database Systems: Design, Implementation, & Management
11th Edition
ISBN: 9781285196145
Author: Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 8, Problem 3P
Program Plan Intro
“UNION” operator:
The UNION set operator is used to combine the output of two or more than two queries and produce a result. The produced result contains unique values.
Syntax: QUERY UNION QUERY;
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Given the table customers which contains columns customer_id, first name, last name, and state, and a table named addresses that contains columns address_id,
customer id, state, city, zip, and street. Write a query that returns all customers last names with their state and zip. Assume that customer id in the addresses table is
foreign key referencing customer_id in the customers table.
Insert into table customerPayment, columns customerOrderld and total result set
returned from query
a. Select columns id and total from table customerOrder where column
orderStateld is equal to subquery
i. (select column id from table orderState where column state is equal to
"Payment received")
Write Test Case 1 as a SQL join query to do the following
a. Select using concatenation of columns firstName and lastName from table
www
customer as Customer
b. Select customerOrderId from table customerPayment as "Customer Order"
c. Select description from table product as Product
d. Select total from table customerOrder as “Product Total"
e. Join tables customerPavment, customerOrder, customer, product
f. Order by column lastName from table customer
Alter table purchaseOrder add column total as data type decimal size 7,2, not null,
default value of 0.0
Write a query to get the number of different types of jobs available in the university table.
Write a query to get all unique first names that start with the letter S from the employees table. Output the names in all upper case. Sort the results in ascending order.
Chapter 8 Solutions
Database Systems: Design, Implementation, & Management
Ch. 8 - What is a cross join? Give an example of its...Ch. 8 - What three join types are included in the outer...Ch. 8 - Using tables named T1 and T2, write a query...Ch. 8 - Prob. 4RQCh. 8 - Prob. 5RQCh. 8 - Prob. 6RQCh. 8 - Prob. 7RQCh. 8 - What does it mean to say that SQL operators are...Ch. 8 - Prob. 9RQCh. 8 - Prob. 10RQ
Ch. 8 - Prob. 11RQCh. 8 - Prob. 12RQCh. 8 - Prob. 13RQCh. 8 - Given the employee information in Question 11,...Ch. 8 - Prob. 15RQCh. 8 - Prob. 16RQCh. 8 - Prob. 17RQCh. 8 - Prob. 18RQCh. 8 - What string function should you use to list the...Ch. 8 - Prob. 20RQCh. 8 - Prob. 21RQCh. 8 - Prob. 22RQCh. 8 - Prob. 23RQCh. 8 - Prob. 24RQCh. 8 - Prob. 1PCh. 8 - Insert the data into the tables you created in...Ch. 8 - Prob. 3PCh. 8 - Prob. 4PCh. 8 - Prob. 5PCh. 8 - Prob. 6PCh. 8 - Prob. 7PCh. 8 - Prob. 8PCh. 8 - Prob. 9PCh. 8 - Modify the CUSTOMER table to include two new...Ch. 8 - Prob. 11PCh. 8 - Prob. 12PCh. 8 - Prob. 13PCh. 8 - Prob. 14PCh. 8 - Prob. 15PCh. 8 - Prob. 16PCh. 8 - Write a trigger to update the customer balance...Ch. 8 - Write a procedure to delete an invoice, giving the...Ch. 8 - Prob. 19PCh. 8 - Prob. 20PCh. 8 - Prob. 21PCh. 8 - Prob. 22PCh. 8 - Prob. 23PCh. 8 - Prob. 24PCh. 8 - Prob. 25PCh. 8 - Prob. 26PCh. 8 - Prob. 27PCh. 8 - Create a trigger named trg_line_total to write the...Ch. 8 - Create a trigger named trg_line_prod that...Ch. 8 - Create a stored procedure named prc_inv_amounts to...Ch. 8 - Create a procedure named prc_cus_balance_update...Ch. 8 - Modify the MODEL table to add the attribute and...Ch. 8 - Prob. 33PCh. 8 - Modify the CHARTER table to add the attributes...Ch. 8 - Write the sequence of commands required to update...Ch. 8 - Write the sequence of commands required to update...Ch. 8 - Write the command required to update the...Ch. 8 - Write the command required to update the...Ch. 8 - Write the command required to update the...Ch. 8 - Prob. 40PCh. 8 - Create a trigger named trg_char_hours that...Ch. 8 - Create a trigger named trg_pic_hours that...Ch. 8 - Create a trigger named trg_cust_balance that...Ch. 8 - Alter the DETAILRENTAL table to include a derived...Ch. 8 - Alter the VIDEO table to include an attribute...Ch. 8 - Update the VID_STATUS attribute of the VIDEO table...Ch. 8 - Alter the PRICE table to include an attribute...Ch. 8 - Prob. 48CCh. 8 - Prob. 51C
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Repeat Exercise 6, but this time use the EXISTS operator in your query.arrow_forwardFrom the following tables,write a query to get.the histogram of specializes of the unique physicians who have done the procedures but never did prescribe anythingarrow_forwardWrite a query that returns the Name of ALL Customers (based on CUS_FNAME and CUS_LNAME in CUSTOMER table, call this CUSTOMER_NAME), Phone number of ALL Customers (based on CUS_AREACODE and CUS_PHONE in CUSTOMER table, call this CUSTOMER_PHONE), for those haven’t flied before (based on the record in CHARTER table).arrow_forward
- how do i write a join query between the derived table and the orders table to return the Orders withe the maximum order date for each customer create table Orders( OrderID int primary key, CustomerName varchar (200), OrderDate varchar (200), ShipDate varchar (200), ); insert into Orders(OrderID,CustomerName,OrderDate,ShipDate) values(112,'Cheyenne Wyatt','Apr 5, 2021','Apr 17, 2021')insert into Orders(OrderID,CustomerName,OrderDate,ShipDate) values(123,'Zorita Willis','Nov 22, 2021','Nov 27, 2021') insert into Orders(OrderID,CustomerName,OrderDate,ShipDate) values(245,'Wang Mcclure','Aug 9, 2021','Aug 16, 2021') insert into Orders(OrderID,CustomerName,OrderDate,ShipDate) values(456,'Althea Valdez','Dec 22, 2021','Dec 25, 2021') insert into Orders(OrderID,CustomerName,OrderDate,ShipDate) values(789,'Quentin Larsen','May 7, 2022','May 12, 2022')arrow_forwardWrite a query to display the patron ID, first and last name of all patrons that have never checked out any book. Sort the result by patron last name and then first name. (See the figure below for the output) Write a query to display the patron ID and the average number of days that patron keeps books during a checkout. Limit the results to only patrons who have at least three checkouts. Sort the results in descending order by the average days the book is kept. (See the figure below for the output)arrow_forwardWrite a query that returns all customers listed in the orders table who placed orders on the most recently recorded day, return the OrderID, the CustomerID and the OrderDate .arrow_forward
- To add new customer to the customer table, the right query is: insert into customer new (4, 'sa 'beirut', lebanon') insert new customer (4, 'sami', 'beirut', lebanon') insert new customer values (4, 'sami', 'beirut', lebanon') insert into customer values (4, 'sami', 'beirut', lehanon')arrow_forwardWrite an appropriate SQL query to determine if there are any students that are not registered for any modules.Sample results:STUDENT_ID STUDENTS654321 Joe, ThaboRequirementsCorrect SELECT statement used. Correct JOIN used. Correct WHERE clause. Question 7 Write an appropriate SQL query to delete the following record from the STUDENTS table: STUDENT_ID: S654321STUDENT_SURNAME: JoeSTUDENT_NAME: ThaboRequirementsCorrect DELETE statement used. Correct WHERE clause.arrow_forwardWrite the SQL queries of following questions: Write a query to display all departments no, which have more-than 2 instructors without using Join or Sub Queries. Write a query to display instructors who have taught course which course id starts except "CS-4". Write a query using Joins to display 2nd lowest salary of instructor using Join. Write a query using Joins to display first name, age and department name of youngest instructor's from each department. Using Joinarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage LearningA Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning