It's inside the item script, both in db/{pre-}re/item_db.conf and in the SQL.
For example, since you're interested on the SQL:
REPLACE INTO `item_db` VALUES ('1257','Katar_Of_Thornbush','Katar of Quaking','4','45000','22500','1200','105','0','0','1','0','4096','63','2','34','3','55',NULL,'1','16','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtkEle,Ele_Earth; bonus2 bAddEff,Eff_Blind,500;','','');
Check the script part:
bonus bAtkEle,Ele_Earth; bonus2 bAddEff,Eff_Blind,500;
The bonus bAtkEle, <element> is responsible for weapon elements, as you see.