Bible – Cross Reference – Study – Using “scrollmapper/bible_databases” – Use Data

Background

Let us create a Stored Procedure that will identify Cross References for a bible verse.

Code

Stored Procedure

bible.crossReferenceFetch

SQL


use bible;

DELIMITER //

drop procedure if exists bible.usp_crossReferenceFetch;
//

create procedure bible.usp_crossReferenceFetch
(
      bookName      varchar(30)
    , chapterNumber smallint
    , verseNumber   smallint
)

begin
    

    /*
     * scrollmapper //bible_databases
     * https://github.com/scrollmapper/bible_databases 
     */
    select distinct
    
              tblKeyCR.n as bookName
    
            , tblBibleRefCR.c as chapterNumber
    
            , tblBibleRefCR.v as verseNumber
    
            , tblBibleRefCR.t as text
            
            , tblCRP.sv as votes
          
    from    bible.t_kjv tblBible
    
    inner join bible.key_abbreviations_english tblKeyAbbrev
    
            on tblBible.b = tblKeyAbbrev.b
            
    inner join bible.cross_reference tblCRP
    
            on tblBible.id = tblCRP.vid
    
    inner join bible.t_kjv tblBibleRefCR
    
            on tblCRP.sv = tblBibleRefCR.id
    
    inner join bible.key_english tblKeyCR
    
            on tblBibleRefCR.b = tblKeyCR.b
            
    where  tblKeyAbbrev.a = bookName
    
    and    tblBible.c = chapterNumber
    
    and    tblBible.v = verseNumber
    
    order BY
    
            tblCRP.sv desc
    ;
    

end;
//

DELIMITER ;


SQL – Invoke

Outline

Let us fetch cross-references for Philippians 4:13

I can do everything through him who gives me strength.

SQL


/*
    Philippians 4:13
*/
-- set @bookName      = 'Philipians';
set @bookName      = 'Philippians';
set @chapterNumber = 4;
set @verseNumber   = 13;

call bible.usp_crossReferenceFetch(
      @bookName
    , @chapterNumber
    , @verseNumber
);

SQL – Output

Image

Text

 

# Book Chapter# Verse # Text Book Chapter:Verse
1 Colossians 1 10 Strengthened with all might, according to his glorious power, unto all patience and longsuffering with joyfulness; Colossians 1:10
2 Ephesians 6 10 Finally, my brethren, be strong in the Lord, and in the power of his might. Ephesians 6:10
3 Ephesians 3 16 That he would grant you, according to the riches of his glory, to be strengthened with might by his Spirit in the inner man; Ephesians 3:16
4 2 Corinthians 12 9 And he said unto me, My grace is sufficient for thee: for my strength is made perfect in weakness. Most gladly therefore will I rather glory in my infirmities, that the power of Christ may rest upon me. 2 Corinthians 12:9
5 2 Corinthians 3 4 And such trust have we through Christ to God-ward: 2 Corinthians 3:4
6 John 15 7 If ye abide in me, and my words abide in you, ye shall ask what ye will, and it shall be done unto you. John 15:7
7 John 15 4 Abide in me, and I in you. As the branch cannot bear fruit of itself, except it abide in the vine; no more can ye, except ye abide in me. John 15:4
8 Isaiah 45 24 Surely, shall one say, in the LORD have I righteousness and strength: even to him shall men come; and all that are incensed against him shall be ashamed. Isaiah 45:24
9 Isaiah 41 10 Fear thou not; for I am with thee: be not dismayed; for I am thy God: I will strengthen thee; yea, I will help thee; yea, I will uphold thee with the right hand of my righteousness. Isaiah 41:10
10 Isaiah 40 29 He giveth power to the faint; and to them that have no might he increaseth strength. Isaiah 40:29

 

Source Code

GitHub

Gist

Link

 

use bible;
DELIMITER //
drop procedure if exists bible.usp_crossReferenceFetch;
//
create procedure bible.usp_crossReferenceFetch
(
bookName varchar(30)
, chapterNumber smallint
, verseNumber smallint
)
begin
/*
* scrollmapper //bible_databases
* https://github.com/scrollmapper/bible_databases
*/
select distinct
tblKeyCR.n as bookName
, tblBibleRefCR.c as chapterNumber
, tblBibleRefCR.v as verseNumber
, tblBibleRefCR.t as text
, concat
(
tblKeyCR.n
, ' '
, cast(tblBibleRefCR.c as char)
, ':'
, cast(tblBibleRefCR.v as char)
, ' '
)
as bookChapterVerse
, tblCRP.sv as votes
from bible.t_kjv tblBible
inner join bible.key_abbreviations_english tblKeyAbbrev
on tblBible.b = tblKeyAbbrev.b
inner join bible.cross_reference tblCRP
on tblBible.id = tblCRP.vid
inner join bible.t_kjv tblBibleRefCR
on tblCRP.sv = tblBibleRefCR.id
inner join bible.key_english tblKeyCR
on tblBibleRefCR.b = tblKeyCR.b
where tblKeyAbbrev.a = bookName
and tblBible.c = chapterNumber
and tblBible.v = verseNumber
order BY
tblCRP.sv desc
;
end;
//
DELIMITER ;

 

Dedicating

Dedicating to one of the great ones:-

Evander Holyfield

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s