INSERT INTO resource(name) VALUES
    ('NEBULANCE'),
    ('SHADOWSTONE'),
    ('AZURIUM'),
    ('NOVAFOR'),
    ('SOLLUX');

INSERT INTO users(name) VALUES
    ('Joe'),
    ('Emile'),
    ('Niko'),
    ('Plug'),
    ('Upgrade');


INSERT INTO bank_account(user_id, resource_id, balance) VALUES
    (1, 1, 0),
    (1, 2, 175),
    (1, 3, 200),
    (1, 4, 25),
    (1, 5, 10);

INSERT INTO store_item(name, currency, target_resource, price, claim_amount) VALUES
    ('Drill 1A', 1, 1, 100, 500),
    ('Drill 1B', 2, 2, 100, 500),
    ('Drill 1C', 3, 3, 100, 500),
    ('Drill 1D', 4, 4, 100, 500),
    ('Drill 1E', 5, 5, 100, 500);


SELECT name,init_supply
FROM resource_well
INNER JOIN resource ON resource.id = resource_well.resource_id
WHERE source_id = 1;

SELECT inventory_item.id,store_item_id, COUNT(upgrade_event.id) as upgrades
FROM inventory_item
LEFT JOIN upgrade_event ON inventory_item.id = upgrade_event.inventory_item_id
WHERE inventory_item.user_id = 1
GROUP BY inventory_item.id;

SELECT inventory_item.id,store_item_id
FROM inventory_item;
