python - Problems with personal blog database design
typecho
typecho 2017-06-28 09:23:13
0
3
684

I need to design a personal blog, and I have encountered difficulties in database design.
The function I want to implement is: ordinary users can only comment on blogs. The administrator (that's me) can log in, post blogs, and reply to comments.

Originally designed, the tables have User, Admin, Post, and Comment.
But User and Comment are one-to-many, and Admin and Comment are also one-to-many. This will make it messy.

So I want to merge the User table and Admin table into one table, called User, but the administrator needs a password field, but ordinary users do not need it. There is only one administrator, but there are many ordinary users, so the design is wasteful. a field.

Please give me some suggestions on how to design the User and Admin tables.
In addition, I want to learn database design. Please recommend some information. Because I have seen a lot of information on database operations, but how is the database designed?

typecho
typecho

Following the voice in heart.

reply all(3)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!