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

  • Home
  • SEARCH
  • 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 4020616
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:15:01+00:00 2026-05-20T10:15:01+00:00

this might be a simple question but when creating a database can you instead

  • 0

this might be a simple question but when creating a database can you instead assign what the id will be instead of having it auto increment?

what i want to do is make a database with people where i can do a query using their phone number to get more information about that person in other columns.

can that be done or can i do the same thing creating the database with an auto incrementing id?

  • 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-20T10:15:02+00:00Added an answer on May 20, 2026 at 10:15 am

    Android uses sqlite databases; they come with a “hidden” id column that autoincrements and which gets linked to any INTEGER column you define as a PRIMARY KEY.

    So you can’t get rid of the additional auto-incrementing column (it’s used internally by sqlite). But nothing keeps you from just defining your own PRIMARY KEY column that is NOT of type INTEGER. If you do that, the hidden _id column stays hidden.

    So, you can do:

    CREATE TABLE people (
       phone_number VARCHAR(12) PRIMARY KEY,
       firstname VARCHAR(32),
       lastname VARCHAR(32),
       ...
    );
    

    and use phone_number as the primary key in this table without ever worrying about the hidden _id column.

    However, I also suggest (as Farray does) that you use an integer ID. The phone number is a very bad primary key, as people’s phone numbers may change and this means you will have to update lots of tables when one does. Also, if you don’t store international phone numbers, your phone numbers may not be unique and therefore fail as primary keys.

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

Sidebar

Related Questions

This might be a simple question, but I've been looking around and can't find
This might sound like a little bit of a crazy question, but how can
This might be a little hard to explain, but I will try. I want
this might sound like a daft question but I can't seem to find a
So this might be really simple, but I haven't been able to find any
This might seem like a stupid question I admit. But I'm in a small
This might be an interesting question. I need to test that if I can
This might be an odd question, but when I scale my image in C#
This might be a stupid question but if there's a better or proper way
This is probably a super simple question, but I'm struggling to come up with

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.