How To Create or Stabiles relationship between two tables in FMDB?

落爺英雄遲暮 提交于 2019-12-23 16:08:06

问题


I'm new with iOS Development and i'm also new with SQLITE database. I used FMDB as a wrapper in my project and i have two tables 1) ParticepentsTable and 2) ExerciseTable.

ParticepentsTable contains 4-Rows like Id, Name, Gender and Exercise_Id and the ExerciseTable contains 2-Rows i.e. Id and exercise_Name.

My questions are as follow:-

1) I want to make a Foreign-key Relation between Table-1 & 2 using FMDB, so that i can store the exercise according to Participants choice.

2) Or any other way to select or insert exercises according to the participants?

3) Can I use Join to fetch data from both the tables according to the Participants id?

Any one can help please!

Tutorial link is more appreciated! Thanks!


回答1:


By looking at your other question I guess you already sorted this out. Here's my answer anyway. In iOS development it's uncommon to use SQLite directly, instead we use CoreData, which is an API that serializes data to SQLite (or you can configure it to serialize it to binary or XML too).

Here are some links for you:

SQLite

CoreData

Hope this helps!



来源:https://stackoverflow.com/questions/18973648/how-to-create-or-stabiles-relationship-between-two-tables-in-fmdb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!