Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL/ORACLE select unique customer_number Cust#, account_type Type, Balance Status from wgb_account_type natural join wgb_account where balance > 0 AS Non-Zero Balance union all select unique

SQL/ORACLE

select unique customer_number Cust#, account_type Type, Balance Status from wgb_account_type natural join wgb_account where balance > 0 AS Non-Zero Balance union all select unique customer_number Cust#, account_type Type, Balance Status from wgb_account natural join wgb_transaction where transaction_amount > 0 order by 1,2;

The following is the result of the above query statement, however, in the ststus column I want to display "Has Transaction" or "Non-zero Balance", as shown in the second table.

CUST# TYPE STATUS ------- ---------- ---------- 1112401 1 11000 1112401 1 11000 1112401 2 5000 1112401 2 5000 1113004 3 2000 1113004 3 2000 1113501 2 3000 1113501 2 3000

8 rows selected.

CUST# TYPE STATUS ------- ---------- ---------- 1112401 1 Has Transaction 1112401 1 Non-zero Balance 1112401 2 Has Transaction 1112401 2 Non-Zero Balance 1113004 3 Has Transaction 1113004 3 Non-Zero Balance 1113501 2 Has Transaction 1113501 2 Non-Zero Balance

8 rows selected.

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

Students also viewed these Databases questions

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago