Sorry, I am not trying to be rude here. Just wanted to get things right.
Straight away we can't get everything in place. Let us get things sorted out one by one.
So I need some clarifications on the following.
1) I see "001" as value for many of the columns.
All being those 8 CHECKBOX columns that are shown next to search Keyword textbox.
Why is that so? Is it going to be the same always or in most of the cases?
What do those 8 columns refer to? In what way they are significant in this searching operation?
2) Are these book_titles redundant in this table?
If so How many rows are there at an average for a book_title?
As suggested earlier, you can separate the Book_Title into a different table
(as this is a domain doesn't have to exisit within BIBLE) and use its
ID here instead of Book_TITLE as such.
Code:
Select distinct BOOK_TITLE into BookTitles from Bible order by Book_Title
This will create a new table called BookTitles and insert all 66 booktitles into it.
Add another column called BookTitleID(int type) to this table and add numbers from 1 to 66 for the exisiting BookTitles.
Remember... Take a baukup of BIBLE table before doing all these changes,
just in case something went wrong you can restore from there.
Also after doing this, you can add another column to Bible table called BookTitleId which is NULLable initially
and do the following update...
Code:
Update Bible set B.BookTitleId = BT.BookTitleId
from Bible B, BookTitles BT
where B.Book_Title = BT.Book_Title
Just do a check if everything is added fine there
(Genesis's BookTitleId from BookTitles table should be there in all rows of Bible table,
that has Book_Title as "Genesis" and similarly for other records too).
After this is done, you can remove the Book_Title column from Bible table.
So now, you have BookTitles (as master table that contains all Book titles in it)
and Bible table that contains other details about each BookTitle.
Now - BookTitles is the table from where the 66 Checkboxes are to be displayed.
Any new BookTitle comes in, that is recorded into BookTitles table and
its other details are added to Bible Table, having the BookTitleId as relationship between the two.
Always search for any keyword is done on the Bible table.
Hope this explains, post here for any clarifications.
Cheers!
_________________________
- Vijay G
Strive for Perfection