Talk:Database Schema

From ISFDB
Revision as of 03:42, 17 March 2008 by NsqIe4 (talk | contribs)
Jump to navigation Jump to search

shawnie jones raffles plaza hotel in singapore jacqueline bisset video revolution flea phoenix university jackpots tv guide aircanada facade.com url lexmark usb printer cable internet nude movie database www.drleonards.com old sled works natale builder guaifenesin dm kid bo staff video scams involving global financial payment services readers digest alicia escandalo machado video chinese horoscope griffin tattoo llardo wedding amazing funny racist video lcd soundsystem daft punk video director chinese horoscope sign antwerp lazy sunday rap video lincoln park music videos japan animation video lonely no more music video top link weekendje berlijn cheap prepaid calling card lady chatterly movies abnormal beauty movie ice music vanilla video honda metropolitan anastasia movie soundtrack for free webmap legionella disinfection korean action movie website amc houston movie texas theater oligarchy kelly brook three movie trailer soft g words drape sitemap matur missouri information analysis center cheap baseball tickets anand telugu movie download adult free porn streaming video stabilizing soil man rolex used watch latter day saint visalia anatomy greys shower video lesbian licking ass hole ads technologies pyro av link video capture device ashley furniture online semiopacous desktop weather lost in the plot video teen 10 prefetch kowhai seeds 14ers california killing spree videos european dance music videos lil rob video codes 6 string bass military rank state united asian badminton federation snocore concert helene svedin maichy kevin kline movie liberty safes china beach anewsoft converter download video emma movie gwyneth paltrow allen fight nba ray video rare book new york ford part tractor killing secret movie fox 24 tv series earth live satellite video close hoppen kelly up i want a man who stands beside me aretha cadillac franklin pink a new day has come video knoxville wedding videographers industrial music videos krav maga video downloads even flow video emo i must video ied video extreme kayaking video age sex under video rc gas boats signage manufacturer jeff stryker gallery wachovia credit card embedding videos in html added blockbuster e movie newsletter queue amarie one thing mp3 manipulator ashton moore and free video free jpeg software webmap lady marmalede video eugine armstrong video lancaster subaru dealers jasper james bayless jerk off rex simon video kong fu movies remove symantec antivirus client bass guitar music sheet east greenbush movie theater alicia moore, pink messenger screen names funny nude movies jackson jackson michael michael music thriller thriller video james bond living daylights movie download 2006 hair short style compuserve arabian music video free 3d online mmorpg kung fu karate movies zanthoxylum simulans kim possible coloring in leila arcieri videos labor and delivery videos local maltese puppies love song in movie epitaph videos emule part file access module for videolan natural baby care products striped teen bedding adult movie actor raised dog bowls escaflowne movie picture white legs and black stockings web when was ll cool j born alice in wonderland disney movie pictures amaturevideos jennifer walcott movie clips katie holmes movie clip everyday exactly same video computer recycling site booth mystic tan www wholesale tropical plants juanita bynum week new york cheap rental cars jessica public simpson video lyon video outside broadcast vehicle directv remote programming link intermute spysubtract web free usa people search video edit magic 4.2 serial australia estate production real video adult blow job movie station lisa stansfield music videos inc maximum funny video ads erotic podcast video real estate developers association hong kong taux imposition anathema download video alexandria movie production asian doggystyle movies kids incorporated video clips karma chameleon video village west in kansas city kansas free download screen saver japan av girl ashton kutcher movie 2005 easy video converter 4.0 keygen ann free picture porn video pc online cheat journal of the american medical society ideal home range northlight theatre academy omc stern drive ecstasy the drug mobile ebony auditions incubus music video are you in elliott eyed missy new teary video amc 14 saratoga movie times lady venom video falcon matthew rush human sex with animals map jonas music video new hampshire vacation home rental dominica paleta large labia movies sports betting kid in mind movie review eminem just lose it video cast garage prefab wood man bed extreme free movies 2007 boat ray sting tay sachs disease wireless alarm audio and video search engines i lord video adult video producers espn schedule australia celexa online long distance provider goddess jewelry airplane charter dakota north london england l t infotech india celebrity nude painkiller through walk victorian style houses ed erotismo porn sesso trailer video zero turn mower review custom calendars imovie how to import video from dvd indiana jones 4 movie machines sex electric warn atv bumpers flipper adult movie rating pregnant women photography sexy plus size bra jennifer lopez im glad a man apart movie quotes kawasaki klr650 eastport maine movie love sex video lewiston movies .com www editare video looking to price things after a fire south coast casino first time home buyers peter werth wallets appraisal beach county palm papa la mujer en el espejo free live video sex chat jug fuckers movies jill mcgill spanish verb conjugation northern ireland lazyboy tv video samarium ii iodide astral based game game strategy tournament turn video wera long kiss goodbye movie pacs life lyric ice fishing killer whale video low carb diet products strawberry shortcake recipe ashley simpson orange bowl halftime show video project vehicle for sale babies r us store locations apprentice video dove commercial mature latina girl pizza sauce recipe aldergrove drive in movie jesse jane usc football video map of wayne county iowa femdom porn bone thug n harmony opera.com retro porn thumb evans sara video index 3.7 vga guys fingering pussy santa clarita realtor addicts audition movie open tv instruction jersey south vocal loading trailer video eminem without me video horse dick suckers television eminem superman video pics lady and the tramp movie information ipod video free xxx video allen iverson bio jake steed movies intervideo windvd creator 2 review pennysaver.com i must increase my bust music video liberator video wedge == Examples of pub_content usage ==

A simple NOVEL publication has a NOVEL content entry. When you display the publication, there's no need to show the contents, as a Novel obviously contains a Novel. When you edit the pub though, the NOVEL content record is shown as you might want to put a page number on it, for instance. Here are the relevant bits of the relevant records, we have one entry in each table.

pubs                        pub_content                     titles
pub_id: 183625              pubc_id: 739717                 title_id: 459
pub_ctype: NOVEL            pub_id: 183625                  title_ttype: NOVEL
pub_tag: DTHBSTVXTX1978     title ID: 459                   title_title: Deathbeast
pub_title: Deathbeast


Of course, a NOVEL Title doesn't have to be in a NOVEL publication. What if it's part of an Omnibus? You obviously want a link from the NOVEL title to the OMNIBUS publication. And a link for each other NOVEL to the same OMNIBUS publication. But an Omnibus isn't just the sum of its contents, so there's an OMNIBUS title record as well in the same pub. Again, this doesn't need to be shown when you display the publication, but we DO want to display the NOVEL contents. This time though, the OMNIBUS record is hidden when you edit the pub - there's nothing you really need to do to it. (Well, you could set a length for it, which is the way we record how many entries, or which entries from a series, make up the omnibus. But we do that on the Title itself instead.)

pubs                        pub_content                     titles
pub_id: 174441              pubc_id: 673891                 title_id: 503331
pub_ctype: OMNIBUS          pub_id: 174441                  title_ttype: OMNIBUS
pub_tag: DDFNNLKHNL2000     title_id: 503331                title_title: Dead Funny
pub_title: Dead Funny

                            pubc_id: 673901                 title_id: 1926
                            pub_id: 174441                  title_ttype: NOVEL
                            title_id: 1926                  title_title: Flying Dutch

                            pubc_id: 673911                 title_id: 8769
                            pub_id: 174441                  title_ttype: NOVEL
                            title_id: 8769                  title_title: Faust Among Equals


There's actually another content record for this pub, a COVERART record. This stays hidden when you edit the pub, because it's maintained automatically when the Artist field is used.

                            pubc_id: 673881                 title_id: 503321
                            pub_id: 174441                  title_ttype: COVERART
                            title_id: 503321                title_title: Cover: Dead Funny

COLLECTION and ANTHOLOGY pubs (and even NOVELS) also have content title types such as SHORTFICTION and ESSAY and INTERIORART and POEM that show up on the pub display and while editing, they're pretty harmless so long as you understand that you're not working on the entry in this pub alone, you're working on ALL entries of that title in ANY publication. INTERVIEW and REVIEW types have their own sections while editing, but you may need to change one of the other content types to one of these if it was mis-entered at first. Those require an extra field to be entered though (the Author moves to Interviewer/Reviewer but you still have to add Book Author/interviewee), so you'll want to do two passes of edits.

It's the Special record used to link the title and pub that is dangerous to change: if one of these becomes visible while editing, try and keep the pub type and entry type matched: NOVEL to NOVEL, COLLECTION to COLLECTION, ANTHOLOGY to ANTHOLOGY, OMNIBUS to OMNIBUS. Sometimes when correcting a publication type, one of these special records isn't hidden away any more and looks as though it could be usefully changed to a normal content record: e.g. if a NOVEL called "XYZ" is actually a collection with a Short Story called "XYZ" in it, it may be tempting to change the XYZ NOVEL record to the SHORTFICTION entry that's required. DON'T! The NOVEL record should change to COLLECTION to keep the link working, and a SHORTFICTION for "XYZ" the short story is added separately.

The problems that start when you lose the link record that matches a pub and title may not be obvious immediately, but if you find pubs where the hyper-link to the title record isn't present, or get warnings about title record mismatches, or you get warnings when Cloning or trying to Remove Titles from a pub, stop and check. Ask for help if needed.

NONGENRE and NONFICTION look as though they might be used for normal contents, but they're not intended that way: they're intended to be the ONE main record for a publication that's of little interest to us as it's not SF - this is why we have troubles if we try and enter Non-Genre Short-fiction in a Non-Genre Publication for instance. Interesting Non-Fiction pieces in a publication should be of type ESSAY - one big NONFICTION record would be used to class the whole pub as NONFICTION, and not worth going into a lot of detail about in ISFDB.

SERIAL shouldn't give you a problem if you're working on books, it's intended for magazines (although it has been used within books to group episodes of a story that aren't consecutive in the book). But if you're working on magazines, then you will come across EDITOR and COVERART too - but I'll leave explaining those to a Magazine mod.

I hope this helps! BLongley 09:37, 21 Oct 2007 (CDT)

Things to do with pub_content in MySQL

As you can see from above, there may be a number of content records for even the simplest pub, so let's start with a simple case: NO content records for a title. Here's some SQL to find them:

select t.title_id, t.title_title from titles t 
where not exists (select 1 from pub_content pc 
                  where pc.title_id = t.title_id)
and t.title_parent = 0
LIMIT 100

You'll want that "LIMIT" on the end as there are quite a few of them.

So what's wrong with these?

  • There can be titles we are sure exist, but we don't have details of any publication yet: you could go search one out at an internet bookshop and create a publication, if you like. First editions are best as they tend to confirm the date on the title.
  • Maybe the title record shouldn't be there: if someone deleted some pub that turned out to be an RPG dice set, the title wouldn't go automatically, it has to be deleted in a second submission. Maybe someone forgot that second submission?

Simple, eh? Well, I kept it simple deliberately, by restricting it to non-variant titles. Let's take out the "t.title_parent = 0"

select t.title_id, t.title_title, t.title_parent from titles t 
where not exists (select 1 from pub_content pc 
                  where pc.title_id = t.title_id)
LIMIT 100

Look at the title_parent: if it's not zero then this is a Variant title. (This is why the way to remove an incorrect variant link is to set the parent to zero, rather than blank.) In which case:

  • The "missing" publication(s) might be stored under the parent instead, and need to be moved back, or
  • We're just missing the publication(s) for THIS variation of the title (feel free to go find one to enter), or
  • There never WILL be an entry under this variation.

Why is the last OK? Well, consider Iain M. Banks and Iain Banks. They're the same person, using the world's least-confusing pseudonym. Any given book of his is published under one name or the other, depending on whether it's SF or not. However, we keep ONE canonical author record for him, and so we need all his books to have an entry for "Iain M. Banks", even when that publication will never be published under that name, only as by "Iain Banks". So one variant will have pubs, the other won't: it's just to put all the titles under one name, and the software will figure out the "as by" for us. This is why the simple case above is actually less simple than two cases: again, it might be fine to have an empty title if all the publications go under a variant title of the one you're looking at.

If this is confusing you, just try it out. You can search for the t.title_title in ISFDB itself, with the usual title search: if you want to search by the t.title_parent, then you can put that number into a URL and search that way, e.g.

http://www.isfdb.org/cgi-bin/title.cgi?887

or use some more SQL:

select * from titles t where t.title_id = 887

There's one other over-simplification I've made here you may have already noticed. What happens when there's a variant title of a variant title? Well, that's when people start getting headaches, so that's worth saving for a different topic.

Let's try it from the other side

How about, instead of titles with no contents, pubs with no contents?

select p.pub_id, p.pub_tag, p.pub_title, p.pub_ctype from pubs p 
where not exists (select 1 from pub_content pc 
                  where pc.pub_id = p.pub_id)
LIMIT 100

(Again, you may want a LIMIT on this, there's a few hundred.)

If you plug the resulting pub_title information into a publication search (last of the Advanced search options), you may well think everything looks OK, it finds the publication alright. You can even click on the Title and find a fairly normal-looking display. (Can you spot the missing bit though?) Try it in the Advanced or Normal title searches and you won't necessarily find ANY records though. Search for that author and you won't necessarily find that title. If you do, you won't find that pub under it.

What's happening here then? Well, without a pub_content record linking the pub to the title, you don't get the title link appearing when you look at the pub. The Author's titles still show up, but this publication won't appear under them. How to fix? Simple! Once you've found the publication (remember, only the advanced pub search will work) you'll either find the orphan record, or the orphan record and a good record to go with it. For instance, at the moment I can see

pub_id	pub_tag	        pub_title	                pub_ctype	
5643	BBBLSNDTHSA2004	Bubbles and the Secret Admirer	NOVEL	

and searching for "Bubbles and the Secret Admirer" shows:

5642 	Bubbles and the Secret Admirer 	E. S. Mooney 	2004 	48 	BBBLSNDTHS2004 	tp 	NOVEL 	0-439-49177-0 	$3.99 	Scholastic
5643 	Bubbles and the Secret Admirer 	E. S. Mooney 	2004 	48 	BBBLSNDTHSA2004 	tp 	NOVEL 	0-439-49177-0 	$3.99 	Scholastic

Record 5643 can be deleted as record 5642 is the good version.

However, I also see:

pub_id	pub_tag	        pub_title	pub_ctype	
5641	BRTRBTSTP2004	Brute Orbits Tp	NOVEL	

And searching for "Brute Orbits" (as I guessed the "Tp" was an error) finds:

Record 	Title 	Authors 	Year 	Pages 	Tag 	Binding 	Type 	ISBN 	Price 	Publisher
5639 	Brute Orbits 	George Zebrowski 	1998 	222 	BRUTEORBIT1998 	hc 	NOVEL 	0-06-105026-1 	$23.00 	HarperPrism
5640 	Brute Orbits 	George Zebrowski 	1999 	? 	BRTRBTSTP1999 	tp 	NOVEL 	0-06-105380-5 	$15.00 	Eos
225585 	Brute Orbits 	George Zebrowski 	1999 	336 	BRTRBTSTJD1999 	pb 	NOVEL 	0-06-105807-6 	$6.99 	 HarperPrism
5641 	Brute Orbits Tp 	George Zebrowski 	2004 	? 	BRTRBTSTP2004 	tp 	NOVEL 	0-06-105380-5 	$15.00 	Eos

We don't have a 2004 trade paperback edition, so we probably want to rescue this 5641 stray. You can get to edit this publication directly via the "record" link, or via the title link and "Edit this pub". Remember all the "Special" contents records I told you not to mess with? Well, this is a time where we DO want to mess with it, as it's broken. As there's no content at all, the software invites you to enter an ANTHOLOGY - we don't necessarily want that though, we want what the publication says. (Most seem to be NOVELs though.) Fortunately there's enough info there - enter a Content record with the right title, author, type and date and submit. Pick the date from the earliest GOOD record, or from the pub, it won't matter - we're going to have to merge titles after approval anyway. You should probably make sure the title matches up, so that it's easy to search for the titles to BE merged.

You may find a complete stray, with no other good record equivalent: you can fix it this way so other editors will come across it naturally, or research the pub and delete it if it's completely wrong.

How does this happen? I don't know. If you find new examples being created, let us know. I personally suspect that the ISFDB-1 to ISFDB-2 conversion created such entries (as there's often a good pub entry with a pub_id 1 less than the pub_id of the bad pub entry) , in which case this article will become obsolete when we've fixed them all. BLongley 15:08, 21 Oct 2007 (CDT)

From too few to too many

OK, we've looked at pubs with not enough (i.e. zero) contents, and titles with not enough (i.e. zero) contents, what about when there's too MANY contents? I'm not talking about books with a lot of SHORTFICTION or ESSAYs in them, those are common: they're probably an ANTHOLOGY or COLLECTION. And a book about or by an artist may have a lot of INTERIORART. It's the Special, linking, content records that might be a worry. I mentioned that a simple case is a NOVEL containing a NOVEL: and we all know that a book containing two or more NOVELs is called an OMNIBUS, isn't it? So let's go find some Omnibuses that haven't been called that.

select p.pub_id, p.pub_tag, p.pub_title, p.pub_ctype 
, COUNT(*)
from pubs p, titles t, pub_content pc
where pc.pub_id = p.pub_id
and pc.title_id = t.title_id
and t.title_ttype = 'NOVEL'
and p.pub_ctype != 'OMNIBUS'
GROUP BY p.pub_id,p.pub_tag, p.pub_title, p.pub_ctype 
HAVING COUNT(*) > 1
LIMIT 100

Oh dear - it seems that sometimes we don't call a book with two NOVELs an OMNIBUS, we might call it an "Ace Double" instead:

pub_id	pub_tag	        pub_title	                        pub_ctype	COUNT(*)	
1591	CRSSTNVFE1958	Across Time / Invaders From Earth	NOVEL	        2	
1769	GNSTRCTTTH1972	Against Arcturus / Time Thieves	        NOVEL	        2	
1998	LNFMRTMC1956	Alien From Arcturus / Atom Curtain	NOVEL	        2	

One for a Standards discussion maybe. I don't own many, and none of those, so I'm opting out of that for now. I can't ignore these though: record 4545 comes up:

pub_id	pub_tag	        pub_title	pub_ctype	COUNT(*)	
4545	BIPOHL1982	BiPohl	        NOVEL	        2	

It's a title I might have considered buying, and Advanced searching for "BiPohl" publications shows these:

Record 	Title 	Authors 	Year 	Pages 	Tag 	Binding 	Type 	ISBN 	Price 	Publisher
4545 	BiPohl 	Frederik Pohl 	1982 	313 	BIPOHL1982 	pb 	NOVEL 	0-345-30247-8 	$2.75 	Ballantine Del Rey
4546 	BiPohl 	Frederik Pohl 	1987 	? 	BPHL1987 	tp 	OMNIBUS 	0-345-35005-7 	$3.50 	Ballantine
136061 	BiPohl 	Frederik Pohl 	1982 	314 	BPHLLHKQVN1982 	pb 	OMNIBUS 	0-345-30247-8 	$2.75 	Ballantine

It turns out 136061 has been verified, and contains two novels I already own - just the sort of information I wanted! Saves me buying a book I don't need. Looking at 4545 makes me think it's a Duplicate, and can be deleted.

Here's another book I own a version of:

pub_id	pub_tag	        pub_title	pub_ctype	COUNT(*)	
13811	FRSTLNSMN1982	First Lensman	NOVEL	        2	

Oh dear, when I try and edit that I see it's got TWO identical NOVEL entries. Never mind, I can "Remove Titles From This Pub" can't I? No. ISFDB hides the "correct entry" for me: unfortunately both are correct, we just don't need TWO of them.

Blank out one of them? Doesn't work.

How about if I change the title type to something different like ANTHOLOGY? Well, that shows up the two NOVELS for removal in "Remove Titles From This Pub", let's try removing one. There's a big yellow "WARNING: Unable to locate the title reference for this publication" message though... oh well, it's a screwed-up pub anyway, let's try it - Wey-hey, it worked! OK, now I need to change the title back to NOVEL.

I'll do a few more whilst I'm at it.

pub_id	pub_tag	        pub_title	pub_ctype	COUNT(*)	
22863	MRTHNHMN601953	More Than Human	NOVEL	        2	
22864	MRTHNHMN1953	More Than Human	NOVEL	        2	

Oh no! I suggested we remove ONE title, it says I want to remove BOTH! REJECT, REJECT, REJECT! Or maybe not. So long as I put the title BACK afterwards it's OK. Phew, that worked. Oh wait, it's considered a new title - merge them both and we're back to normal. This is definitely NOT for the faint-hearted! Far better to leave it alone and call for help, I think. And it's arguable about whether it's an anthology anyway, it seems. Maybe it's a novel with some extra short-fiction and essays? TWO copies of the same novel in one pub was obviously wrong, but unless I've got all the data about that novel saved in case I need to put it back, I'm not going to touch such again for a while. So much more to learn...

Back to a simple table

The last example caused too much thinking, so let's go look at another simple table that may be of use: Verification. Hopefully if you've got to this stage, you've been verifying the publications you actually own. Primary Verification where you've still got the book is reference_id 1. If you want to mourn books you didn't keep, the "Primary (Transient)" is reference_id 12. Note that this does NOT match the reference_id in the reference table!

Here's how I find what I verified:

select p.pub_id, p.pub_title, v.ver_time
from pubs p, verification v
where v.pub_id = p.pub_id
and v.reference_id = 1
and v.user_id = 2781
ORDER by 2

That's alphabetical by title, you may want to ORDER BY 3 instead if you're trying to find all the early verifications you did that you think aren't quite good enough by your current standards. ;-)

Of course, that's just me bragging about MY verifications as it stands - you need to put your own user_id in, I'm 2781 and you're NOT. YOU are... well, we can't find that out from SQL, the backups hide all the personally identifiable information. (Phew!) You'll need to go look at your own Wiki preferences and read the first line, "Your internal ID number is XXXX". I bet you haven't looked at THAT page for a while, maybe there's something else you'd like to update while you're there?

"Bill, you haven't put the author in there, how do you tell your Starburst by Pohl from your Starburst by Bester?" Well, of course, I've memorised the pub_id for everything I still own... ;-) Nah, just kidding. The reason is that a lot of my books aren't by a single author, or are by a variant author, and tonight I just want a simple example. It'll get complex enough soon enough, you can be sure of that. Just try the simple things for now. BLongley 16:03, 23 Oct 2007 (CDT)

Why the Publisher Search doesn't work

You may, for instance, have decided to have a look for all the Ace Doubles I pointed out earlier. And the Advanced Search does offer you the opportunity of searching for publications where Term 1 is 'Ace Double' and the search-type is 'Publisher'. This gives a nasty-looking set of Python error messages - don't worry, you haven't broken anything! Some of the error says:

select pubs.* from pubs where pubs.pub_publisher... '�e Double%' order by pubs.pub_title limit 100"

- this is a shortened version of the SQL it's trying - and the explanation is

"Unknown column 'pubs.pub_publisher' in 'where clause'"

Pretty self-explanatory really, as there is indeed NO pubs.pub_publisher column in the pubs table. So what SQL should be being executed? Well, the publishers seem to have been normalised into their own table, publishers, which is quite a simple one:

desc publishers;
Field          Type            Null    Key
publisher_id   int(11)         NO      PRI
publisher_name varchar(64)     YES		
note_id        int(11)         YES

We can search for 'Ace Double' in here:

select * from publishers 
where publisher_name like '�e Double%'
publisher_id   publisher_name   note_id	
381            Ace Double		

and if you look at the pubs table, sure enough there's a publisher_id column there we can search by:

select * from pubs p 
where p.publisher_id = 381
LIMIT 100 

Bingo! Lots and lots of Ace Doubles. Of course, you can find most of them just by searching for titles of ' / ' in ISFDB itself, but SQL can be a bit more generic, or more specific - ' / ' finds some NON-Ace Doubles for instance. Combine the two queries and use something like this to search for publications by the Publisher of your choice: replace "Bill" with the publisher you want.

select pu.publisher_name, p.* 
from pubs p, publishers pu 
where p.publisher_id = pu.publisher_id 
and pu.publisher_name like '%Bill%'
order by p.pub_title
LIMIT 100

This seems to be a good example of what the database USED to be like - where there once was a pubs.pub_publisher column? - and what it may well become: that publishers.note_id column hasn't been used yet.

"And Not an Omnibus...."

There's another Python problem if you try that in Advanced Search. Say you've tackled all the Ace Doubles, and now want to look at everything else that has ' / ' in the title, but ISN'T an Omnibus. Well, it's easy to search for ' / ' and Ttype of 'NOVEL' for instance, although the search won't recognise the spaces around the slash. But trying to search for ' / ' and NOT Ttype of 'OMNIBUS' doesn't work:

ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near 'ANDNOT titles.title_ttype='OMNIBUS' order by titles.title_title limit 100' at line 1")
args = (1064, "You have an error in your SQL syntax; check the ... order by titles.title_title limit 100' at line 1")

That seems to suggest that ISFDB is using "ANDNOT" rather than "AND NOT". Dead easy to correct if we run the SQL ourselves though:

select t.* from titles t
where t.title_title like '% / %'
AND NOT t.title_ttype = 'OMNIBUS'

OK, that shows there are plenty of other types to exclude. You may want to try something like

select t.* from titles t
where t.title_title like '% / %'
and not t.title_ttype = 'OMNIBUS'
and not t.title_ttype = 'COVERART'
and not t.title_ttype = 'INTERIORART'
and not t.title_ttype = 'ESSAY'
and not t.title_ttype = 'POEM'
and not t.title_ttype = 'EDITOR'

Or if we remember "!=" is slightly less typing:

select t.* from titles t
where t.title_title like '% / %'
and t.title_ttype != 'OMNIBUS'
and t.title_ttype != 'COVERART'
and t.title_ttype != 'INTERIORART'
and t.title_ttype != 'ESSAY'
and t.title_ttype != 'POEM'
and t.title_ttype != 'EDITOR'

Or even better, remember "NOT IN" and use:

select t.* from titles t
where t.title_title like '% / %'
and t.title_ttype NOT IN ('OMNIBUS', 'COVERART', 'INTERIORART', 'ESSAY', 'POEM', 'EDITOR') 

You could also use "IN" rather than "NOT IN" and list the other types instead - title_ttype is fixed to certain values, namely 'ANTHOLOGY', 'BACKCOVERART', 'COLLECTION', 'COVERART', 'INTERIORART', 'EDITOR', 'ESSAY', 'INTERVIEW', 'NOVEL', 'NONFICTION', 'NONGENRE', 'OMNIBUS', 'POEM', 'REVIEW', 'SERIAL', 'SHORTFICTION', 'CHAPTERBOOK'.

Lots of options, but all quite simple, and all working around a simple problem.

Are you LOOKING for trouble?

Hopefully by now you can spot what this SQL is trying to do.

select p.pub_title, pc.pub_id, t.title_ttype, count(*)
from pub_content pc, titles t, pubs p
where pc.title_id = t.title_id
and pc.pub_id = p.pub_id
and t.title_ttype IN ('ANTHOLOGY', 'COLLECTION')
and p.pub_ctype != 'OMNIBUS'
group by pc.pub_id, t.title_ttype
having count(*) > 1

It's OK to have an Anthology or a Collection as part of a bigger book, if the book is an Omnibus. You'd have contents for the Antholog(y/ies) and Collection(s) AND contents for all the shortfiction and essays and such too. That's fine. But we don't want collections of collections or anthologies of anthologies. And some of these problem publications have the SAME title in them twice (who ignored the big Yellow Warning messages about merging, eh?).

But these are not simply classifiable from the above information alone, you're going to have to investigate, and make some pretty dangerous edits in the meantime too.

DO NOT TRY THIS IF YOU DO NOT KNOW HOW TO PUT THINGS BACK TO AT LEAST NO MORE THAN THE SAME SORT OF PROBLEM AS THEY HAD BEFORE!

OK, now I've warned you, let's have a look at a few:

A Star Above and Other Stories	1190	COLLECTION	2	

Two collections within one collection? Not that ISFDB will show you that. Changing the Pub type to NOVEL showed up the two collections though. One (with some Internet research despite the NESFA site being unavailable) seems clearly bogus, so "Remove Titles from this pub" got rid of that one. The other is right(ish) - it's "A Star Above It and Other Stories". So that got retitled, and although I don't want to put all the contents in (I don't own it, can't "Look Inside" on Amazon or suchlike, and it postdates the catalogue at tamu.edu) I've at least left the suspected contents in notes for someone to sort out later. It IS a collection though, so the pub type got changed back.

Anasazi	2564	COLLECTION	2	

Changing the Pub type to NOVEL showed up the two collections again. Unfortunately they were both the same one, so when I "Removed Titles from this pub" BOTH went, and I had to put one back. Fortunately Contento had details of the contents of this edition, so they now have page numbers. Unfortunately there is a second printing too, so I needed to merge the Collection titles again afterwards. (Yes, changing to NOVEL is usually a temporary measure only, this needed to go back to "COLLECTION" status.)

Bending the Landscape: Science Fiction	3999	ANTHOLOGY	2	

This was a simpler one. Changing the Pub type to NOVEL showed up the two Anthologies, and one was called an Introduction - clearly an 'ESSAY' mis-classified. So I fixed that entry, changed the pub type back to 'ANTHOLOGY' and it seems OK now.

Note that the usual resolution is to change the publication back TO the type you changed it FROM. If you've ignored the Big Warnings and got out of your depth, this is the usual thing to try even if you haven't fixed anything.

DO please ask for help if you think you've made things WORSE.

Best from Fantasy and Science Fiction: 14th Series	4076	ANTHOLOGY	2	
Best from Fantasy and Science Fiction: 22nd Series	4083	ANTHOLOGY	2	

Well, these ones are easy - ISBN-10: 9997374851 - ISBN-10: 9997376463 - just zap them. There are GOOD records for those titles around still, we can do without this rubbish. (Yes, I did check if there was more information about them under those ISBNs, but only Amazon admits they exist and Amazon is WRONG.)

Beyond the Galactic Rim / The Ship From Outside	4374	COLLECTION	3	

That looks familiar... oh yes, already fixed under the Ace Double initiative. Ignore. Here's an interesting pair though:

Blood