Get God into Your Database!

Lo and behold! The bible database contains two full translations of the bible (King James and Basic English), as in both Old and New Testaments as well as the Apocrypha. Verses are on one row each, with cap/book/verse columns in the table to find your way around. And if that's not enough, I've now added three translations of the Koran (or Qur'an if you prefer) in a separate Koran database.

So if you want to get God into your database, and have MySQL 4.1 or higher, then get downloading.

contents gzip file plain file
Bible bible.mysql.gz
3 MB
bible.mysql.txt
11 MB
Koran koran.mysql.gz
1.7 MB
koran.mysql.txt
5 MB

Once you've done that, you might wish to look at the Instructions to get it all working especially if you're new to MySQL. Otherwise get with the Holy SQL.

SQL Koran is Here

I'm pleased to offer the Koran (Qur'an) as a MySQL database too. I've taken the three translations by Abdullah Yusuf Ali, Marmaduke Pickthall, and Mohammad Habib Shakir from the Project Gutenberg version (see http://www.gutenberg.org/etext/16955 ). I've loaded them into a koran database containing 4 tables (one per translation and an extra one called 'books' with the chapter names). To use it, just download either the zipped or plain text version, and whizz through the mysql client program. There's a CREATE DATABASE koran; command in the dump file, so you don't even need to do that.

Certificate Arrives

Much faster than I anticipted, a bunch of goodies arrived in the post from MySQL. They said allow 4 - 6 weeks for the certificate to arrive, but it actually took a mere eight days, not bad considering it had to be mailed from America to London. It's a little surprising when an organisation I normally deal with electronically actually sends a letter. A real-live employee even filled in the custom declaration on the front of the envelope.

So what was in the envelope?

MySQL 5.0 Developer Test Part II

And it came to pass. Or rather I just passed the second test in the MySQL Developer exam. One of the nice things about doing Pearson Vue's system is you get instant feedback, so when I clicked the 'End Exam' button the next screen said 'You passed'. No congratulations or any namby-pamby stuff like that though. I'm a little sceptical whether the next stage will work: the folks at Sun/MySQL HQ have to realise that I passed both tests and send 40 naked virgins er, sorry, I mean a certificate to my home address.

MySQL 5.0 Developer Test Part I

I just took part one of my MySQL 5.0 Developer test and I'm delighted to say I passed.

I was a little apprehensive before taking the test because, try as I might, there was general information about the test I just couldn't find out about. For example

  • I knew there were 70 questions in 90 minutes, but was the time limit going to feel pressurized or generous?
  • Were the questions mainly the 'Gotchas', or were they more of the general everyday stuff?

Functions: What is the Goddiest line in the bible?

To be sure, the word God occurs a fair few times in the bible. 4117 times at least.:

SELECT count(*) FROM bible WHERE line RLIKE 'god';
+----------+
| count(*) |
+----------+
|     4117 |
+----------+

In fact 4117 is a tad on the low side. The count(*) query scores 1 point for each line with the word 'god' in it, but plenty of lines mention god twice or more. Not to mention all the other ways of naming God: Lord, Jehovah, our Father etc.

MySQL Client / Server Concepts

A quick quiz on some of the basic MySQL stuff: where the conf files are kept, types of connection. Relates to Chapter One in the Certification Guide.

Michelangelo gets in on the act

Hope you like the site's new theme. It was created by Joe Thompson of Ventura Cottage. He used Michelangelo's painting from the Sistine Chapel, God Creates Adam, blended in with a screen shot from a mysql client. The theme is a modification of Drupal's Garland theme.

Triggers: Who's Been Tampering With My Database?

The bible is essentially a read ony database. Users really shouldn't go around updating verses to suit their own purposes. So how about using MySQL's triggers to do a little snooping on anybody trying to tamper? The idea is anyone who attempts to update a row in the bible will have their change reported in the meddlers table.

First we'll create the meddlers table.

DROP TABLE IF EXISTS meddlers;

CREATE TABLE meddlers
(
  autokey INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  user VARCHAR(255),
  `DATE` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,

Fulltext Indexes

Fulltext Indexes were a new feature in MySQL 5.0, and they're meant to be a wonderful way of searching through large tables with Text column types (or Varchar, for that matter).

I was curious to see how a Fulltext search differed from a regular pattern match search. So I set up Fulltext Indexes on the line column (i.e. the bit with the text in). The syntax for searching through Fulltext Indexes involves the keywords MATCH and AGAINST. Let's find out how times Abraham is mentioned in the bible, first using the Fulltext Index:

 

Syndicate content