Coding and Databases

So, I’m attempting to create an app but I feel very much lost, doing searches in Google.

I was learning some Python but realized I need a database for the app. I tried looking up database and was confronted with several varieties. I decided to stick with mysql, since I have some classroom experience with MS SQL. However, I’m feeling frustrated with trying to understand how to create a database, tables, inputting and manipulating data, etc.

I guess what I’m looking for are simple tutorials about databases, mainly mysql in relation to Python. Thanks in advance…


1 Like

There is an HTML front end for MySQL which may help. I can’t recommend any as I’m fully entrenched in MS SQL Server.

Yes, I’ve used PHPmySQL when creating databases before. It isn’t ideal, you can’t actually model your database, but you can create it using a GUI, as opposed to CREATE TABLE statements.

Using a script is better, if you can do it, because you can always change the script and re-run it and if you need to move it to another server, you just run the script. That said, ISTR that phpmysql could generate a script.

There is a modelling tool for MySQL, where you can throw the tables onto a page and link them together, add fields, edit properties etc. and it would generate the CREATE-script. I haven’t used it for a decade, or so though.

Edit: It seems to offer a lot more than it used to. It was purely a visual modelling tool back when I used it, now you can create queries etc. in there as well.

I did some googling… came across this video. It’s 8 hours, so it’s probably not trivial, but I have never watched it so I don’t know if it will be helpful or not. I will leave that on you to report back:

A lot of developers like to use an embedded database, and for that the frequent choice is SQLite. If you want something to play around with to test ideas in a GUI and generate some of the SQL for you, you could look into:

1 Like

I’d start with some kind of SQL based database like MySQL or SQLLite or postgress. Python has a library or two to connect to those databases.

I’d also try to keep it as simple as possible, like if you can get away storing your data as a file (look up python pickle) it might be easier than learning full fledged DB stuff. But if you wanna be a prof. dev you’ll need to learn DBs eventually.

My latest side project app I build using python and flask and it just writes state to a file. I’m confident it’ll only really have one client that ever writes anything so no reason to incur all the overhead associated with a real DB.

Apps are increasingly storing structured data in JSON files these days, but there is a point where this gets unwieldy.

Wow. I’m impressed by responses I’ve received for this question.

@Pommster, I’ll research more about HTML front end for MySQL. As for JSON files, I think I’ll stay from them for now.

@big_D, I may consider using the modeling tool, at least to start the database.

@PHolder, I’ll be sure to bookmark and watch the video.

@mampersat, I’ll take your suggestion to consideration. I’ll need to look at the data I have and see about making it simple to manipulate.


I just stumbled across this, it’s interesting how many databases are in this list:

Oracle is a pig. Can’t believe it’s so popular. Am really liking the NoSQL databases like MongoDB. Wish we could use it at my work place as it would suit a lot of the documents we handle a lot better than SQL Server.