views:

103

answers:

3

Hello..

I am working on a personal project where I need to manipulate values in a database-like format.

Up until now I have been using dictionaries, tuples, and lists to store and consult those values.

I am thinking about starting to use SQL to manipulate those values, but I don't know if it's worth the effort, because I don't know anything about SQL, and I don't want to use something that won't bring me any benefits (if I can do it in a simpler way, I don't want to complicate things)

If I am only storing and consulting values, what would be the benefit of using SQL?

PS: the numbers of rows goes between 3 and 100 and the number of columns is around 10 (some may have 5 some may have 10 etc.)

+3  A: 

No, I think you just stick to dictionaries or tuples if you only have rows around 100

S.Mark
+8  A: 

SQL is nice and practical for many kinds of problems, is not that hard to learn at a simple "surface" level, and can be very handy to use in Python with its embedded sqlite. But if you don't know SQL, have no intrinsic motivation to learn it right now, and are already doing all you need to do to/with your data without problems, then the immediate return on the investment of learning SQL (relatively small as that investment may be) seem like it would be pretty meager indeed for you.

Alex Martelli
+1, thats better suggestion
S.Mark
+1 for mentioning sqlite.
Santa
thanks.. I guess I should then stick with the tools python have until the application needs something that I cant do with only python variables..By the way, what types of scenarios could put me in a position where I have to absolutely use SQL??
axl456
@axl456, "absolutely" is a strong word: these days, there are very powerful non-relational databases (much harder to use than relational ones, but designed to scale to much loftier heights) so it's hard to think of a project that _absolutely_ requires using a relational database, unless such a constraint is externally imposed (by a customer, existing code, etc). Of course, for a vast range of problems (too large to solve sensibly "in memory", too small to "absolutely" need the multi-terabyte scale of modern "nosql" DBs), Sql is often the **most sensible** approach -- a different issue;-).
Alex Martelli
@alex martelli: thanks again.. am reading about the module sqlite3 in python, maybe i'll give it a try.. so far the only pro of using sql is that the database is not load entirely in memory, but for this case because the data is less then 10Kb i dont find sql useful..
axl456
+3  A: 

SQL is useful in many applications. But it is an overkill in this case. You can easily store your data in CSV, pickle or JSON format. Get this job done in 5 minutes and then learn SQL when you have time.

Wai Yip Tung