SlideShare a Scribd company logo
1 of 1
Download to read offline
Modern Database Management 11th Edition by Jeffrey A. Hoffer
Use the UNION statement to provide a combined listing of care center names and their locations
as well as laboratories and their location. The list should be sorted by location, in ascending
order. (You should use aliases to rename the fields in this query.)
Please provide results!
Solution
The UNION operator is used to combine the result-set of two or more SELECT statements.The
UNION operator selects only distinct values by default. To allow duplicate values, use the ALL
keyword with UNION.
Syntax:
SELECT column_name(s) FROM table1
UNION ALL
SELECT column_name(s) FROM table2;
Now Let us consider that there are two tables namely care_center_t and laboratory_t where the
care_center_t contains rows like care_center name ,location1 and the laboratory_t consists of
rows such as laboratories and Locations2.
SELECT operator is used in selecting of particular rows from the table. So, now we select rows
namely care_center_name and location1 from care_center_t table and Loboratories and location2
from laboratory_t table.
The Database Query for the above problem is
SELECT care_center_name as name,location1 as location from care_center_t
UNION all
Select laboratory as name ,location2 as location from laboratory_t

More Related Content

Similar to Modern Database Management 11th Edition by Jeffrey A. HofferUse th.pdf

e computer notes - Advanced subqueries
e computer notes - Advanced subqueriese computer notes - Advanced subqueries
e computer notes - Advanced subqueries
ecomputernotes
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
Tony Wong
 
Sql select statement
Sql select statementSql select statement
Sql select statement
Vivek Singh
 

Similar to Modern Database Management 11th Edition by Jeffrey A. HofferUse th.pdf (20)

ADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASADADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASAD
 
Sql(structured query language)
Sql(structured query language)Sql(structured query language)
Sql(structured query language)
 
Les07
Les07Les07
Les07
 
SQL
SQLSQL
SQL
 
Assignment 4
Assignment 4Assignment 4
Assignment 4
 
Day-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptxDay-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptx
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
 
Commands
CommandsCommands
Commands
 
Interview Questions.pdf
Interview Questions.pdfInterview Questions.pdf
Interview Questions.pdf
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
 
e computer notes - Advanced subqueries
e computer notes - Advanced subqueriese computer notes - Advanced subqueries
e computer notes - Advanced subqueries
 
Joins.ppt
Joins.pptJoins.ppt
Joins.ppt
 
Les04
Les04Les04
Les04
 
App C
App CApp C
App C
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
Database Systems - SQL - DDL Statements (Chapter 3/3)
Database Systems - SQL - DDL Statements (Chapter 3/3)Database Systems - SQL - DDL Statements (Chapter 3/3)
Database Systems - SQL - DDL Statements (Chapter 3/3)
 
Sql select statement
Sql select statementSql select statement
Sql select statement
 
Sql slid
Sql slidSql slid
Sql slid
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive
 
set operators.pptx
set operators.pptxset operators.pptx
set operators.pptx
 

More from info309708

Loops and ArraysObjectivesArrays are a series of elements consi.pdf
Loops and ArraysObjectivesArrays are a series of elements consi.pdfLoops and ArraysObjectivesArrays are a series of elements consi.pdf
Loops and ArraysObjectivesArrays are a series of elements consi.pdf
info309708
 
Its your third week on the job at Panache Inc. Last week, you made.pdf
Its your third week on the job at Panache Inc. Last week, you made.pdfIts your third week on the job at Panache Inc. Last week, you made.pdf
Its your third week on the job at Panache Inc. Last week, you made.pdf
info309708
 
In JAVA Write a program that uses a two-dimensional array to sto.pdf
In JAVA Write a program that uses a two-dimensional array to sto.pdfIn JAVA Write a program that uses a two-dimensional array to sto.pdf
In JAVA Write a program that uses a two-dimensional array to sto.pdf
info309708
 
How would you implement a node classs and an edge class to create .pdf
How would you implement a node classs and an edge class to create .pdfHow would you implement a node classs and an edge class to create .pdf
How would you implement a node classs and an edge class to create .pdf
info309708
 
How do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdfHow do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdf
info309708
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
info309708
 
For this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdfFor this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdf
info309708
 
Describe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdfDescribe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdf
info309708
 
Create a student record management system using linked list and queu.pdf
Create a student record management system using linked list and queu.pdfCreate a student record management system using linked list and queu.pdf
Create a student record management system using linked list and queu.pdf
info309708
 
C programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdfC programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdf
info309708
 
Aside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdfAside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdf
info309708
 

More from info309708 (20)

Pluto has been hard to measure from Earth because of its atmosphere. .pdf
Pluto has been hard to measure from Earth because of its atmosphere. .pdfPluto has been hard to measure from Earth because of its atmosphere. .pdf
Pluto has been hard to measure from Earth because of its atmosphere. .pdf
 
Loops and ArraysObjectivesArrays are a series of elements consi.pdf
Loops and ArraysObjectivesArrays are a series of elements consi.pdfLoops and ArraysObjectivesArrays are a series of elements consi.pdf
Loops and ArraysObjectivesArrays are a series of elements consi.pdf
 
Let f X Y be a function.True or FalseA sufficient condition for f .pdf
Let f X Y be a function.True or FalseA sufficient condition for f .pdfLet f X Y be a function.True or FalseA sufficient condition for f .pdf
Let f X Y be a function.True or FalseA sufficient condition for f .pdf
 
Its your third week on the job at Panache Inc. Last week, you made.pdf
Its your third week on the job at Panache Inc. Last week, you made.pdfIts your third week on the job at Panache Inc. Last week, you made.pdf
Its your third week on the job at Panache Inc. Last week, you made.pdf
 
In JAVA Write a program that uses a two-dimensional array to sto.pdf
In JAVA Write a program that uses a two-dimensional array to sto.pdfIn JAVA Write a program that uses a two-dimensional array to sto.pdf
In JAVA Write a program that uses a two-dimensional array to sto.pdf
 
How do CCMI model help with the improvements and comparison of the p.pdf
How do CCMI model help with the improvements and comparison of the p.pdfHow do CCMI model help with the improvements and comparison of the p.pdf
How do CCMI model help with the improvements and comparison of the p.pdf
 
How would you implement a node classs and an edge class to create .pdf
How would you implement a node classs and an edge class to create .pdfHow would you implement a node classs and an edge class to create .pdf
How would you implement a node classs and an edge class to create .pdf
 
How do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdfHow do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdf
 
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdfHere are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
For this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdfFor this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdf
 
Discuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdfDiscuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdf
 
Describe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdfDescribe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdf
 
Create a student record management system using linked list and queu.pdf
Create a student record management system using linked list and queu.pdfCreate a student record management system using linked list and queu.pdf
Create a student record management system using linked list and queu.pdf
 
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdfCoca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
 
C programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdfC programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdf
 
Biology LabThe poisonous wastes of diptheria germs are called (A).pdf
Biology LabThe poisonous wastes of diptheria germs are called (A).pdfBiology LabThe poisonous wastes of diptheria germs are called (A).pdf
Biology LabThe poisonous wastes of diptheria germs are called (A).pdf
 
Aside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdfAside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdf
 
Yates (2009) notes that unions have a purpose broader than serving t.pdf
Yates (2009) notes that unions have a purpose broader than serving t.pdfYates (2009) notes that unions have a purpose broader than serving t.pdf
Yates (2009) notes that unions have a purpose broader than serving t.pdf
 
write a C program for blinking light using function make sure it.pdf
write a C program for blinking light using function make sure it.pdfwrite a C program for blinking light using function make sure it.pdf
write a C program for blinking light using function make sure it.pdf
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 

Recently uploaded (20)

TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 

Modern Database Management 11th Edition by Jeffrey A. HofferUse th.pdf

  • 1. Modern Database Management 11th Edition by Jeffrey A. Hoffer Use the UNION statement to provide a combined listing of care center names and their locations as well as laboratories and their location. The list should be sorted by location, in ascending order. (You should use aliases to rename the fields in this query.) Please provide results! Solution The UNION operator is used to combine the result-set of two or more SELECT statements.The UNION operator selects only distinct values by default. To allow duplicate values, use the ALL keyword with UNION. Syntax: SELECT column_name(s) FROM table1 UNION ALL SELECT column_name(s) FROM table2; Now Let us consider that there are two tables namely care_center_t and laboratory_t where the care_center_t contains rows like care_center name ,location1 and the laboratory_t consists of rows such as laboratories and Locations2. SELECT operator is used in selecting of particular rows from the table. So, now we select rows namely care_center_name and location1 from care_center_t table and Loboratories and location2 from laboratory_t table. The Database Query for the above problem is SELECT care_center_name as name,location1 as location from care_center_t UNION all Select laboratory as name ,location2 as location from laboratory_t