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 11RQ
Program Plan Intro
UNION set 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.
(A) Write a query which shows the employee IDs that are unique to the employee table. Order the employee IDs in descending order. An employee ID Is the same in both tables if the integer value of the ID matches.
(B) We want to add a new column to the employee table. We want to provide a new column with a more complete phone number. Right now the PHONENO column only shows the last 4 digits. We want a new column which is called PHONE and consists of ###-###-####. The last 4-digits are already in the PHONENO column. The first three digits should be 416 and the next three should be 123. To improve clarity in the table, we also want to rename the PHONENO column to PHONEEXT. Show all the commands used to accomplish this, then, select all data for employees who have the last name of 'smith' (case insensitive).
(C) Show a list of employee id, names, department, years and job of any employee in the staff table who makes a total amount more than their manager or has more years of service than…
Some rows of the STUDENT table are shown below:
CODE
NAME
GPA
YEAR
291
ALEX
3.1
2
938
MICHELE
2.3
1
931
JHON
3.3
1
182
JOE
3.4
2
190
REY
2.0
2
330
RON
3.9
3
Which best describes the result of the query below?
SELECT YEAR, AVG(GPA) FROM STUDENT WHERE GPA > 2.0 GROUP BY YEAR
a.
The average maximum GPA of all the students in each year.
b.
The year of the student with the maximum GPA.
c.
The average GPA of students with a GPA higher than 2.0 each year.
d.
The average GPA of the students with a GPA higher than 2.0.
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 4, but this time use the EXISTS operator in your query.arrow_forwardRepeat Exercise 6, but this time use the EXISTS operator in your query.arrow_forwardProblem 104 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, and then in ascending order by patron ID (Figure P7.104). SELECT P.PAT_ID, AVG(DATEDIFF(C.CHECK_IN_DATE,C.CHECK_OUT_DATE) ) AS "AVERAGE DATE KEPT" FROM PATRON P JOIN CHECKOUT C ON P.PAT_ID=C.PAT_ID GROUP BY P.PAT_ID HAVING COUNT(C.CHECK_OUT_DATE) >= 3 Order by "AVERAGE DAYS KEPT" DESC,P.PAT_ID ASC; With the query below I am getting the wrong headers were returned, some expected rows were missing and some unexpected rows were returned. How can i correct this query to ge the expected results? Thanksarrow_forward
- The sales person gets a bonus pay if their amount exceeds a certain tier level for each year. Write a query that shows who would be getting a bonus and for how much. How many rows will it return and with what data?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_forwardConsider the "Employee" table which contains five columns: "Id", "Name", "Salary", "Designation and "Experience" in the format given below. Write a query to display the sum of the salary of the employees corresponding to their names. Multiple employees with the same name should be displayed only once in the output. 11 Employee Column ld Type Int(10) Varchar(20) Int(20) 12 Name Salary DesignationVarchar(20) ExpinYears DECIMAL(3, 2) 13 14 Sample Input: 15 Employee Salary Designation Experience System Engg System Engg Manager Lead IT Analyst Id Name 16 101 Rajesh 13000 3 102 Pritam 5000 17 104 105 106 103 107 Ramesh John Prttam John Vicky 40000 30000 20000 10000 80000 10 15 18 10 Lead 19 Lead 20 Sample Qutnut John 40000 Pritam 25000 20 Next Question 04: 18 A E E l * O 0 A C ENG 11:47 PM 25-03-2022 DOLL SHOT ON REDMI 7 AI DUAL CAMERA F10 F11 F12arrow_forward
- SQL The sales person gets a bonus pay if their amount exceeds a certain tier level for each year. Write a query that shows who would be getting a bonus and for how much. 2. How many rows will it return and with what data?arrow_forwardProblem 90 Write a query to display the author last name, author first name, and book number for each book written by that author. Sort the results by author last name, first name, and then book number (Figure P7.90). (25 rows)arrow_forwardProblem 94 Write a query to display the patron ID, full name (first and last), and patron type for all patrons. Sort the results by patron type and then by last name and first name. Ensure that all sorting is case insensitive (Figure P7.94). (50 rows)arrow_forward
- Problem 89 Write a query to display the book number, title with year, and subject for each book. Sort the results by the book number (Figure P7.89). (20 rows)arrow_forwardProblem 88 Write a query to display the patron ID, patron full name, and patron type for each patron sorted by patron ID (Figure P7.88). (50 rows)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_forward
arrow_back_ios
SEE MORE QUESTIONS
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 LearningNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningA Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
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
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr