JohnsonKylee1-WetheringtonKalieann2-HW2

xlsx

School

Georgia Institute Of Technology *

*We aren’t endorsed by this school

Course

2210

Subject

Computer Science

Date

Apr 3, 2024

Type

xlsx

Pages

14

Uploaded by ColonelThunder13772

Report
Please record your names & GT IDs Last Name Johnson First Name Kylee GT Account 9 digit ID 903513317 Leave blank unless working with another student Last Name Wetherington First Name Kalieann GT Account 9 digit ID
Reminder: You will be penalized if you do not following these instructions located in worksheets Q1..Q10 - cell B3. Also see the instructions in Q0.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Query 0 - As a guide (there is no need to attempt this question) Note: Do not include your name in the answer textbox. Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. SELECT id AS 'Listing ID', name AS 'Listing Name', price AS 'Listing Price', number_of_reviews AS 'Number of Reviews' FROM listings WHERE number_of_reviews > 500 ORDER BY number_of_reviews DESC LIMIT 10; Three mandatory features of a screenshot. 1. The first line of your SQL Query must be: -- my name is George Burdell (please change to be your name/s). 2. Do not report more than 10 rows for any query. 3. The Result table (all queries will generate at least one row of results)
Query 1 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. SELECT client_id, gender, birth_date FROM client WHERE gender = 'F' and (birth_date between '1908-01-01' and '1982-12-31') order by birth_date Limit 10;
Query 2 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. select disp.disp_id, disp.client_id, disp.account_id, disp.type, client.birth_date from disp inner join client on disp.client_id=client.client_id where disp.type = "OWNER" AND (client.birth_date between "1980-01-01" AND "1980-12-31") Limit 10;
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Query 3 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. select count(*) from client inner join disp on client.client_id=disp.client_id inner join card on disp.disp_id=card.disp_id inner join account on disp.account_id=account.account_id inner join loan on account.account_id=loan.account_id where loan.amount > "200000" AND card.type = "gold"
Query 4 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. SELECT client.client_id AS ClientID, client.birth_date AS ClientBirthdate, account.date AS AccountCreationDate, loan.amount AS LoanAmount, loan.status AS LoanStatus, card.type AS CardType, disp.type AS DispositionType, client.district_id AS DistrictID From client inner join disp on client.client_id=disp.client_id inner join account on disp.account_id=account.account_id inner join loan on account.account_id=loan.account_id inner join card
Query 5 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. SELECT client.client_id AS ClientID, client.birth_date AS ClientBirthdate, loan.amount AS LoanAmount, loan.status AS LoanStatus, IF(card.type= 'classic','yes','') AS ClassicCardOwner FROM client INNER JOIN disp ON client.client_id = disp.client_id INNER JOIN account ON disp.account_id= account.account_id INNER JOIN loan ON account.account_id =loan.account_id LEFT JOIN card ON disp.disp_id= card.disp_id WHERE loan.duration >= '24' AND loan.amount < (select AVG(loan.amount) From loan)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Query 6 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. SELECT client.client_id, count(client.client_id) as "ClassicCount", sum(loan.amount) as "TotalLoanAmount" FROM client INNER JOIN disp ON client.client_id = disp.client_id INNER JOIN account ON disp.account_id = account.account_id LEFT JOIN loan ON disp.account_id = loan.account_id LEFT JOIN card ON disp.disp_id = card.disp_id WHERE card.type = "Classic" GROUP BY
Query 7 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. Select COUNT(disp.disp_id) AS ClientsWithoutCard FROM card RIGHT JOIN disp ON disp.disp_id = card.disp_id WHERE card_id IS NULL;
Query 8 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. SELECT client.client_id, client.birth_date, card.card_id, card.type, card.issued, datediff("2000-01-01", card.issued) AS "DateDiff" FROM client INNER JOIN disp ON client.client_id = disp.client_id INNER JOIN account ON disp.account_id= account.account_id INNER JOIN loan ON account.account_id =loan.account_id INNER JOIN card ON disp.disp_id= card.disp_id
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Query 9 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar. SELECT client.client_id AS ClientID, client.birth_date AS ClientBirthdate, loan.amount AS LoanAmount, loan.status AS LoanStatus, card.card_id as CardID FROM client INNER JOIN disp ON client.client_id = disp.client_id INNER JOIN account ON disp.account_id= account.account_id INNER JOIN loan ON account.account_id =loan.account_id LEFT JOIN card ON disp.disp_id= card.disp_id WHERE (client.birth_date BETWEEN "1965-01-01" AND "1974-12-31")
Query 10 Paste the required screenshot beneath this line. Resize it to be no wider than this yellow bar.