Question: Using SQl DDL write sql commands for : # Customers id having a loan and an account. #Customers name and email with the amount of

Using SQl DDL write sql commands for :

# Customers id having a loan and an account. #Customers name and email with the amount of their loan (the amount of loan should be NULL if a customer does not have any loan) #branches (Name, Branch_code, City) which has loan with Loan_period more than three years. #Retrieve the number of transactions per each account.

# Retrieve all the customers having their account in active state.

Using SQl DDL write sql commands for : # Customers id havinga loan and an account. #Customers name and email with the amountof their loan (the amount of loan should be NULL if acustomer does not have any loan) #branches (Name, Branch_code, City) which hasloan with Loan_period more than three years. #Retrieve the number of transactions

Account: Account number Branch_code Balance Customer_id 10035 Opening_date 2018-12-31 Status Active ac1055 b3 16003 ac1103 10020 b2 18124 2015-08-02 Active ac1114 10061 b2 12978 2020-10-06 Inactive ac1118 10012 b2 15225 2015-06-11 Active ac1135 10045 b1 8411 2019-06-02 Active ac1157 10003 b1 18693 2016-09-21 Inactive ac1163 10019 b1 18154 2020-02-23 Active ac1183 10068 b2 14868 2016-01-29 Inactive ac1194 10039 b4 11820 2019-03-22 Active ac1224 10032 b1 9801 2018-10-19 Active ac1230 10013 b3 17477 2017-09-25 Inactive ac1234 10027 b1 13656 2018-03-07 Inactive ac1238 10045 b1 11398 2017-01-14 Inactive ac1259 10013 b3 18387 2019-10-18 Active ac1267 10022 b1 17374 2015-11-24 Active ac1327 10009 b4 10839 2019-10-27 Active ac 1452 10035 b3 19748 2017-11-04 Inactive ac 1458 10039 54 11479 2017-02-21 Active ac1470 10005 b2 11207 2015-03-26 Active ac1471 10027 b1 9117 2018-03-05 Inactive Branch: Name City Branch_code Address Manager Gjvik Branch Gjvik b1 Storgata 55 Alexander Dahl Trondheim Branch Trondheim b2 Strindvegen 7 Martina Jensen Oslo Branch Oslo b3 Bromstadvegen 31 Tom Westin Lillehammer Branch Lillehammer b4 Anders Tvereggens veg 12 John Smith Hamar Branch Hamar b5 Lille Strandgate 2 Otto Roseth Arendal Branch Arendal b6 Strandgata 71 Sofie Hovde Customer: Name Customer_id Gender Birth_date City Address Postal code Home_Phone Mobile phone Email 10003 F 2000-04-28 Gjvik Moholt alle 4 2816 59575468 39305691 hildegunn@realmail.no Hildegunn Eggen Sofie Veierod 10005 F 1996-03-21 Trondheim Frode Rinnans veg 27 7036 35904273 30254098 sofie@yahoo.com Christoffer Sande 10009 M 1972-02-26 Lillehammer Hans Baucks veg 48 2611 50742474 71218150 christoffer@yahoo.com Erna kaasa 10012 F 1978-05-20 Trondheim Valentinlystvegen 43 7034 70536071 83358256 erna@yahoo.com Benjamin Kringen 10013 M 1965-12-15 Oslo Lidarende 33 0151 43828201 67896305 benjamin@realmail.no Vivi Sando 10019 F 1958-07-29 Gjvik Astri Aasens veg 12 2821 35745929 78088625 vivi@realmail.no Audun Owe 10020 M 1964-06-22 Trondheim 7026 84561135 25715331 audun@rocketmail.no Frydenbergvegen 41 Kasper Andresens veg 45 Markus Stenseth 10022 M 1950-04-26 Gjvik 2816 25200362 59268004 markus@realmail.no Silje Henjum 10027 F 1983-06-03 Gjvik Sigurd Jorsalfars veg 28 2818 30420382 77112631 silje @realmail.no Agnar Nielsen 10032 M 1980-05-19 Gjvik Herman Krags veg 21 2817 39585170 57974878 agnar@rocketmail.no Monika Narum 10035 F 1958-07-29 Oslo Jonsvannsveien 5 0259 87867556 23033394 monika@yahoo.com Ina Huseby 10039 F 1984-01-09 Lillehammer Nordre Eberg gate 55 2614 57612202 33548835 ina@rocketmail.no Lillian Eriksen 10045 F F 1997-09-15 Gjvik Kong ysteins veg 8 2819 89078833 81098988 lillian@rocketmail.no Ulrik Bergland 10061 M 1990-03-11 Trondheim Jonsvannsveien 13 7028 50099414 26901503 ulrik@gmail.com Audun Strand 10068 M 1999-02-28 Trondheim Svalevegen 23 7017 46456081 81924867 audun@realmail.no Depositor: Date Transaction_id tr1239 Customer_id 10013 Account_number ac1259 Amount 450 2020-05-13 tr1244 10068 ac1183 400 2020-10-13 t1271 10035 ac 1452 1000 2020-08-04 tr1290 10013 ac1230 1150 2019-07-08 tr1296 10009 ac1327 2500 2019-08-22 tr1311 10019 ac1163 200 2020-06-14 t1317 1 0009 ac1327 1200 2020-09-15 tr1325 10009 ac1327 300 2019-03-20 tr1328 10039 ac1194 250 2019-05-04 t1332 10019 ac1163 600 2019-04-19 t1344 10012 ac1118 450 2019-04-14 tr1345 10061 ac1114 250 2019-07-08 tr1346 10013 ac1259 1000 2019-04-04 tr1352 10013 ac1230 300 2020-12-30 t1369 10039 ac1194 400 2020-02-01 tr1398 10005 ac 1470 500 2020-05-14 tr1405 10022 ac1267 1100 2020-03-17 t1407 1 0061 ac1114 1200 2020-12-15 tr1418 10020 ac 1103 850 2019-03-09 tr1421 10005 ac 1470 1300 2020-03-14 Loan: Loan_number lo 1004 Loan_period Interest_rate 3 1.88% Customer_id Branch_code Loan_name Loan_amount Starting_Date 10013 b2 Personal 50000 2018-05-03 10027 b4 Car 100000 2020-09-27 101029 10 2.49% lo 1031 10009 b1 Personal 50000 2018-12-27 3 1.88% lo 1044 10035 b2 Home 100000 2018-06-08 5 2.13% lo 1062 10020 b3 Car 50000 2020-07-26 3 1.88% lo 1065 10039 b3 Personal 20000 2018-08-29 3 1.88% lo 1075 10012 b4 Personal 30000 2019-09-02 3 1.88% lo 1131 10061 b2 Home 200000 2019-07-30 10 2.49% lo 1135 10032 b4 Car 100000 2020-01-15 5 2.13% lo1141 10027 b3 Personal 25000 2020-07-05 3 1.88% lo 1185 10039 b3 Personal 50000 2018-08-10 3 1.88% lo 1210 10005 b4 Home 100000 2020-12-30 5 2.13% lo1275 10068 b1 Personal NULL 2018-09-02 NULL 1.88% lo 1285 10032 b2 Personal 30000 2019-12-29 3 1.88% lo1286 10020 b4 Personal NULL 2018-04-09 NULL 1.88%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!