Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a limit to how many tables you can have in a database?

Is there a limit to how many tables you can have in a database? Would this be considered bad programming or whatever? I have a lot of user information and I'm wondering if it would be ok to have many tables?

like image 998
John Doe Avatar asked Apr 05 '11 23:04

John Doe


People also ask

How many tables can I have in a database?

You can create up to 2,147,483,647 tables in a database, with up to 1024 columns in each table. When you design a database table, the properties that are assigned to the table and the columns within the table will control the allowed data types and data ranges that the table accepts.

How many tables in a database is too many?

The number of tables is limited only by the number of database objects, currently 2, 147, 483, 647. A couple of hundred tables isn't going to make a difference to anything except the clarity of your data model.

What is the limit of database?

A Database Limits Limits exist on several levels in the database. There is usually a hard-coded limit in the database that cannot be exceeded. This value may be further restricted for any given operating system.

Can a database have multiple tables?

Often, it is good database design practice to split a many-to-many relationship between two tables into two one-to-many relationships involving three tables. You do this by creating a third table, called a junction table or a relationship table, that has a primary key and a foreign key for each of the other tables.


1 Answers

If you're considering this question, you should probably change the way you are planning to store data. It is generally considered a bad practice to have a database schema where the number of tables grows over time. A better way to store data is to have identifying columns (like a User ID) and use a row for each user. You can have multiple tables for different types of data, but shouldn't have tables for each user.

like image 126
Joshua Avatar answered Nov 16 '22 01:11

Joshua