Learn LINQ to SQL (eight): Inheritance and relationships

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.