Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7755293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:31:54+00:00 2026-06-01T12:31:54+00:00

I am just a new beginner in MySQL and I wanted to write the

  • 0

I am just a new beginner in MySQL and I wanted to write the a SELECT statement that returns customers IDs and customer names(alphabetical order) for customers who live in Indiana, Ohio,Michigan, and Illinois, and whose names begin with the letters A or B.

Here is the CUSTOMER_TBL structure using the DESCRIBE CUSTOMER_TBL;

    Name                         Null?                      Type
    -------------------------------------------------------------
   CUST_ID                      NOT NULL                   VARCHAR2(10)
   CUST_NAME                    NOT NULL                   VARCHAR2(30)
   CUST_ADDRESS                 NOT NULL                   VARCHAR2(20)
   CUST_CITY                    NOT NULL                   VARCHAR2(12)
   CUST_STATE                   NOT NULL                   CHAR(2)
   CUST_ZIP                     NOT NULL                   CHAR2(5)
   CUST_PHONE                                              NUMBER(10)
   CUST_FAX                                                NUMBER(10)

Here is my solution.I just need to know if I am correct. thanks

   SELECT CUST_ID,CUST_NAME FROM CUSTOMER_TBL
   WHERE IN('Indiana','Ohio','Ohio','Michigan','Illinois') AND WHERE LIKE(A% OR B%)
   ORDER BY CUST_ID,CUST_NAME
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:31:55+00:00Added an answer on June 1, 2026 at 12:31 pm

    Your CUST_STATE is a CHAR(2) column so I assume that it contains state codes, not state names. So instead of Indiana, Ohio etc you should use state codes:

    SELECT CUST_ID, CUST_NAME
    FROM CUSTOMER_TBL
    WHERE CUST_STATE IN ('IN','OH','MI','IL') AND (
        CUST_NAME LIKE 'A%' OR
        CUST_NAME LIKE 'B%'
    )
    ORDER BY CUST_NAME
    

    Correct the state codes in case they are wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Scala, just started learning, so this is basic beginner question.
I am just new to programming in Unix and have a small issue that
I'm somewhat new to OOP with C++, so I'm hoping that I've just made
I am just a beginner in php and have a PHP script (that i
I'm a beginner in Grails development. I want to make a new simple MySQL
I have just discovered mysql and mysqli, so I'm really a beginner here. I
I'm just new to Zend Framework. Currently what I'm trying to do is when
I'm just new to Zend and currently I'm trying to add a dash(-) to
i'm just new to iOS Programming, so appreciate for any help. I'm trying to
I'm just new to creating and launching web sites and i've hit a stumbling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.