SA-MP Forums Archive
Small SQL discussion - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: General (https://sampforum.blast.hk/forumdisplay.php?fid=13)
+--- Thread: Small SQL discussion (/showthread.php?tid=594499)



Small SQL discussion - TwinkiDaBoss - 19.11.2015

Okay so Ive stumbled across the problem, I didnt want to make thread inside Scripting Help since this is more discusssion than a problem, I dont need help just wondering what is the best way for it.
So I am about to create something that would require 100 new lines atleast inside SQL table. Im talking about stuff like
"Char_Achievement INT 10" etc..
Now there is going to be roughly 100 variables I have to store for this system, what is the best way to do it?

I have to keep track of each player of everything they do. Now this includes, how many hours they have slept, how many times they have been smuggling drugs etc. etc. etc.

Now my question remains, best way to do it?

A: Create it all under the same place where I store all Player-Character-Account based stuff (Table "Players")
B: Create a new table for this system (Example, Table achievements that the SQL is going to read based on Account ID)
C: Something else?


EDIT: Im wondering about this since besides this Ill have another 50-100 variables Im saving that are Player Bound inside table Players, so not sure if its good or not to store it all under single table or split it up. Basically if you dont get my idea, imagine you have table called "players" with 200 variables, would you split it or keep it all together?


Re: Small SQL discussion - Abagail - 19.11.2015

The best way to do it is to have seperate tables for things such as achievements.


Re: Small SQL discussion - Sew_Sumi - 19.11.2015

I was pondering something to do with this recently.


Re: Small SQL discussion - Krokett - 19.11.2015

Database normalization is what you're after. Make sure you read into this, it will be worth it.


Re: Small SQL discussion - TwinkiDaBoss - 19.11.2015

Yeah, I was wondering all the time, table for each player with over 100 items in it wouldnt be healthy for SQL or script at all, thanks guys