Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please help me with this following question: Write an SQL query to show all people involved in this business and their role (customer

Can you please help me with this following question: Write an SQL query to show all people involved in this business and their role (customer or salesman). Return ID, name, and role.

Here is my SQL query. I don't know how to merge customer and salesman into a column role with each row (people) having its respective role (customer or salesman)

image text in transcribed

image text in transcribed

Consider the following tables (Salesman and Customer, respectively). SELECT Custoner.custoner_id as ID, Customer.cust_nane as Name FrOM Custamer UNION SELECT salesman_id as ID, Salesman, name as Name FRON Salesman

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

LO3 Differentiate a proposed regulation and a temporary regulation.

Answered: 1 week ago

Question

Identify and discuss learning style differences across cultures

Answered: 1 week ago