Books have a secondary directory in the database how to store them.


  
  
  

  
  
  

how to store a catalog like this?
I want to have a book table (book table, book title, introduction, cover, etc.)
articleOne association table (book and article id association table, book id, first-level article catalogue id)
articleTwo association table (first-level article catalogue and second-level article catalog id, first-level article catalog id)
check articleOne table first. Find out the first-level article directory id, and then according to the first-level article directory id to check the articleTwo table, find out the second-level article directory id, and then find out the article title according to id to article. I hope the gods can advise
whether the mysql data inventory string is the same as storing numbers that occupy memory?

Mar.24,2021

directory just put a table on it
id name bookid acticleid pid
first-level directory pid is 0 second-level directory pid is first-level directory id

in addition, the size occupied by mysql field types
https://dev.mysql.com/doc/ref.
take a look at the document directly

Menu