Results 1 to 2 of 2

Thread: MS SQL 2012 Script Problem

  1. #1
    Join Date
    Feb 2015
    Posts
    1

    MS SQL 2012 Script Problem

    I am a studend at a local city college and I am working on a problem which no one even the teacher seams to have know how solve.

    I have 2 Tables. One called "Address" with address information and PK of AddressID. The second Table is "Customer" with customer information and PK of CustomerID and FK of CustomerAddressID. All customer personal information is in the "Customer" Table and all address information is in the "Address" Table.

    Problem: Construct and execute a SQL query to count the number of customers in each state. The list should be ordered by the number of customers in descending order, then by state in ascending order.

    How do I construct a query script to accomplish this?

    Thank You,
    TL

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Each customer has multiple addresses or each address is shared by multiple customers? No reason to separate them if none of those are true.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •