Scriptures Database

A while ago I managed to put the entire Standard Works of the Church of Jesus Christ of Latter-Day Saints into a DB schema of my creation, in a MySQL database. This was very labour-intensive, although I was able to find a text-based version of these scriptures and convert it into one large table.

I then had to design a schema that would enable me to create a web-based set of quizzes, exercises and other resources for mastering the scriptures. Back then I had no idea how I would write that program, beyond that I would use PHP and MySQL, or maybe Ruby on Rails.

Over a year later, I am working for Moodle and this Learning Management System is the perfect framework in which to build these exercises.

For the benefit of any developer out there who wants a clean, UTF-8 encoded database with the Bible, the Book of Mormon, the Doctrine and Covenants and the Pearl of Great Price, I am making these available as a compressed SQL dump in the next paragraph. Be aware that these files are very large, and I don’t have a lot of disk space on this server.

Download the sql dump file.

DB Schema

The DB schema is quite complete. Here is a general description:

volumes

The top-level table: 5 entries representing the 5 volumes of scriptures.

books

The 87 books of scriptures split into 5 volumes. They are linked to the volumes table.

chapters

All 1,581 chapters, linked to the books table.

verses

All 41,964 verses of scriptures, linked to the chapters table.

scriptures

These refer to arbitrary groupings of verses, usually teaching a single doctrine. All 100 scripture masteries are recorded in this table, with all their additional data:

  • reference (the actual scriptural reference)
  • historical background
  • doctrine
  • missionary application
  • hint (a simple hint for students who struggle to guess the scripture)

You can your own favourite scriptures in this table, there is really no limit to how many you can put. It is also easy to expand the table with more data about each scripture.

Note that entering rows in this table alone will not work unless you can parse the ‘reference’ field and grab the actual verses from it. For coding simplicity, I use an intersection table, described below:

script_verses

Associates a number of verses with each scripture.

sets

You can group your scriptures into arbitrary scripture sets. For example, the data set in the attached SQL dump has a scripture set entry for each Scripture Mastery set.

script_sets

Associates a number of scriptures with each scripture set

keywords

A number of keywords. I haven’t put many in the data set, but these would typically resemble the list of words found in the topical guide or Bible dictionary.

script_keywords

Associates a number of keywords with scriptures. This is a form of tagging.

questions

Students can use the scriptures to answer important life and gospel questions. Formulate your questions in this table.

script_questions

Associates questions with scriptures. The idea is that a number of scriptures may adequately answer a question, and each scripture may answer a number of questions (many-to-many relationship).

The students and students_score tables are not being used, they are just there in case you wish to develop your own LMS around the scriptures tables.

AttachmentSize
scriptures.tar.bz21.56 MB