From The Mana World
Revision as of 07:47, 22 April 2008 by Bjørn (talk | contribs) (Directly link to the source code for database specification)

SQL table specifications

Since the database is changing relatively often while we're still developing 0.1.0 and nobody likes to keep this page up to date, here is the link to the source code that specifies creation of the database tables. The source code is always right!

Example queries

Template:Status outdated

  • Count total number of in-game objects
select count(*) from tmw_items;
  • Count total number of item types
select count(*) from tmw_base_items;
  • List player inventory
select distinct tmw_items.id, tmw_items.name
from tmw_items, tmw_inventory
where tmw_items.id = tmw_inventory.id
and tmw_inventory.name = 'nym the great';
  • Find weight of player inventory
select sum(tmw_base_items.weight)
from tmw_base_items, tmw_items, tmw_inventory
where tmw_base_items.name = tmw_items.name
and tmw_items.id = tmw_inventory.id
and tmw_inventory.name = 'nym the great';