Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5962379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:05:50+00:00 2026-05-22T19:05:50+00:00

I’m attempting to design a small database for a customer. My customer has an

  • 0

I’m attempting to design a small database for a customer. My customer has an organization that works with public and private schools; for every school that’s involved, there’s an implementation (a chapter) at each school.

To design this, I’ve put together two tables; one for schools and one for chapters. I’m not sure, however, if I should merge the two together. The tables are as follows:

mysql> describe chapters;
+--------------------+------------------+------+-----+---------+----------------+
| Field              | Type             | Null | Key | Default | Extra          |
+--------------------+------------------+------+-----+---------+----------------+
| id                 | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| school_id          | int(10) unsigned | NO   | MUL |         |                |
| is_active          | tinyint(1)       | NO   |     | 1       |                |
| registration_date  | date             | YES  |     | NULL    |                |
| state_registration | varchar(10)      | YES  |     | NULL    |                |
| renewal_date       | date             | YES  |     | NULL    |                |
| population         | int(10) unsigned | YES  |     | NULL    |                |
+--------------------+------------------+------+-----+---------+----------------+
7 rows in set (0.01 sec)

mysql> describe schools;
+----------------------+------------------------------------+------+-----+---------+----------------+
| Field                | Type                               | Null | Key | Default | Extra          |
+----------------------+------------------------------------+------+-----+---------+----------------+
| id                   | int(10) unsigned                   | NO   | PRI | NULL    | auto_increment |
| full_name            | varchar(255)                       | NO   | MUL |         |                |
| classification       | enum('high','middle','elementary') | NO   |     |         |                |
| address              | varchar(255)                       | NO   |     |         |                |
| city                 | varchar(40)                        | NO   |     |         |                |
| state                | char(2)                            | NO   |     |         |                |
| zip                  | int(5) unsigned                    | NO   |     |         |                |
| principal_first_name | varchar(20)                        | YES  |     | NULL    |                |
| principal_last_name  | varchar(20)                        | YES  |     | NULL    |                |
| principal_email      | varchar(20)                        | YES  |     | NULL    |                |
| website              | varchar(20)                        | YES  |     | NULL    |                |
| population           | int(10) unsigned                   | YES  |     | NULL    |                |
+----------------------+------------------------------------+------+-----+---------+----------------+
12 rows in set (0.01 sec)

(Note that these tables are incomplete – I haven’t implemented foreign keys yet. Also, please ignore the varchar sizes for some of the fields, they’ll be changing.)

So far, the pros of keeping them separate are:

  1. Separate queries of schools and
    chapters are easier. I don’t know if
    it’s necessary at the moment, but
    it’s nice to be able to do.
  2. I can make a chapter inactive
    without directly affecting the
    school information.
  3. General separation of data – the fields in
    “chapters” are directly related to
    the chapter itself, not the school
    in which it exists. (I like the
    organization – it makes more sense
    to me. Also follows the “nothing but the key” mantra.)
  4. If possible, we can collect school
    data without having a chapter
    associated with it, which may make
    sense if we eventually want people
    to select a school and autopopulate
    the data.

And the cons:

  1. Separate IDs for schools and
    chapters. As far as I know, there
    will only ever be a one-to-one
    relationship between the two, so
    doing this might introduce more
    complexity that could lead to errors
    down the line (like importing data
    from a spreadsheet, which is unfornately
    something I’ll be doing a lot of).
  2. If there’s a one-to-one ratio, and
    the IDs are auto_increment fields,
    I’m guessing that the chapter_id and
    school_id will end up being the same – so why not just put them in a single table?
  3. From what I understand, the chapters
    aren’t really identifiable on their
    own – they’re bound to a school, and
    as such should be a subset of a
    school. Should they really be
    separate objects in a table?

Right now, I’m leaning towards keeping them as two separate tables; it seems as though the pros outweigh the cons, but I want to make sure that I’m not creating a situation that could cause problems down the line. I’ve been in touch with my customer and I’m trying to get more details about the data they store and what they want to do with it, which I think will really help. However, I’d like some opinions from the well-informed folks on here; is there anything I haven’t thought of? The bottom line here is just that I want to do things right the first time around.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:05:51+00:00Added an answer on May 22, 2026 at 7:05 pm

    I think they should be kept separate. But, you can make the chapter a subtype of a school (and the school the supertype) and use the same ID. Elsewhere in the database where you use SchoolID you mean the school and where you use ChapterID you mean the chapter.

    CREATE TABLE School (
       SchoolID int unsigned NOT NULL AUTO_INCREMENT,
       CONSTRAINT PK_School PRIMARY KEY (SchoolID)
    )
    
    CREATE TABLE Chapter (
       ChapterID int unsigned NOT NULL,
          CONSTRAINT PK_Chapter PRIMARY KEY (ChapterID)
          CONSTRAINT FK_Chapter_School FOREIGN KEY (ChapterID) REFERENCES School (SchoolID)
    )
    

    Now you can’t have a chapter unless there’s a school first. If such a time occurred that you had to allow multiple chapters per school, you would recreate the Chapter table with ChapterID as identity/auto-increment, add a SchoolID column populated with the same value and put the FK on this one to School, and continue as before, only inserting the ID to SchoolID instead of ChapterID. If MySQL supports inserting explicit values to an autoincrement column, then making it SchoolID autoincrement ahead of time could save you trouble later (unless switching a regular column to autoincrement is supported in which case no issues there).

    Additional benefits of keeping them separate:

    • You can make foreign key relationships directly with SchoolID or ChapterID so that the data you’re storing is always correct (for example, if no chapter exists yet you can’t store related data for such a thing until it is created).
    • Querying each table separately will perform better as the rows don’t contain extraneous information.
    • A school can be created with certain required columns, but the chapter left uncreated (temporarily). Then, when it is created, you can have some NOT NULL columns in it as well.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.