PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, April 19, 2022

[FIXED] What Should be database structure to create excel sheet like view? mean should tables store in json format or create tables for cells,rows and columns

 April 19, 2022     database, laravel, monday.com, mysql, sql     No comments   

Issue

Hi Everyone,

i want to create a board and all board will contain groups and each groups have tables(Rows and Columns), so should i save tables(Rows and Columns) as a json format or create separate table for rows,columns and cells etc?

i watn to create a system like monday.com


Solution

Depends on what kind of database you are using, if its a document database then JSON is the natural way, in a SQL database, the better way would be to have a table representing the rows, and having a separate table representing column mapping, this will give you the flexibility to add columns at will.

For example:-

Row Table

| id | details       |
|----|---------------|
| 1  | row_1_details |
| 2  | row_2_details |

Column Table

| id | column_name | column_value | row_id |
|----|-------------|--------------|--------|
| 1  | col_1       | skjdjks      | 1      |
| 2  | col_2       | jslkds       | 1      |
| 3  | col_1       | dhkshd       | 2      |


Answered By - vidit mathur
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing