chrFactions (CCP DB)

From EVEDev
Jump to: navigation, search
CCP DB Table Categories
chrFactions table of the CCP Static Data Dump contains the main in-game factions.

You can check the Factions page for in-game mappings from the database and API.



Column Index Type Attributes Default Note
factionID Y int(11) NOT NULL
factionName Y varchar(100) assumed NOT NULL index, attr differ from distro
description N varchar(1000) NULL NULL
raceIDs N int(11) assumed NOT NULL races involved in faction
bit field of chrRaces.raceID
examples below
attr differ from distro
solarSystemID Y int(11) assumed NOT NULL System Head quarters
attr differ from distro
corporationID Y int(11) assumed NOT NULL NPC corp representing faction
attr differ from distro
sizeFactor N double assumed NOT NULL size of faction, unknown formula
stationCount N smallint(6) assumed NOT NULL number of stations owned
attr differ from distro
stationSystemCount N smallint(6) assumed NOT NULL number of systems where faction owns stations
attr differ from distro
militiaCorporationID Y int(11) NULL NULL corporation for faction warfare
iconID Y int(11) NULL NULL ID of icon


Columns Type Foreign Table Note
factionID Primary Key
Foreign Key
loose eveNames.itemID
factionName Unique assumed, not in distro
solarSystemID Foreign Key mapSolarSystems.solarSystemID
corporationID Foreign Key crpNPCCorporations.corporationID
loose eveNames.itemID
militiaCorporationID Foreign Key crpNPCCorporations.corporationID
loose eveNames.itemID
iconID Foreign Key eveIcons.iconID

Foreign keys to: crpNPCCorporations (x2), mapSolarSystems

Loose foreign keys to: eveNames (x3)

Foreign keys from: None

Loose foreign keys from: None

RaceIDs bit field

This column is a bit field of raceIDs, meaning it is the SUM or logical AND of them. For exaple, Guristas have a RaceIDs of 9, which is Caldari (id 1) and Gallente (id 8). Query examples for determining races based on a bit field bellow.

CCP Image Dump

While we are not provided with an image mapping for factions, you can obtain a user submitted table with common mappings. chrFactionGraphics

Query Examples

Human readable columns

  `t1`.`factionName` AS `name`,
  `t1`.`description` AS `description`,
  `t1`.`sizeFactor` AS `size`,                                                
  `t1`.`stationCount` AS `stationCount`,
  `t1`.`stationSystemCount` AS `stationSystemCount`,
  `t1`.`raceIDs` AS `raceMask`,
  `t3`.`solarSystemName` AS `system`,
  `t4`.`itemName` AS `corp`,
  `t5`.`itemName` AS `militia`
FROM `chrFactions` AS `t1`
  LEFT JOIN `mapSolarSystems` AS `t3` ON `t1`.`solarSystemID` = `t3`.`solarSystemID`
  LEFT JOIN `eveNames` AS `t4` ON `t1`.`corporationID` = `t4`.`itemID`
  LEFT JOIN `eveNames` AS `t5` ON `t1`.`militiaCorporationID` = `t5`.`itemID`
ORDER BY `t1`.`factionName`

Limited Result: UNIQ3aa709906280be8a-sql-00000001-QINU

Races for Factions

  `t2`.`factionName` AS `factionName`,
  `t1`.`raceName` AS `raceName`
FROM `chrRaces` AS `t1`
  INNER JOIN `chrFactions` AS `t2`
WHERE `t2`.`RaceIDs` & `t1`.`RaceID` = `t1`.`RaceID` 
ORDER BY `t2`.`factionName` ASC, `t1`.`raceName` ASC

Limited Result: UNIQ3aa709906280be8a-sql-00000003-QINU


Personal tools