Question

Given CUSTOMERS = (SSN, fname, lname, cell pn, home pn, street, city, zip, state, free min,...

Given

CUSTOMERS = (SSN, fname, lname, cell pn, home pn, street, city, zip, state, free min, DOB, free SMS)

RECORDS (from pn, to pn, start timestamp, duration, type)

STATEMENTS (cell pn, start date, end date, total minutes, total SMS, amount due)

PAYMENTS (cell pn, paid on, amount paid)

DIRECTORY (pn, fname, lname, street, city, zip, state) pn is PK

Provide queries in SQL

1.) List the full names of customers who has not made any calls for the last 7 months

2.) List the top 2 cities with the highest local traffic. A local call is one where both the caller and dialed numbers are in the same city.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1) Select dir.fname,dir.lname from DIRECTORY dir

JOIN RECORDS rec ON dir.pn=rec.from pn

Where rec.duration != 7

2) Select TOP 2 dir.city from DIRECTORY dir

JOIN RECORDS rec ON dir.pn=rec.from pn

Where rec.type = 'local'

Add a comment
Know the answer?
Add Answer to:
Given CUSTOMERS = (SSN, fname, lname, cell pn, home pn, street, city, zip, state, free min,...
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
  • I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP...

    I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP CITY EMP STATE EMP ZIP EMP START DATE Table TABLE ID AREA IDTABLE SEATS Area AREA ID AREA NAME AREA SUPERVISOR EMPLOYEE ID Customer CUST ID CUST LAST NAME CUST NUMBER OF GUESTS Assignment EMPID TABLE ID Seating CUST IDTABLE ID SEATING COST SEATING DATE SEATING TIP Question 29 (10 points) Write an SQL query to list the employee ID and first and last...

  • You have been given a univerity business plan that produced the following information: PERSON: lname, fname,...

    You have been given a univerity business plan that produced the following information: PERSON: lname, fname, rname, idnum, private, linkblue lname, fname, rname are variable length strings idnum is type INT and is a key attribute private is BOOLEAN linkblue is string of 8 characters ADDR: idnum, adtype, streetaddr, city, state, country, zip idnum is a foreign key to PERSON.idnum adtype is a string in the set {"bill","permanent","local"} streetaddr is a variable length string that includes #, street, and maybe...

  • For the below `bank' schema: customer(customerid,username,fname,lname,street1,street2,city,state,zip) account(accountid,customerid,description,) transaction(transactionid,trantimestamp,accountid,amount) A customer may have several accounts, and each...

    For the below `bank' schema: customer(customerid,username,fname,lname,street1,street2,city,state,zip) account(accountid,customerid,description,) transaction(transactionid,trantimestamp,accountid,amount) A customer may have several accounts, and each account may participate in many transactions. Each transaction will have at least two records, one deducting amount from an account, and one adding amount to an account (for a single transactionid, the sum of amounts will equal zero). Using SQL, answer these questions (write a SQL query that answers these questions): 8) List the top 1% of customers (ordered by total balance). 9) Using...

  • You have been given a university business plan that produced the following information: PERSON: lname, fname,...

    You have been given a university business plan that produced the following information: PERSON: lname, fname, rname, idnum, private, linkblue lname, fname, rname are variable length strings idnum is type INT and is a key attribute private is BOOLEAN linkblue is string of 8 characters ADDR: idnum, adtype, streetaddr, city, state, country, zip idnum is a foreign key to PERSON.idnum adtype is a string in the set {"bill","permanent","local"} streetaddr is a variable length string that includes #, street, and maybe...

  • For the below questions, use the following schema definition. customer(custid,lname,fname,street,city,state,zip,dob) device(devid,custid,type) device_onoff(ts,devid,pwr) device_chnl(ts,devid,chnl) schedule(start_ts,end_ts,chnl,showid) This is...

    For the below questions, use the following schema definition. customer(custid,lname,fname,street,city,state,zip,dob) device(devid,custid,type) device_onoff(ts,devid,pwr) device_chnl(ts,devid,chnl) schedule(start_ts,end_ts,chnl,showid) This is a schema for a tv network. Customers own devices (of a certain type; phone is a device, cable-box is a device, etc.), and they can watch channels on those devices. Whenever a device comes online, we get a device onoff event, indicating device power state. Whenever a device channel changes, we get a device chnl event. There is also a schedule object, which tells...

  • CellTell, a cellular phone service provider, offers cell phone service contracts to their customers. They have an information system that stores the details about these contracts, selected plans, phones, and accessories

    ERD and Schema for the model is:CUSTOMER ( ID, Lname, Fname, Street, City, ZipCode, State, Phone, CreditScore, Credit_Org, CS_Date)PLAN ( Plan_ID, Start_Date, End_Date, BasePrice, Plan_Type)VOICE ( vPlan_ID@, NumMin, HasVoiceMail, HasThreeWay, OverageFee)TEXT ( tPlan_ID@, TextLimit, HasMMS, MmsOverage, TextOverage)DATA ( dPlan_ID@, DataLimit, NetworkTechnology, OverageFee)CONTRACT ( Contract_ID, Customer_ID@, vPlan_ID@, tPlan_ID@, dPlan_ID@, Start_Date, End_Date, DiscountPerc)MANUFACTURER ( Manuf_ID, Manuf_Name, Contact_Lname, Contact_Fname, Contact_Phone, Contact_Email)PRODUCT ( Product_ID, Name, Manuf_ID@, CostPaid, BasePrice, Type)CELLPHONE ( Phone_ID@, Model, NetworkTechnology, OS)ACCESSORY ( Access_ID@, Category)PHONE_ACCESS ( Phone_ID@, Access_ID@)CONTRACT_CELLPHONE ( Contract_ID@, Phone_ID@, Seq#, PaidPrice, ESN)1. CellTell would like to add website information about the manufacturers of products they sell. Add a new column named “Website” to the manufacturer table. Then,...

  • John and Jane Doe are married retired taxpayers who care for their three-year-old grandson. The following...

    John and Jane Doe are married retired taxpayers who care for their three-year-old grandson. The following information was provided to you as documentation necessary to prepare their 2017 tax return. You will gather the appropriate information and complete the forms provided in Blackboard (1040, Schedule A, Schedule B and Schedule D) in preparation of their tax file. Please note that the forms provided may not match the tax year of the course, as IRS forms are not available until just...

  • 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...

  • 23. What is the total net amount of capital gain reported on Form 1040? OA. $308...

    23. What is the total net amount of capital gain reported on Form 1040? OA. $308 OB. $2,411 C. $2,719 OD. $2,900 Advanced Scenario 7: Mark and Barbara Matthews Directions Using the tax software, complete the tax return, 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....

  • complete a 1040 (2019) Donna Jones, an administrative assistant. resides at 123 Main Street, Lawrenceville, NJ...

    complete a 1040 (2019) Donna Jones, an administrative assistant. resides at 123 Main Street, Lawrenceville, NJ V0048. She is single and has no dependents. Her social security number is 123-44-5500. She received $26,159.00 in wages and had $2.200.00 of federal income tax withheld during 2019. Donna also had $390.00 in interest income from her bank account and made $150.00 of charitable contributions during the year. Prepare her 2019 1040. One box UTU Treasury Internal Revenue Service ) U.S. Individual Income...

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