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 7431985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:23:00+00:00 2026-05-29T09:23:00+00:00

What are the best data types to use for a members table and scores

  • 0

What are the best data types to use for a members table and scores table on a mysql database?

I am creating a game in Java which connects to a hosted mysql database. I am unsure of which data types to use for each of the fields.

The fields I have are:

TABLE tMembers

ID INT(11)
firstName VARCHAR(255)
lastName VARCHAR(255)
email VARCHAR(255)
username VARCHAR(255)
password VARCHAR(255)

TABLE tScores

ID INT(11)
SCORE INT(11)
DATE DATETIME

I have heard a few things on SO and just form googling about the efficiency of using VARCHAR(80) for emails etc as emails cannot be longer than this, is this true?

For names, is varchar better than text (as a name cannot contain numbers or symbols, why not just use text?)

Also, for the ID, should I use INT or INTEGER?

Any help is more than appreciated.

  • 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-05-29T09:23:01+00:00Added an answer on May 29, 2026 at 9:23 am

    I have heard a few things on SO and just form googling about the
    efficiency of using VARCHAR(80) for emails etc as emails cannot be
    longer than this, is this true?

    yes, if you define a column as varchar(x), the length of the value you want to save into that column should smaller than x.

    For names, is varchar better than text (as a name cannot contain
    numbers or symbols, why not just use text?)

    varchar contains (Max length) less characters than text, depends on the mysql version you are using. e.g. 5.03+ varchar can contain 65535 characters. but for your requirement, a varchar type for “names” would be ok.

    Also, for the ID, should I use INT or INTEGER?

    as far as my understanding, the INT and INTEGER in mysql are the same. check
    http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
    there you can see:

    MySQL supports all standard SQL numeric data types. These types
    include the exact numeric data types (INTEGER, SMALLINT, DECIMAL, and
    NUMERIC), as well as the approximate numeric data types (FLOAT, REAL,
    and DOUBLE PRECISION). The keyword INT is a synonym for INTEGER, and
    the keywords DEC and FIXED are synonyms for DECIMAL.

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

Sidebar

Related Questions

What's the best data structure (in java) for the task of loading 51 million
What is the best data structure to store an oracle table that's about 140
I wonder what is the best C# data structure I should use to sort
Which data-access model has the best performance and speed for a C# Winforms application?
I was wondering what would be the best data structure(s) to use for the
I'm working on a MySQL database which will create a Today at list and
Storing data in Azure Table Services via TableServiceEntity you're limited to usual basic types
I know that SQL Server does not have boolean data type and your best
What's the best data structure for a 2D array of size unknown x 2.
What would be the best data structure to store all the words of a

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.