I NEED THE QUERIES NOT THE TABLE CREATION: 4. Get the name of the customer who b
ID: 3731130 • Letter: I
Question
I NEED THE QUERIES NOT THE TABLE CREATION:
4. Get the name of the customer who banks in Royal or America bank.
13. Get the name of the customer who banks only in the banks that Clark banks.
14. Get the name of the customer, the number of banks he/she banks, and total balance he/she has.
15. Get the name of the customer who banks in more than two banks without using grouping and aggregate
function.
Explanation / Answer
4. Get the name of the customer who banks in Royal or America bank.
select c.C#,c.Name from Customer c,Account a, Bank b where c.C#=a.C# and a.B#=b.B# and b.Name=Royal or b.Name=America;
13. Get the name of the customer who banks only in the banks that Clark banks.
select c1.C#,c1.Name from Customer c1,Account a, Bank b where c.C#=a.C# and a.B#=b.B# and b.Name = ( select b.Name from Bank b,Account a,Customer c where a.C#=c.C# and b.B#=a.B# and c.Name='Clark');
14. Get the name of the customer, the number of banks he/she banks, and total balance he/she has.
select c.Name,count(b.B#) as No_Of_Banks, sum(Balance) from Customer c,Bank b,Account a where c.C#=a.C# and a.B#=b.B# group by c.Name;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.