The maximum length of colum can have a mysql table ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

The maximum length of colum can have a mysql table ?

1st Oct 2021, 6:07 PM
Arif Nasery
Arif Nasery - avatar
6 Answers
+ 2
Are you asking the maximum amount of columns sql table can have? Or maximum length of sql column? If first, 4096 columns If second, it depends on the type your column has
1st Oct 2021, 6:13 PM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 1
according to google: MySQL has hard limit of 4096 columns per table, but the effective maximum may be less for a given table. The exact column limit depends on several factors: The maximum row size for a table constrains the number (and possibly size) of columns because the total length of all columns cannot exceed this size.
1st Oct 2021, 6:09 PM
Nima
+ 1
Arif Nasery , Shouldn't cause any problems in a long time....
1st Oct 2021, 6:23 PM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
0
What is your suggestion? I want to add a column to my database every month in order to record the student's fee in a dynamic way. Will not cause problems in the future.
1st Oct 2021, 6:16 PM
Arif Nasery
Arif Nasery - avatar
0
In one year just 12 column for a table will added dynamically. and the type of data is tinyint
1st Oct 2021, 6:17 PM
Arif Nasery
Arif Nasery - avatar
0
#Aleksi If u know a good desing for a fees paying system in MySQL can help me ?
1st Oct 2021, 6:27 PM
Arif Nasery
Arif Nasery - avatar