add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.

CREATE TABLE ReligionBase
([id_num] int, [religion_cde] varchar(4))
;
INSERT INTO ReligionBase
([id_num], [religion_cde])
VALUES
(2520985, 'CATH'),
(2541075, 'METH'),
(2934559, 'BUDH'),
(3298125, 'CHRI'),
(3378597, 'PRES'),
(3407535, 'CATH'),
(3448905, 'PRES'),
(2522034, 'BAPT'),
(2543021, 'QUAK'),
(2933729, 'SDAD'),
(3450792, 'JEWI'),
(3041872, 'LUTH'),
(3210738, 'CATH'),
(3220142, 'HIND'),
(3570871, 'FGOS'),
(3348798, 'FCHR'),
(2343987, 'EVAN'),
(3433789, 'PRES')
;

18 rows affected
SET NOCOUNT ON

/* Table variable for static religion descriptions and categories */
DECLARE @religionCategories TABLE
( religionCode VARCHAR(50) NOT NULL,
religionDescription VARCHAR(50) NOT NULL,
religionCategory VARCHAR(50) )


INSERT INTO @religionCategories (religionCode, religionDescription, religionCategory)
VALUES
('APOS','Apostolic','Protestant'),
('ASGD','Assembly of God','Protestant'),
('BAPT','Baptist','Protestant'),
('BUDH','Buddhist','Buddhist'),
('CATH','Catholic','Catholic'),
('CHAR','Charismatic','Protestant'),
('CHCH','Church of Christ','Protestant'),
('CHEN','Church of England','Protestant'),
('CHGD','Church of God','Protestant'),
('CHRI','Christian','Protestant'),
('CONG','Congregational','Protestant'),
('CORT','Christian Orthodox','All Other'),
('CSCI','Christian Scientist','All Other'),
('DICH','Disciples of Christ','Protestant'),
('EAST','Eastern','All Other'),
('EORT','Eastern Orthodox','All Other'),
('EPIS','Episcopal','Protestant'),
('EVAN','Evangelical','Protestant'),
('FCHR','First Christian','Protestant'),
('FGOS','Full Gospel','Protestant'),
('HIND','Hindu','Hindu'),
('ISLA','Islam','All Other'),
('JEWI','Jewish','Jewish'),
('JWIT','Jehovahs Witness','All Other'),
('LDSS','Latter Day Saints','Mormon'),
id_num religionCategory
2520985 Catholic
2541075 Protestant
2934559 Buddhist
3298125 Protestant
3378597 Presbyterian
3407535 Catholic
3448905 Presbyterian
2522034 Protestant
2543021 All Other
2933729 Protestant
3450792 Jewish
3041872 Protestant
3210738 Catholic
3220142 Hindu
3570871 Protestant
3348798 Protestant
2343987 Protestant
3433789 Presbyterian