Is there a better data structure than nested dictionaries to create a student database in python?

Viewed 35

I need to create a student database using dictionaries in python. Consequently, I thought of making a nested dictionary to easily make changes. But, I was not sure about the coding efficiency. So, I want to know if there are any other better data structures than nested dictionaries in python or if it is the best way to create a student database.

1 Answers

Would need a lot more information about your use case to give you a meaningful answer. There are many options to choose from both in terms of data structures and databases.

I assume that your student data has relationships to other entities like class and teacher which would be easily modeled in a relational database like postgresql

It can also model hierarchical relationships through a self referencing primary key, or store jsonb columns.

If your question is oriented more toward the data structure itself, could you post a code sample so we could look at what sort of algorithm you're attempting on the data? Nested dictionaries are common, in most cases it's not an issue.

Related