Hi all,
I've been importing the full GCD SQLite schema into SQL Server for a personal project, and I've run into a wall trying to extract a complete list of appearances for a given character — in this case, Charles Xavier.
I've read the GCD Django wiki and the visual schema diagram. I understand that:
gcd_character_name_detail contains character names, each tied to a character_id.
gcd_story_character.character_id refers to a gcd_character.id.
gcd_story_character links characters to stories, and those stories link to issues.
Multiple rows in gcd_character_name_detail can share the same name but have different character_ids.
A single character_id can appear in multiple character_name_detail rows.
All clear so far.
❓ The ProblemI'm trying to get a complete and accurate list of issues where Charles Xavier appears, including:
Tie-ins
Cameos
Crossovers
Appearances outside of "X-Men"-titled series (which is the most important part — I don't want to hardcode series filters)
Here’s what I’ve tried:
✅ Attempted queries:Filtering gcd_story_character.character_id IN (808, 6269) — these two seem to be associated with Charles Xavier based on gcd_character_name_detail, but they return mostly garbage: Disney, Western Comics, etc.
Filtering by gcd_character_name_detail.name = 'Charles Xavier' (regardless of character_id) — still mostly junk, still missing 90% of known appearances.
Joining story_character → story → issue → series cleanly — same outcome.
Even trying all character_ids associated with name = 'Charles Xavier' — still only ~139 issues returned, many incorrect.
I expect ~1000 appearances based on manually reviewed data. These queries give me about 10% of that, and most aren't even Marvel books.
🔍 What I’m NOT Trying To DoI'm not trying to limit the query to a list of "X-Men" series.
I'm not trying to build a curated list by hand.
I'm not assuming the data is bad — I’m assuming I don’t understand how the character linkage should be used.
gcd_character.character_id values are reused across unrelated characters with the same name.
There’s no canonical “mainline” Xavier that I can lock onto.
Contributors may create a new character_id for every context where Charles Xavier appears (e.g., different publisher, language edition, AU).
There may not be a way to get a full, reliable set of appearances just by querying character_id or name.
Is there a canonical/primary character entry for someone like Charles Xavier? If yes, how do I find it?
Is the character_id supposed to uniquely represent a single character concept across all appearances?
If not, how do contributors link a name like “Charles Xavier” to the correct appearances in Spider-Man, New Mutants, etc.?
SELECT id, character_id, name
FROM gcd_character_name_detail
WHERE name = 'Charles Xavier'
SELECT DISTINCT
i.id AS IssueId,
i.number,
s.name AS SeriesTitle,
i.publication_date
FROM gcd_story_character sc
JOIN gcd_character_name_detail n ON sc.id = n.id
JOIN gcd_story st ON sc.story_id = st.id
JOIN gcd_issue i ON st.issue_id = i.id
JOIN gcd_series s ON i.series_id = s.id
WHERE n.name = 'Charles Xavier'
ORDER BY s.name, i.number
EXEC sp_help 'gcd_story_character'
SELECT DISTINCT
i.id AS IssueId,
i.number,
s.name AS SeriesTitle,
i.publication_date
FROM gcd_story_character sc
JOIN gcd_story st ON sc.story_id = st.id
JOIN gcd_issue i ON st.issue_id = i.id
JOIN gcd_series s ON i.series_id = s.id
WHERE sc.character_id IN (808, 6269)
ORDER BY s.name, i.number
SELECT DISTINCT
i.id AS IssueId,
i.number,
s.name AS SeriesTitle,
i.publication_date,
n.character_id
FROM gcd_character_name_detail n
JOIN gcd_story_character sc ON sc.character_id = n.character_id
JOIN gcd_story st ON sc.story_id = st.id
JOIN gcd_issue i ON st.issue_id = i.id
JOIN gcd_series s ON i.series_id = s.id
WHERE n.name = 'Charles Xavier'
ORDER BY s.name, i.number