0

Hi everyone, i am designing database for books application. I have main table Books and its child table is Chapters, chapters child table is Sections, So here is the problem, that some chapters has also divided into 3 steps chapter Name -> Part 1 -> Divisions 1 and each chapter consist on sections and sections also devided on to futher 3 steps Section -> sub Sections.

Question: How can i manage chapter's parts and divisions because it is not compulsory that each chapter has its parts and and divisions and same question is for sections becouse some sections has sub sections or some sections are not.

Below i mention the structure of the book.

Book Name:
    Chapter 1
        section 1
        section 2
    chapter2
        Part 1
            Devision 1
                Section 1
                section 2
                    sub section 2(1)
                    sub section 2(2)
            Devision 2
                section 1
                section 2
            Devision 3
                section 1
                section 2
        Part 2
            section 1
            section 2
    chapter3
        section 1
        section 2

So how can i do this in mysql ?

2
Contributors
1
Reply
17
Views
4 Years
Discussion Span
Last Post by pritaeas
0

Book, chapter, part, devision, section and subsection should each have their own table. Records in it should point to their parent (foreign key).

You should always have a part and devision, but you can hide it from showing if there is only one child in it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.