Skip to content

Commit

Permalink
Kumaran | #1013 | Added 10 more users for last batch of training
Browse files Browse the repository at this point in the history
  • Loading branch information
Kumaran Venkataraman committed Jun 11, 2014
1 parent 96addcc commit f0f1c4b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('trainer11');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('trainer12');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('trainer13');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('trainer14');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('trainer15');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user41');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user42');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user43');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user44');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user45');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user46');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user47');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user48');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user49');

INSERT INTO anm_report.dim_anm (anmIdentifier) VALUES ('user50');
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user41', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User41', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user41');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user42', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User42', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user42');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user43', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User43', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user43');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user44', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User44', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user44');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user45', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User45', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user45');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user46', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User46', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user46');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user47', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User47', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user47');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user48', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User48', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user48');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user49', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User49', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user49');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'user50', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'User50', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='user50');

INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user41'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user41'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user42'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user42'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user43'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user43'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user44'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user44'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user45'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user45'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user46'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user46'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user47'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user47'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user48'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user48'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user49'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user49'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='user50'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='user50'));


--Trainer data
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'trainer11', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'Trainer11', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='trainer11');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'trainer12', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'Trainer12', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='trainer12');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'trainer13', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'Trainer13', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='trainer13');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'trainer14', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'Trainer14', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='trainer14');
INSERT INTO report.dim_anm (anmIdentifier, phc, name, subcenter) SELECT 'trainer15', (SELECT ID FROM report.dim_phc WHERE phcIdentifier='bherya'), 'Trainer15', 'munjanahalli' WHERE NOT EXISTS (SELECT dim_anm FROM report.dim_anm WHERE anmIdentifier='trainer15');

INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer11'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer11'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer12'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer12'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer13'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer13'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer14'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer14'));
INSERT INTO report.dim_service_provider (service_provider, type) SELECT (SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer15'), (SELECT ID FROM report.dim_service_provider_type WHERE type='ANM') WHERE NOT EXISTS (SELECT service_provider FROM report.dim_service_provider WHERE service_provider=(SELECT ID FROM report.dim_anm WHERE anmIdentifier='trainer15'));

0 comments on commit f0f1c4b

Please sign in to comment.