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

  • Home
  • SEARCH
  • 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 6682711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:44:16+00:00 2026-05-26T04:44:16+00:00

I have my app using core data with the data model below. However, I’m

  • 0

I have my app using core data with the data model below. However, I’m switching to a standard database with columns and rows. Can anyone help me with setting up this new database schema?

enter image description here

  • 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-26T04:44:17+00:00Added an answer on May 26, 2026 at 4:44 am

    First of all you need to create tables for each of the Entities and their attributes (note I added “id” to each of the tables for relationships):

    1. Routine (name, timestamp, id)
    2. Exercise – this looks like a duplicate to me, so leaving one only here (muscleGroup, musclePicture, name, timeStamp, id)
    3. Session (timeStamp, id)
    4. Set (reps, timeStamp, unit, weight, id)

    Now that you have tables that describe each of the entities, you need to create tables that will describe the relationships between these entities – as before table names are in capitals and their fields are in parenthesis:

    1. RoutineExercises (routine_id, exercise_id)
    2. SessionExercises (session_id, exercise_id)
    3. ExerciseSets (exercise_id, set_id)

    That’s it! Now if you need to add an exercise to a routine, you simply:

    1. Add an entry into Exercise table
    2. Establish the relationship by adding a tuple into RoutineExercises table where routine_id is your routine ID and exercise_id is the ID of the newly created entry in the Exercise table

    This will hold true for all the rest of the relationships.

    NOTE: Your core data model has one-to-many and many-to-many relationships. If you want to specifically enforce that a relationship is one-to-many (e.g. Exercise can only have 1 routine), then you will need to make “exercise_id” as the index for the RoutineExercises table. If you want a many-to-many relationships to be allowed (i.e. each exercise is allowed to have multiple routines), then set the tuple of (routine_id, exercise_id) as the index.

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

Sidebar

Related Questions

Im using a Core Data model for my iPhone app. I have been looking
I have developed my app using core data. It works fine in the simulator.
I'm using core data in my app. I have two entities that are related:
I'm using Core data in an iOS project. I have the data model setup
I'm considering using Core Data for an app I'm writing. However, after reading the
I've got a document based App using Core Data, and have a tableView which
I'm working on a gym logging app using Core Data model. I'm trying to
I have an App using UITableViews and fetching data from a server. I am
I have a Core Data model in which a Task entity includes an optional
I have setup Core Data for an iPhone app without an instance of NSFetchedResultsController.

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.