本文介绍了在SQL数据库中存储电子表格数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将电子表格数据存储在数据库中,所以现在我正在使用键/值模式来存储相同的数据,但是如果数据很庞大,则花费太多时间从数据库中检索。
任何人都有最好的方法来做同样的事情。 Google如何保存他们的电子表格数据?



通常我必须在页面上显示30到40列和10,000行,页面大小为500或1000,用于分页。数据是针对含有价格的订单项。



我目前的数据库结构如下。



列表
Column_Id int
Column_Name nvarchar(50)

Column_Type nvarchar(50)



价值内容表
criteria_id int
column_id int
row_id int
column_contents nvarchar(100)

解决方案

存储电子表格的天真架构:

 创建表电子表格

id INTEGER主键,
名称TEXT UNIQUE not null
);

创建表单元格

id INTEGER主键,
spreadsheet_id INTEGER NOT NULL参考电子表格(id),
row INTEGER not null,
col INTEGER not null,
content TEXT NOT NULL
);


I want to store the spreadsheet data in database, so right now i am using key/value pattern to store the same but its taking too much time to retrieve it from data base, if the data is huge.Do anyone has the best way to do the same. How Google saves their spreadsheet data?

Usually I have to show 30 to 40 columns and 10,000 rows on the web page with page size 500 or 1000 for pagination. Data is for line item with pricing.

My current database structure is as below.

Column TableColumn_Id int Column_Name nvarchar(50)
Column_Type nvarchar(50)

Value Content Tablecriteria_id int column_id int row_id intcolumn_contents nvarchar(100)

解决方案

A naive schema for storing a spreadsheet:

create table spreadsheet
(
id INTEGER primary key,
name TEXT UNIQUE not null
);

create table cell
(
id INTEGER primary key,
spreadsheet_id INTEGER NOT NULL REFERENCES spreadsheet(id),
row INTEGER not null,
col INTEGER not null,
content TEXT NOT NULL
);

这篇关于在SQL数据库中存储电子表格数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 16:27