Forum Table structure
To demonstrate inheritance and relationships, we create a forum database that creates three tables in the database:
1, Forum category table dbo. Categories:
| Field name |
Field type |
Can be empty |
Note |
| CategoryID |
Int |
NOT NULL |
identity/PRIMARY Key |
| CategoryName |
varchar (50) |
NOT NULL |
|
2, Forum table dbo. Boards:
| Field name |
Field type |
Can be empty |
Note |
| Boardid |
Int |
NOT NULL |
identity/PRIMARY Key |
| Boardname |
varchar (50) |
NOT NULL |
|
| Boardcategory |
Int |
NOT NULL |
CategoryID of the classification table of the corresponding forum |
3, Forum theme table dbo. Topics:
| Field name |
Field type |
Can be empty |
Note |
| TopicID |
Int |
NOT NULL |
identity/PRIMARY Key |
| Topictitle |
varchar (50) |
NOT NULL |
|
| Topiccontent |
varchar (max) |
NOT NULL |
|
| Parenttopic |
Int |
Null |
If the post is the subject of this field is a null, otherwise it is the subject ID |
| Topictype |
tinyint |
NOT NULL |
0– Theme Post the reply post |