Use Oracle-VM SQL Data Definition Language to create the following Bank-and-Cust
ID: 3731188 • Letter: U
Question
Use Oracle-VM SQL Data Definition Language to create the following Bank-and-Customer database. You should properly define primary keys and foreign keys and then use SQL Query Language to express the following queries. In the document that you submit, you should have the question with its number, SQL query, and query result generated by Oracle-VM for each question. Each query is 3 marks and the result is mar Account C#B# | Balance B Name City B1 England London Cl BI 1000 B2 America New York C1B2 2000 B3 Royal Toronto B4 France Paris C1 B33000 CI B4 4000 C2 BI 2000 C2 B2 3000 Customer 20||London | C3 B2 3000 CB31 4000 C3 B3 4000 CL Adams 2 Blake30 Paris 4000 Clark 25 Paris C4 B35000 C4 Your Lastname 20 London 30 Toronto 1. 2. 3. Get the name of the customer who banks only in the banks that Clark banks. Get the name of the customer, the number of banks he/she banks, and total balance he/she has. Get the name of the customer who banks in more than two banks without using grouping and aggregate function. Get the name of the customer who banks in more than two banks using grouping and aggregate function. 4.Explanation / Answer
1. SELECT name FROM Customer WHERE city = (select city from customer where name = "Clark");
3. select c.name from customer c, account a where c.c# in (select cid from account where c.c#=a.c# and count(cid)>=2);
4. select c.name from customer c , account a where c.c#=a.c# group by c.c#;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.