Question

11 This problem is about writing SQL for the relation Repayment from the above proablem. problement(borrower id, name, address, loanamoun id, name, address, loanamount, requestdatoe, nt, requestdate, repayment date, request amount) a) (4 Rrl points) Write an SQL request that returns all the tuples with information on repayments from the aith id equal to 42, and where the lent amount exceeds 1000 USD. borrower b) (4 points)Write an SQL request that for each address finds the total repaid amount for the address.
c) (8 points)Write an SQL request that finds all names which has there does not exist a tuple with a different name and same address. a unique address, which to say is where d) (8 points) Write an SQL command, which deletes all information on ended loans, which is to say loar where the total repaid amount equals the lend amount.
0 0
Add a comment Improve this question Transcribed image text
Answer #1
  1. B 1 2010-8-09 ldentity 2009-12-05 Cutput NI Colum No SCL CommentScrit for Sedlect Main 24 8 yegd O lype hene to searchMaot Senver Mansgement STu Coieryis-ricma (sery2.sq-ariks meal Is kn. ACue cnnection parem ets Iti - doo.unsn1b)じe seleot nare.address ±1co repayment where address in : 5e1est addres스 2xco xepayment group by addze55 hevízg COUNT :address }-21 E Aggregate Status 困コdoo.unamTb3Ge Connecbontailur Ezpsed tme 000a Fnch tme lti-doo.unsniblじe 12 2018 14 0804 困コdoo.unanTb46e 1d Connection E Consection Detais Cannsutiun dapa ООООО0.030 Connectinn Connection sste Open Loqin namea h8-12-2018 1408 eart 1 ,3-17-3018 1 田コdocurict 困コdoo.USP TouranID 0.30. 500 Sasion Trucing I 1 30 21240 210C Edbo.YPrepars oninalit eot the connecbon Query exacuted successtu ty. O lype hene to searchIt will be in waiting state because process moves into the waiting state if it needs to wait for a resource, such as waiting for user input, waiting for a file to become available, or waiting for an I/O.
  2. It will be in terminated state because once the process finishes its execution, or it is terminated by the operating system, it is moved to the terminated state where it waits to be removed from main memory.
  3. It will be in ready state because the process is waiting to be assigned to a processor. Ready processes are waiting to have the processor allocated to them by the operating system so that they can run.
  4. It will be in running state because once the process has been assigned to a processor by the OS scheduler, the process state is set to running and the processor executes its instructions.
  1. SELECT     borrower_id, name, address, loanamount, requestdate, repayment_date, request_amount FROM         Repayment WHERE     (borrower_id = 42) AND (loanamount > 100)
  2. select address,SUM(request_amount) as Total_amount from Repayment group by address

3.select name,address from repayment where address in (select address from repayment group by address having

COUNT(address)<2)

4. delete from repayment where borrower_id in (select borrower_id from Repayment group by address,borrower_id having SUM(request_amount)>=AVG(loanamount))

Here i am including 2 screenshots also. first screen shot of the repayment table which have dummy data and second screenshot of repayment table after running 4th query. B 1 2010-8-09 ldentity 2009-12-05 Cutput NI Colum No SCL CommentScrit for Sedlect Main 24 8 yegd O lype hene to searchMaot Senver Mansgement STu Coieryis-ricma (sery2.sq-ariks meal Is kn. ACue cnnection parem ets Iti - doo.unsn1b)じe seleot nare.address ±1co repayment where address in : 5e1est addres스 2xco xepayment group by addze55 hevízg COUNT :address }-21 E Aggregate Status 困コdoo.unamTb3Ge Connecbontailur Ezpsed tme 000a Fnch tme lti-doo.unsniblじe 12 2018 14 0804 困コdoo.unanTb46e 1d Connection E Consection Detais Cannsutiun dapa ООООО0.030 Connectinn Connection sste Open Loqin namea h8-12-2018 1408 eart 1 ,3-17-3018 1 田コdocurict 困コdoo.USP TouranID 0.30. 500 Sasion Trucing I 1 30 21240 210C Edbo.YPrepars oninalit eot the connecbon Query exacuted successtu ty. O lype hene to search

Add a comment
Know the answer?
Add Answer to:
11 This problem is about writing SQL for the relation Repayment from the above proablem. problement(borrower...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 2: SOL (10pts) The following relation schema can be used to register information on the...

    Question 2: SOL (10pts) The following relation schema can be used to register information on the repayments on micro loans Repayment(borrower id,name,address,loan amount, request date,repayment_ date,repayment a mount) A borrower is identified with a unique borrower id, and has only one address. Borrowers can have multiple simultancous loans, but they always have different request dates. The borrower can make multiple repayments on the same day, but not more than one repayment per loan per day. a) State a primary key...

  • NEED THE SQL QUERIES ASAP PLEASE(LIKE 1 HOUR) THE ONES WITH ID ARE PRIMARY KEYS OR...

    NEED THE SQL QUERIES ASAP PLEASE(LIKE 1 HOUR) THE ONES WITH ID ARE PRIMARY KEYS OR FOREIGN etc Customer [ CustID, LastName, FirstName, Address, City, State, Zip, Phone, Fax, Email] Product [ ProdID, Description, Color, Size, Pack] Sales [ TransID, CustID, ProdID, Price, Quantity, Amount] Write SQL statement to produce a list of unique products and their prices from the Sales table. Please ensure that the products do not repeat. Write an SQL statement to list ProdID and Description for...

  • Solve the code below: CODE: """ Code for handling sessions in our web application """ from bottle import request, response import uuid import json import model import dbsche...

    Solve the code below: CODE: """ Code for handling sessions in our web application """ from bottle import request, response import uuid import json import model import dbschema COOKIE_NAME = 'session' def get_or_create_session(db): """Get the current sessionid either from a cookie in the current request or by creating a new session if none are present. If a new session is created, a cookie is set in the response. Returns the session key (string) """ def add_to_cart(db, itemid, quantity): """Add an...

  • Step 1: Design and create the tables You must create additional tables to hold Project and...

    Step 1: Design and create the tables You must create additional tables to hold Project and Activity Data. A project represents the construction of a facility with a limited scope of work and financial funding. A Project can be composed of many activities which indicate the different phases in the construction cycle. Example Project Name: Bobba Fett’s Bounty Chase Ride An activity represents the work that must be done to complete the project. Example Activity Name: For Example activity name...

  • Super stuck on a couple of questions on this scenario. Advanced Scenario 7: Mark and Barbara...

    Super stuck on a couple of questions on this scenario. Advanced Scenario 7: Mark and Barbara Matthews Directions Using the tax software, complete the tax retum, including Form 1040 and all appropri- ate forms, schedules, or worksheets. Answer the questions following the scenario. Note: When entering Social Security numbers (SSNS) or Employer identification Numbers (EINS), replace the Xs as directed, or with any four digits of your choice. Interview Notes • Mark and Barbara are married and want to file...

  • This year Evan graduated from college and took a job as a deliveryman in the city....

    This year Evan graduated from college and took a job as a deliveryman in the city. Evan was paid a salary of $68,500 and he received $700 in hourly pay for part-time work over the weekends. Evan summarized his expenses below: Cost of moving his possessions to the city (125 miles away) Interest paid on accumulated student loans Cost of purchasing a delivery uniform Contribution to State University deliveryman program $1,200 2,840 1,440 1,320 Calculate Evan's AGI and taxable income...

  • CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a...

    CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant "E" slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT