Database Systems: Design, Implementation, & Management
13th Edition
ISBN: 9781337627900
Author: Carlos Coronel, Steven Morris
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 7, Problem 19RQ
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
Trending nowThis is a popular solution!
Students 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 7 Solutions
Database Systems: Design, Implementation, & Management
Ch. 7 - Prob. 1RQCh. 7 - Explain why the following command would create an...Ch. 7 - What is a cross join? Give an example of its...Ch. 7 - What three join types are included in the outer...Ch. 7 - Using tables named T1 and T2, write a query...Ch. 7 - Prob. 6RQCh. 7 - Rewrite the following WHERE clause without the use...Ch. 7 - Explain the difference between an ORDER BY clause...Ch. 7 - Explain why the following two commands produce...Ch. 7 - What is the difference between the COUNT aggregate...
Ch. 7 - Prob. 11RQCh. 7 - Prob. 12RQCh. 7 - Prob. 13RQCh. 7 - Prob. 14RQCh. 7 - Prob. 15RQCh. 7 - What does it mean to say that SQL operators are...Ch. 7 - Prob. 17RQCh. 7 - Prob. 18RQCh. 7 - Prob. 19RQCh. 7 - Prob. 20RQCh. 7 - Given the employee information in Question 19,...Ch. 7 - Given the employee information in Question 19,...Ch. 7 - Prob. 23RQCh. 7 - Prob. 24RQCh. 7 - Prob. 25RQCh. 7 - What Oracle function should you use to calculate...Ch. 7 - What string function should you use to list the...Ch. 7 - Prob. 28RQCh. 7 - Given the structure and contents of the...Ch. 7 - Using the EMPLOYEE, JOB, and PROJECT tables in the...Ch. 7 - Write the SQL code that will produce the same...Ch. 7 - Prob. 4PCh. 7 - Write the SQL code to validate the ASSIGN_CHARGE...Ch. 7 - Using the data in the ASSIGNMENT table, write the...Ch. 7 - Prob. 7PCh. 7 - Prob. 8PCh. 7 - Prob. 9PCh. 7 - Prob. 10PCh. 7 - Generate a listing of all purchases made by the...Ch. 7 - Prob. 12PCh. 7 - Prob. 13PCh. 7 - Modify the query in Problem 13 to include the...Ch. 7 - Prob. 15PCh. 7 - Prob. 16PCh. 7 - Prob. 17PCh. 7 - Prob. 18PCh. 7 - Prob. 19PCh. 7 - Prob. 20PCh. 7 - Prob. 21PCh. 7 - Create a query to find the balance characteristics...Ch. 7 - Prob. 23PCh. 7 - Prob. 24PCh. 7 - Prob. 25PCh. 7 - Find the total value of the product inventory. The...Ch. 7 - Prob. 27PCh. 7 - Write a query to display the SKU (stock keeping...Ch. 7 - Prob. 29PCh. 7 - Prob. 30PCh. 7 - Prob. 31PCh. 7 - Prob. 32PCh. 7 - Prob. 33PCh. 7 - Prob. 34PCh. 7 - Prob. 35PCh. 7 - Prob. 36PCh. 7 - Prob. 37PCh. 7 - Prob. 38PCh. 7 - Prob. 39PCh. 7 - Prob. 40PCh. 7 - Prob. 41PCh. 7 - Prob. 42PCh. 7 - Prob. 43PCh. 7 - Prob. 44PCh. 7 - Prob. 45PCh. 7 - Prob. 46PCh. 7 - Prob. 47PCh. 7 - Prob. 48PCh. 7 - Prob. 49PCh. 7 - Prob. 50PCh. 7 - Prob. 51PCh. 7 - Prob. 52PCh. 7 - Prob. 53PCh. 7 - Prob. 54PCh. 7 - Prob. 55PCh. 7 - Prob. 56PCh. 7 - Prob. 57PCh. 7 - Prob. 58PCh. 7 - Prob. 59PCh. 7 - Prob. 60PCh. 7 - Prob. 61PCh. 7 - Prob. 62PCh. 7 - Prob. 63PCh. 7 - Prob. 64PCh. 7 - Prob. 65PCh. 7 - Prob. 66PCh. 7 - Prob. 67PCh. 7 - Prob. 68PCh. 7 - Prob. 69PCh. 7 - Prob. 70PCh. 7 - Prob. 71PCh. 7 - Prob. 72PCh. 7 - Prob. 73PCh. 7 - Prob. 74PCh. 7 - Prob. 75PCh. 7 - Prob. 76PCh. 7 - Prob. 77PCh. 7 - Prob. 78PCh. 7 - Prob. 79PCh. 7 - Prob. 80PCh. 7 - Prob. 81PCh. 7 - Prob. 82PCh. 7 - Prob. 83PCh. 7 - Prob. 84PCh. 7 - Prob. 85PCh. 7 - Prob. 86PCh. 7 - Prob. 88PCh. 7 - Prob. 89PCh. 7 - Prob. 90PCh. 7 - Prob. 91PCh. 7 - Prob. 92PCh. 7 - Prob. 93PCh. 7 - Prob. 94PCh. 7 - Prob. 95PCh. 7 - Prob. 96PCh. 7 - Prob. 97PCh. 7 - Prob. 98PCh. 7 - Prob. 99PCh. 7 - Prob. 100PCh. 7 - Prob. 101PCh. 7 - Prob. 102PCh. 7 - Prob. 103PCh. 7 - Prob. 104PCh. 7 - Prob. 105PCh. 7 - Prob. 106PCh. 7 - Prob. 107PCh. 7 - Prob. 108PCh. 7 - Prob. 109P
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