0

I need to store a set of scores in integer (array of scores) for a player. How can I store an array in a single column? I'm using the SQLite database.

1 Answer 1

4

Please don't store multiple values in a single column, it makes for much harder queries. You're best to put in another table with a foreign key back to your first table.

   Table 1
    playerID
    playerName

   Table 2
    scoreID
    playerID
    score

Add multiple rows into table 2 and have the playerID in the second table reference playerID in the first table.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Stimms, this is what I was looking for also, but to store long values (multiple dates)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.