【发布时间】:2010-09-18 20:49:44
【问题描述】:
"question_id": 58640
"tags": ["polls", "fun", "quotes"]
"title": "Great programming quotes"
"question_id": 184618
"tags": ["polls", "fun", "comment"]
"title": "What is the best comment in source code you have ever encountered?"
"question_id": 3734102
"tags": ["c++", "linux", "exit-code"]
"title": "Why cant' I return bigger values from main function ?"
"question_id": 2349378
"tags": ["communication", "terminology", "vocabulary"]
"title": "New programming jargon you coined?"
"question_id": 3723817
"tags": ["open-source", "project-management", "failure", "fail"]
"title": "How to make an open source project fail"
"question_id": 3699150
"tags": ["testing", "interview-questions", "job-interview"]
"title": "Interview question please help"
这只是我使用SO API得到的一些问题的文本摘录。
为了使这个可查询,我想使用SQLite 来存储数据。
我应该如何存储 tags 列?
由于这里对 SO 的限制是五个标签,我可以使用五列 tag1、tag2 ...,但我认为可以做一些更优雅的事情。可以扩展到任意数量的标签,并且还可以处理基本查询,例如
select title from table where tag has "c++" and "boost" but not "c"
【问题讨论】:
标签: database database-design sqlite