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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:34:31+00:00 2026-05-23T12:34:31+00:00

I am a database beginner, I met a problem during my study. I am

  • 0

I am a database beginner, I met a problem during my study.

I am now going to update one table of my database by importing a text file through phpMyAdmin.
Everything worked great except for handling with rows that has same customer_ID.

The row has a field called “customer_ID”, and I cannot make this a primary key, since the initial text file used to populate the database contains multiple rows for a single customer_ID, so database must allow multiple rows for one user id.

I populated the database with the import text file, no error. However, now I need to update the database with an update text file, the customer_id within the update text file are all already existed(populated) in the database, so if I update the database with this updated text file(through the “import” function in PhpMyAdmin), the existing rows with the same customer_ID will not be updated, but another row with the same customer_ID will be created, which is not exactly what I want.

I think this is a dilemma, if I could make the customer_id a primary key, the update process will work perfectly, but since I need to allow customer_id appearing in multiple rows in the database populating process, so I couldn’t make customer_id a primary key.

Please pardon for the trivial question.I wonder if experts could give me some suggestion or some related readings? Thanks in advance for the help.

  • 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-23T12:34:32+00:00Added an answer on May 23, 2026 at 12:34 pm

    You need to make your update file follow this sort of format:

    UPDATE table SET field1 = value, field2 = value WHERE customer_ID = existing value
    

    However where you have multiple rows with the same customer id that will update all the rows, which is probably not what you want. So you need another id field (as Ray says), which is unique, and update using that id

    ...WHERE id = existing value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What database should a beginner use in the C language? Can I use MySQL?
I'm a beginner with SQL and am working on one of my first databases.
Which Database table Schema is more efficient and why? Users (UserID, UserName, CompamyId) Companies
This database will store a list of children. But the problem is, they will
I am a beginner in database field and this question might sound too stupid
I'm quite a beginner at database design. I have two problems that I'd like
this is a beginner's question: Every tutorial I've seen on CoreData focusses on database-backed
I'm just a beginner in SQL Server database development and was wondering which authentication
I would like to update my SQL lite database with the native update-method of
i am a hibernate-beginner and have a problem when trying to join 2 tables

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.