1. Home
  2. Computer Science MCQs
  3. MySQL
  4. Which data type would you use to store a customer's phone…

Added 27 Jan 2024

Which data type would you use to store a customer's phone number in MySQL?

  1. VARCHAR(10)
  2. INT
  3. CHAR(10) Correct answer
  4. DATE

Correct answer

C. CHAR(10)

17 views

MCQSEXAM

Explanation

CHAR(10) is the expected answer: a phone number is an identifier, not a quantity, so it should be stored as text. An INT would drop leading zeros and cannot hold "+" or dashes, and DATE is irrelevant.

CHAR suits values of fixed length. In real projects VARCHAR is often chosen instead, because international numbers vary in length.

Keep preparing with more Database Management Systems MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More MySQL MCQs

Practise all MySQL MCQs

Similar MCQs