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 8752779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:18:05+00:00 2026-06-13T13:18:05+00:00

I am new to database structure and design. Currently, I am in the process

  • 0

I am new to database structure and design. Currently, I am in the process of creating a course catalog that will match course description according to course name and date. I have sketched one table describing the courses, which include course_code, name and every other relevant information. Then I sketched another table linking those courses to when they will be taught.

I am missing classes that are classified as all_year. Also I am missing a way how to label the courses under a major. Since hypothetically a course can belong to several majors, putting the data from one into the other would force you to duplicate data. Any ideas how I would implement this two things to my tables design? Or suggestion in how to restructure my design. If possible please show me a query to execute in my phpmyadmin DB.

Example of table courses

id serial
course_code text
description text

Example of table course_dates

id serial
course_id serial
year date
semester 

Example of table majors

major_id int
course_id int

So a populated database could contain the following:

Table courses
id course_code description
1  INF1000     "Basic programming"
2  INF1001     "More basic programming"

Table course_dates (0 for spring 1 for fall)

id course_id year semester
1  1         2012 0
2  1         2013 1
3  2         2013 1
  • 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-06-13T13:18:06+00:00Added an answer on June 13, 2026 at 1:18 pm

    To link courses to majors – this is a one to many relationship (one course to many majors) – you want to use a linking table that has this type of structure:

     table courses_majors
     major_id int
     course_id int
    

    Remember to index this table as well – its very important. Then you can populate it and have one course even go to many majors and many course to one major (many to many relationship).

    Then you can run a join on the tables across this table:

    select * from courses left join courses_majors on courses.id = courses_majors.course_id left join majors on courses_majors.majors_id = majors.id

    Of course you can add a where clause, etc.

    The other way is to create a table of majors:

     majors
     id int
     name varchar
    

    Then add a major_id to your courses table – this will just give you a one to one relationship from courses to majors, but many courses can join a major.

    As for Yearly, I would just add a field in the database to account for this, probably a tiny int and just make it 0 or 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to database design, and I haven't found a definitive way to structure
I need to move a old database with an old structure to a new
I am creating a new database to manage wish lists. Solution A: Two tables,
I'm creating a new database in my Activity like this: @Override public void onCreate(Bundle
I am creating a new database model using Entity Framework 4.3 Code-FIrst; using Fluent
Assuming that best practices have been followed when designing a new database, how does
I'm pretty new at MySQL and database structure and I was wondering if anyone
I have a legacy database with a pretty evil design that I need to
I'm working rearchitecting a reporting/data warehouse type database. We currently have a table that
I'm new to mysql and have a choice regarding mysql database structure for my

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.