
INSERT INTO wb_gl VALUES
(1, 'Matzner Hügel'),
(2, 'Wolkersdorfer Hochleiten'),
(3, 'Falkensteiner Hügelland');

INSERT INTO branch VALUES
('M', 'Matzen', 40, 224303541, 'Schloßstraße 6', '+43 2289 2221', '+43 2289 2221', NULL);

INSERT INTO wine_attribute VALUES
('B', 'BIO AT-BIO-302', 10000, TRUE),
('HK', 'HK>17,5', 10000, TRUE),
('K', 'Kabinett', 10000, TRUE),
('S', 'Saft', 10000, TRUE),
('Z', 'Sekt', 10000, TRUE);

INSERT INTO wine_cultivation VALUES
('N', 'Normal'),
('KIP', 'Kontrollierte Integrierte Produktion'),
('BIO', 'Organisch Biologisch');

INSERT INTO wb_kg
SELECT k.kgnr, 1
FROM wb_gem wg
    LEFT JOIN AT_gem g ON g.gkz = wg.gkz
    LEFT JOIN AT_kg k ON k.gkz = g.gkz
WHERE hkid = 'WLWV' AND g.gkz / 100 IN (308, 316) AND k.name IN
    ('Angern', 'Großschweinbarth', 'Mannersdorf', 'Prottes', 'Stillfried', 'Grub an der March', 'Auersthal', 'Dörfles',
     'Ebenthal', 'Hohenruppersdorf', 'Kleinharras', 'Kollnbrunn', 'Matzen', 'Ollersdorf', 'Pirawarth', 'Raggendorf',
     'Reyersdorf', 'Schönkirchen', 'Spannberg', 'Stripfing', 'Tallesbrunn', 'Götzendorf', 'Velm', 'Waidendorf',
     'Dürnkrut', 'Baumgarten an der March', 'Gänserndorf', 'Weikendorf');

INSERT INTO wb_kg
SELECT k.kgnr, 2
FROM wb_gem wg
    LEFT JOIN AT_gem g ON g.gkz = wg.gkz
    LEFT JOIN AT_kg k ON k.gkz = g.gkz
WHERE hkid = 'WLWV' AND g.gkz / 100 IN (308, 316) AND k.name IN
    ('Bockfließ', 'Großengersdorf', 'Wolkersdorf', 'Pillichsdorf');

INSERT INTO wb_kg
SELECT k.kgnr, 3
FROM wb_gem wg
    LEFT JOIN AT_gem g ON g.gkz = wg.gkz
    LEFT JOIN AT_kg k ON k.gkz = g.gkz
WHERE hkid = 'WLWV' AND g.gkz / 100 IN (308, 316) AND k.name IN
    ('Erdpreß', 'Martinsdorf', 'Niedersulz', 'Obersulz', 'Großinzersdorf', 'Palterndorf', 'Gaweinstal', 'Zistersdorf');
