1. Bible as EDS Database

Okay, I've got a 5+MB EDS (EuSQL) database formatted thusly:

1. unique verse ID (1-31102)
2. book name
3. chapter #
4. verse #
5. text

What's the fastest way to look up, say, "Revelation 21:14," using an SQL
query or the EDS way?

new topic     » topic index » view message » categorize

2. Re: Bible as EDS Database

If you're using EDS, create a secondary key as {Book name, chapter,
verse, unique verse ID} and search on the secondary key.  Although, if
this is your primary application, you may just be better off making the
primary key {Book name, chapter, verse} and using the unique verse ID
only for true SQL requirements.

>>> cklester at yahoo.com 09/08/2003 3:30:09 PM >>>


Okay, I've got a 5+MB EDS (EuSQL) database formatted thusly:

1. unique verse ID (1-31102)
2. book name
3. chapter #
4. verse #
5. text

What's the fastest way to look up, say, "Revelation 21:14," using an
SQL
query or the EDS way?

new topic     » goto parent     » topic index » view message » categorize

3. Re: Bible as EDS Database

--- "C. K. Lester" <cklester at yahoo.com> wrote:
> 
> Okay, I've got a 5+MB EDS (EuSQL) database formatted thusly:
> 
> 1. unique verse ID (1-31102)
> 2. book name
> 3. chapter #
> 4. verse #
> 5. text
> 
> What's the fastest way to look up, say, "Revelation 21:14," using an SQL
> query or the EDS way?

Once you have this set up properly in EuSQL, it could be very fast to look up. 
Based on that, here's how I'd recommend setting up your database:

Table: BOOK
ID as integer
NAME as text

Table: VERSE
VERSE_ID    as text
BOOK_ID     as integer with index
CHAPTER     as integer with index
VERSE_NUM   as integer with index
VERSE_TEXT  as text

BOOK_ID should hold the appropriate ID stored in table BOOK.

Then, you could use a query like:

SELECT VERSE_TEXT FROM VERSE INNER JOIN BOOK 
  ON VERSE.BOOK_ID = BOOK.ID
  WHERE BOOK.ID LIKE 'Revelation' AND
  CHAPTER = 21 AND VERSE_NUM = 14;

You could replace the actual values with parameters:

SELECT VERSE_TEXT FROM VERSE INNER JOIN BOOK 
  ON VERSE.BOOK_ID = BOOK.ID
  WHERE BOOK.ID LIKE [the_book] AND
  CHAPTER = [the_chapter] AND 
  VERSE_NUM = [the_verse];

Then you could prepare it using parse_sql(), set the parameters and run the
query:

my_query = parse_sql( "SELECT VERSE_TEXT...." )

-- ...later...
set_parameter( "the_book", "Revelation" )
set_parameter( "the_chapter", 21 )
set_parameter( "the_verse", 14 )
verse_text = run_query( my_query )

EuSQL is pretty good about finding records if they're indexed.  To do it in
EDS, you'd probably want to set up your own indexing, or else use
"Revelation 21:14" as the primary key, since that would actually be a pretty
fast lookup.

Matt Lewis



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: Bible as EDS Database

Sure... Shall I send it to your email address? Or I can post the database
file to my website... Lemme know.

----- Original Message ----- 
From: "Jonas Temple" <jtemple at yhti.net>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Bible as EDS Database


>
>
> C. K.,
>
> Would you be willing to share?  I would like to take a stab at creating
> a concordance/cross-reference.
>
> Jonas
> C. K. Lester wrote:
> >
> >
> > Okay, I've got a 5+MB EDS (EuSQL) database formatted thusly:
> >
> > 1. unique verse ID (1-31102)
> > 2. book name
> > 3. chapter #
> > 4. verse #
> > 5. text
> >
> > What's the fastest way to look up, say, "Revelation 21:14," using an SQL
> > query or the EDS way?
> >
> >
> --^----------------------------------------------------------------
> This email was sent to: cklester at yahoo.com
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: Bible as EDS Database

I can't seem to get it uploaded from here at work... I'll try from home
later. I could try to email it to you. It's only 1.8MB zipped... :)

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu