Skip to content

Instantly share code, notes, and snippets.

@Winslett
Last active December 7, 2022 19:24
Show Gist options
  • Save Winslett/c197da4c40b1ae731e091de63efc8855 to your computer and use it in GitHub Desktop.
Save Winslett/c197da4c40b1ae731e091de63efc8855 to your computer and use it in GitHub Desktop.
JSONB Example
--
CREATE TABLE public.employees (
id bigint NOT NULL,
first_name character varying,
last_name character varying,
start_date timestamp(6) without time zone,
job_title character varying,
salary integer,
manager_id character varying,
departments jsonb,
addresses jsonb,
systems_access jsonb
);
CREATE SEQUENCE public.employees_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE ONLY public.employees ALTER COLUMN id SET DEFAULT nextval('public.employees_id_seq'::regclass);
INSERT INTO public.employees VALUES
(1, 'Graham', 'Wintheiser', '2017-09-28 21:40:41.646862', 'CEO', 250000, NULL, '["administration"]', '{"addresess": [{"state": "Wyoming", "street": "33869 Floria Track", "country": "Brunei Darussalam", "postal_code": "82165-8702"}, {"state": "New Jersey", "street": "672 Doretha Road", "country": "Palau", "postal_code": "00108-1242"}, {"state": "New Jersey", "street": "933 Kulas Meadows", "country": "Ethiopia", "postal_code": "82404"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}'),
(2, 'Vanetta', 'Keeling', '2021-11-06 11:34:20.217976', 'Global Director', 96226, '1', '["Clothing"]', '{"addresses": [{"state": "North Dakota", "street": "57925 Wiegand Course", "country": "Zambia", "postal_code": "16986"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(3, 'Arlen', 'VonRueden', '2021-09-27 02:31:16.159411', 'Legacy Administration Facilitator', 100535, '1', '["Toys"]', '{"addresses": [{"state": "Indiana", "street": "661 Thiel Dam", "country": "Gibraltar", "postal_code": "19476-6703"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(4, 'Treva', 'Sawayn', '2022-02-03 22:46:47.009097', 'Hospitality Technician', 88759, '3', '["Games", "Baby"]', '{"addresses": [{"state": "Missouri", "street": "354 Schuster Summit", "country": "Mayotte", "postal_code": "64787-3497"}]}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(5, 'Martine', 'Schimmel', '2018-11-19 07:18:12.816363', 'Chief Sales Associate', 46370, '3', '["Garden"]', '{"addresses": [{"state": "Virginia", "street": "636 O''Reilly Inlet", "country": "Montenegro", "postal_code": "00083-7346"}, {"state": "Hawaii", "street": "1294 Bryan Square", "country": "Cyprus", "postal_code": "00014"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}'),
(6, 'Adrian', 'Altenwerth', '2022-01-27 16:40:49.260851', 'Community-Services Coordinator', 149661, '3', '["Jewelry"]', '{"addresses": [{"state": "Hawaii", "street": "642 Rufus Rapids", "country": "Sao Tome and Principe", "postal_code": "38358-2432"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(7, 'Chung', 'Hauck', '2021-10-26 10:08:14.64302', 'Lead Education Representative', 129149, '6', '["Clothing", "Kids"]', '{"addresses": [{"state": "Delaware", "street": "113 Lindsay Spur", "country": "Mauritania", "postal_code": "07526-6410"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(8, 'Laverna', 'Kautzer', '2022-06-14 00:43:53.051303', 'Hospitality Representative', 57141, '2', '["Baby", "Baby"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}'),
(9, 'Filiberto', 'Kihn', '2021-03-10 00:22:35.526698', 'Marketing Developer', 212213, '8', '["Baby"]', '{"addresses": [{"state": "Kentucky", "street": "3231 Valene Forks", "country": "Bahrain", "postal_code": "39861"}, {"state": "Maryland", "street": "96178 Linwood Radial", "country": "Mongolia", "postal_code": "19948"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(10, 'Dirk', 'Bode', '2019-11-12 05:43:26.982241', 'Forward Consulting Supervisor', 196826, '3', '["Shoes", "Garden"]', '{"addresses": [{"state": "Nebraska", "street": "734 Thomas Vista", "country": "Niue", "postal_code": "21837-1523"}, {"state": "Delaware", "street": "704 Kandis Meadow", "country": "Nepal", "postal_code": "04465"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(11, 'Melisa', 'Koss', '2022-06-18 13:17:53.260307', 'District Real-Estate Technician', 71464, '3', '["Kids"]', '{"addresses": [{"state": "Alaska", "street": "758 Heidenreich Drives", "country": "Afghanistan", "postal_code": "47372-3221"}, {"state": "Pennsylvania", "street": "151 Marilee Radial", "country": "Lesotho", "postal_code": "11710-4197"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(12, 'Wilhemina', 'Torphy', '2021-12-22 07:01:41.228782', 'Human Retail Specialist', 129634, '2', '["Sports", "Baby"]', '{"addresses": [{"state": "Utah", "street": "4518 Tromp Crossroad", "country": "Angola", "postal_code": "69675-6179"}, {"state": "Georgia", "street": "44747 Aleisha Isle", "country": "Dominica", "postal_code": "75636-1137"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(13, 'Delpha', 'Kertzmann', '2021-06-24 18:24:48.822077', 'Central Administration Assistant', 157409, '6', '["Home"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(14, 'Vella', 'Heller', '2021-08-13 06:00:55.23666', 'Sales Technician', 210819, '5', '["Garden", "Baby"]', '{"addresses": [{"state": "Oregon", "street": "2726 Eusebio Place", "country": "Mayotte", "postal_code": "31349-0878"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(15, 'Kennith', 'White', '2019-04-30 20:51:21.422342', 'Forward IT Administrator', 181969, '2', '["Jewelry", "Sports"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(40, 'Javier', 'Donnelly', '2018-11-04 17:54:10.903094', 'Administration Assistant', 197151, '2', '["Movies", "Movies"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(16, 'Bryan', 'Luettgen', '2022-06-07 07:39:04.625783', 'Principal Technician', 216044, '2', '["Baby"]', '{"addresses": [{"state": "Arizona", "street": "89302 Gleichner Landing", "country": "Saudi Arabia", "postal_code": "26399-4666"}, {"state": "Iowa", "street": "614 Barrows Canyon", "country": "United States Minor Outlying Islands", "postal_code": "26359"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}'),
(17, 'Monte', 'Donnelly', '2022-04-22 19:46:00.481445', 'Real-Estate Representative', 175861, '6', '["Home", "Electronics"]', '{"addresses": [{"state": "Massachusetts", "street": "6626 Schowalter Mill", "country": "Gabon", "postal_code": "60271-4598"}]}', '{"crm": 0, "helpdesk": 1, "admin_panel": 0}'),
(18, 'Nathaniel', 'Huel', '2019-05-03 13:21:04.898611', 'Education Analyst', 110563, '4', '["Computers", "Outdoors"]', '{"addresses": [{"state": "Kentucky", "street": "81279 Jeremiah Meadows", "country": "Uganda", "postal_code": "64309-0250"}, {"state": "Maine", "street": "8600 Turcotte Place", "country": "Martinique", "postal_code": "48176"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(19, 'Glennie', 'Kerluke', '2022-08-05 08:48:36.267179', 'Forward Accounting Executive', 113926, '8', '["Shoes"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}'),
(20, 'Cyrus', 'MacGyver', '2020-09-01 05:23:44.217922', 'Education Orchestrator', 165888, '8', '["Industrial"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(21, 'Victoria', 'Waters', '2020-10-18 04:22:56.917405', 'Legacy Education Planner', 35265, '10', '["Industrial"]', '{"addresses": [{"state": "North Dakota", "street": "547 Franecki Ramp", "country": "Qatar", "postal_code": "72906"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(22, 'Lawrence', 'Zulauf', '2021-04-21 11:07:36.867374', 'Construction Facilitator', 94975, '19', '["Beauty"]', '{"addresses": [{"state": "South Dakota", "street": "78066 Carmelia Canyon", "country": "Martinique", "postal_code": "16647-0286"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(23, 'Abraham', 'Smitham', '2019-12-04 10:56:18.148417', 'Advertising Representative', 42854, '14', '["Home"]', '{"addresses": [{"state": "New Jersey", "street": "632 Leannon Cove", "country": "Bangladesh", "postal_code": "52503-2538"}, {"state": "Arkansas", "street": "52741 Odell Corner", "country": "Republic of Korea", "postal_code": "13320-4867"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(24, 'Rosalia', 'Blanda', '2021-10-18 01:25:30.755722', 'Hospitality Developer', 40828, '21', '["Tools", "Computers"]', '{"addresses": [{"state": "Washington", "street": "9560 Kshlerin Roads", "country": "Bahrain", "postal_code": "70288"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(25, 'Joe', 'Von', '2021-02-11 12:40:00.244937', 'Regional Executive', 102687, '14', '["Grocery"]', '{"addresses": [{"state": "Idaho", "street": "42282 Shanahan Pines", "country": "Poland", "postal_code": "42961-6915"}, {"state": "Pennsylvania", "street": "76284 Maryland Wells", "country": "Chad", "postal_code": "79627"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(26, 'Garry', 'Walsh', '2022-02-01 05:06:03.998542', 'Education Producer', 76499, '15', '["Computers", "Automotive"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 1, "admin_panel": 0}'),
(27, 'Ghislaine', 'Fay', '2019-12-25 13:29:34.484995', 'Construction Consultant', 224519, '22', '["Toys", "Grocery"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 1, "admin_panel": 0}'),
(28, 'Dong', 'Lockman', '2020-01-09 18:00:15.216383', 'Marketing Facilitator', 219130, '25', '["Games"]', '{"addresses": [{"state": "Michigan", "street": "103 Homenick Ridge", "country": "Bosnia and Herzegovina", "postal_code": "22003-0486"}, {"state": "Idaho", "street": "3056 Hills Curve", "country": "Saint Kitts and Nevis", "postal_code": "29333-3645"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(29, 'Everett', 'Botsford', '2020-08-25 19:22:17.137225', 'Investor Orchestrator', 88646, '8', '["Grocery"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(30, 'Brittni', 'Bergstrom', '2020-08-05 05:30:20.667401', 'Marketing Manager', 160977, '15', '["Movies"]', '{"addresses": [{"state": "Kansas", "street": "971 Ziemann Overpass", "country": "Chad", "postal_code": "60946-2191"}, {"state": "North Dakota", "street": "77973 Alishia Ports", "country": "Bhutan", "postal_code": "32602"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(31, 'Michel', 'Hand', '2018-12-24 03:31:46.435308', 'Government Technician', 49056, '21', '["Baby"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(32, 'Dorothea', 'Pollich', '2020-05-01 04:48:46.818961', 'Senior Architect', 47582, '5', '["Computers"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(33, 'Season', 'Bradtke', '2021-01-16 00:36:01.005066', 'Future Banking Director', 194849, '28', '["Clothing"]', '{"addresses": [{"state": "Florida", "street": "312 Spencer Locks", "country": "Morocco", "postal_code": "90573-9677"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(34, 'Charita', 'Beatty', '2020-10-23 20:36:00.791774', 'Central Architect', 212128, '26', '["Books", "Tools"]', '{"addresses": [{"state": "Nebraska", "street": "429 Koepp Mill", "country": "Burkina Faso", "postal_code": "30771-4904"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(35, 'Maxwell', 'Koepp', '2022-05-05 02:12:08.97327', 'National Retail Representative', 58501, '23', '["Clothing", "Tools"]', '{"addresses": [{"state": "South Dakota", "street": "59075 Moen Inlet", "country": "Azerbaijan", "postal_code": "78390-7636"}, {"state": "Idaho", "street": "3698 Caleb Ranch", "country": "Jersey", "postal_code": "61944-8043"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(36, 'Natalie', 'Ledner', '2018-10-02 07:57:16.125693', 'Future Hospitality Supervisor', 189080, '24', '["Music"]', '{"addresses": [{"state": "Massachusetts", "street": "332 Enrique Inlet", "country": "Maldives", "postal_code": "52978"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(37, 'Ruben', 'Schaefer', '2021-11-16 12:51:29.50736', 'Legacy Retail Consultant', 198315, '16', '["Grocery", "Music"]', '{"addresses": [{"state": "Colorado", "street": "39978 Kenya Divide", "country": "United Arab Emirates", "postal_code": "86544"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(38, 'Jenee', 'Howell', '2021-09-07 20:43:38.33505', 'Government Assistant', 114376, '26', '["Automotive", "Music"]', '{"addresses": [{"state": "Vermont", "street": "504 Man Highway", "country": "Uganda", "postal_code": "83121-7504"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(39, 'Xavier', 'Kessler', '2022-04-03 09:53:25.967728', 'National Legal Liaison', 141639, '15', '["Shoes"]', '{"addresses": [{"state": "Nevada", "street": "75651 Abshire Alley", "country": "Pakistan", "postal_code": "29603-8539"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}'),
(41, 'Candelaria', 'Walter', '2020-08-13 08:17:01.237831', 'Central Marketing Associate', 53827, '20', '["Industrial"]', '{"addresses": [{"state": "South Dakota", "street": "8257 Fahey Brooks", "country": "Luxembourg", "postal_code": "60465-9287"}]}', '{"crm": 0, "helpdesk": 1, "admin_panel": 0}'),
(42, 'Maryanna', 'Boehm', '2019-08-23 07:57:10.625905', 'Consulting Facilitator', 154751, '3', '["Books"]', '{"addresses": [{"state": "New York", "street": "488 Schamberger Mount", "country": "Kyrgyz Republic", "postal_code": "98796"}, {"state": "Vermont", "street": "2283 Ernser Mount", "country": "Guadeloupe", "postal_code": "95470"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(43, 'Clinton', 'Lubowitz', '2018-10-13 11:06:08.767055', 'Manufacturing Facilitator', 47586, '27', '["Shoes", "Outdoors"]', '{"addresses": [{"state": "South Dakota", "street": "3583 Richelle Stream", "country": "Mexico", "postal_code": "85559"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(44, 'Kacie', 'Quitzon', '2019-12-18 04:46:03.045589', 'Mining Agent', 123034, '10', '["Games", "Books"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(45, 'Jeramy', 'Olson', '2021-07-20 13:45:43.106782', 'Administration Orchestrator', 193157, '10', '["Music"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(46, 'Rolando', 'Sawayn', '2020-07-13 16:11:27.512727', 'Advertising Administrator', 70184, '24', '["Books", "Clothing"]', '{"addresses": [{"state": "Louisiana", "street": "94681 Gena Isle", "country": "Samoa", "postal_code": "81345"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(47, 'Rossana', 'Fisher', '2021-09-06 12:32:02.818179', 'Regional Technician', 189801, '15', '["Shoes", "Books"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(48, 'Shaunta', 'Weimann', '2021-10-04 16:49:13.340792', 'Retail Officer', 107051, '6', '["Tools"]', '{"addresses": [{"state": "North Carolina", "street": "653 Mellissa Street", "country": "Tuvalu", "postal_code": "67914"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(49, 'Elin', 'Jacobi', '2020-04-27 18:08:46.676497', 'Human Liaison', 133340, '19', '["Automotive", "Games"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(50, 'Royal', 'Langosh', '2021-09-26 23:05:52.589968', 'Manufacturing Orchestrator', 174241, '20', '["Shoes"]', '{"addresses": [{"state": "Indiana", "street": "617 Danyell Ferry", "country": "Mongolia", "postal_code": "00332"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(51, 'Arielle', 'Greenfelder', '2021-06-01 15:50:53.907055', 'Customer Strategist', 80209, '11', '["Jewelry", "Grocery"]', '{"addresses": [{"state": "Montana", "street": "81300 Bogisich Plain", "country": "Montserrat", "postal_code": "54820"}, {"state": "North Carolina", "street": "859 Terry Expressway", "country": "Djibouti", "postal_code": "21649"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}'),
(52, 'Normand', 'Nitzsche', '2019-05-09 21:20:11.146493', 'Product Administrator', 76569, '28', '["Jewelry", "Jewelry"]', '{"addresses": [{"state": "West Virginia", "street": "20753 Blick Circles", "country": "Barbados", "postal_code": "64089"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(53, 'Quincy', 'Gorczany', '2020-12-17 07:13:59.235527', 'Marketing Representative', 228491, '20', '["Books"]', '{"addresses": [{"state": "Delaware", "street": "293 Kutch Wall", "country": "Eritrea", "postal_code": "05735"}]}', '{"crm": 0, "helpdesk": 1, "admin_panel": 0}'),
(54, 'Deshawn', 'Green', '2019-10-18 10:09:40.266862', 'Investor Accounting Analyst', 128039, '10', '["Sports"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 1, "admin_panel": 0}'),
(55, 'Jessie', 'Lockman', '2020-08-02 01:57:39.212139', 'Corporate Hospitality Agent', 100684, '7', '["Tools", "Industrial"]', '{"addresses": [{"state": "New Mexico", "street": "6314 Lily Forges", "country": "Cape Verde", "postal_code": "24330"}, {"state": "Minnesota", "street": "2997 Lebsack Lodge", "country": "Belarus", "postal_code": "43893"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(56, 'Ivory', 'Bailey', '2021-10-23 00:39:05.863391', 'National Design Supervisor', 143619, '24', '["Garden", "Automotive"]', '{"addresses": [{"state": "Pennsylvania", "street": "125 Goyette Circles", "country": "Nepal", "postal_code": "11212-5906"}, {"state": "Michigan", "street": "6496 Alphonso Mountain", "country": "French Polynesia", "postal_code": "26491-2675"}]}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(57, 'Thomasine', 'Rosenbaum', '2019-05-10 15:05:54.175112', 'Community-Services Designer', 134292, '16', '["Garden", "Music"]', '{"addresses": [{"state": "North Dakota", "street": "2031 Price Bypass", "country": "Zimbabwe", "postal_code": "75249"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(58, 'Joshua', 'Rippin', '2020-03-16 06:00:55.575615', 'Customer Architect', 100524, '9', '["Electronics", "Automotive"]', '{"addresses": [{"state": "Minnesota", "street": "173 Tarra Route", "country": "Malawi", "postal_code": "34999"}, {"state": "Arizona", "street": "6288 Hintz Branch", "country": "Albania", "postal_code": "19441-2059"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(59, 'Lessie', 'Johnston', '2021-09-26 01:18:10.119765', 'Global Farming Representative', 154360, '14', '["Home"]', '{"addresses": [{"state": "Louisiana", "street": "3557 Chang Flats", "country": "Australia", "postal_code": "27665-0075"}, {"state": "Montana", "street": "63854 Jeni Trail", "country": "Libyan Arab Jamahiriya", "postal_code": "90931"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(60, 'Elnora', 'Rippin', '2022-06-02 21:20:29.630578', 'Global Associate', 38751, '7', '["Tools", "Kids"]', '{"addresses": [{"state": "Wyoming", "street": "3153 Schimmel Route", "country": "Bolivia", "postal_code": "67226"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(61, 'Mariko', 'Schoen', '2021-03-17 11:45:42.462426', 'Accounting Orchestrator', 131168, '15', '["Industrial"]', '{"addresses": [{"state": "Michigan", "street": "7025 Cesar Valley", "country": "Finland", "postal_code": "57609"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(62, 'Brigitte', 'Carter', '2022-06-28 18:08:24.78924', 'Mining Administrator', 108352, '18', '["Shoes", "Electronics"]', '{"addresses": [{"state": "New Mexico", "street": "1762 Stracke Forks", "country": "Micronesia", "postal_code": "63455-6795"}, {"state": "Arizona", "street": "507 Ernesto Dale", "country": "Cocos (Keeling) Islands", "postal_code": "71489"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(63, 'Charity', 'Wisozk', '2021-12-20 03:25:30.76952', 'Banking Manager', 91838, '19', '["Garden"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(88, 'Monroe', 'Shanahan', '2021-12-17 06:22:30.484871', 'Regional Liaison', 107569, '21', '["Baby"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(64, 'Stacey', 'Sanford', '2019-06-03 01:57:18.016243', 'Real-Estate Specialist', 129765, '4', '["Electronics", "Grocery"]', '{"addresses": [{"state": "Idaho", "street": "5668 Henry Lodge", "country": "Australia", "postal_code": "02723"}, {"state": "Nevada", "street": "17462 Sylvie Overpass", "country": "Uzbekistan", "postal_code": "72057"}]}', '{"crm": 0, "helpdesk": 1, "admin_panel": 0}'),
(65, 'Angelina', 'Kling', '2020-05-07 19:01:22.090375', 'Global Developer', 195048, '20', '["Beauty"]', '{"addresses": [{"state": "Michigan", "street": "915 Paris Wells", "country": "Mongolia", "postal_code": "85718-6478"}, {"state": "Delaware", "street": "431 Benton Turnpike", "country": "Brunei Darussalam", "postal_code": "05919-5003"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(66, 'Kasi', 'O''Reilly', '2020-10-31 19:58:06.774222', 'Investor Administration Designer', 116864, '16', '["Shoes"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(67, 'Merrilee', 'Goldner', '2020-12-03 09:07:19.953529', 'Global Marketing Administrator', 200547, '28', '["Outdoors", "Beauty"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(68, 'Lincoln', 'Rowe', '2021-06-25 01:24:11.709216', 'Investor Design Engineer', 41578, '28', '["Garden", "Industrial"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(69, 'Danuta', 'Mayer', '2020-03-25 19:16:11.134195', 'Banking Designer', 126672, '1', '["Music"]', '{"addresses": [{"state": "Maryland", "street": "97981 Oberbrunner Fort", "country": "Belarus", "postal_code": "95166"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(70, 'Toccara', 'Spencer', '2019-06-22 15:42:10.45843', 'Dynamic IT Manager', 116785, '24', '["Music", "Games"]', '{"addresses": [{"state": "Maryland", "street": "817 Leffler Summit", "country": "China", "postal_code": "53518-7280"}, {"state": "South Dakota", "street": "8579 Murray Mountains", "country": "United States of America", "postal_code": "67003-2115"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(71, 'Ardella', 'Stracke', '2018-11-29 01:40:22.74599', 'Dynamic Healthcare Associate', 145110, '25', '["Health", "Home"]', '{"addresses": [{"state": "California", "street": "6802 Rayna Brook", "country": "Sierra Leone", "postal_code": "16339"}, {"state": "Delaware", "street": "74327 Eboni Valleys", "country": "Liechtenstein", "postal_code": "88930-8242"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(72, 'Vaughn', 'Tremblay', '2021-05-08 07:23:47.608074', 'Accounting Specialist', 55605, '23', '["Jewelry"]', '{"addresses": [{"state": "Oregon", "street": "2096 Leonarda Flats", "country": "Nicaragua", "postal_code": "16703-0690"}]}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(73, 'Lesha', 'Skiles', '2020-03-07 12:18:55.651425', 'Forward Specialist', 119710, '1', '["Toys", "Tools"]', '{"addresses": [{"state": "Florida", "street": "554 Quintin Street", "country": "Finland", "postal_code": "93700-4733"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(74, 'Willetta', 'Waelchi', '2021-09-21 08:32:56.872566', 'National Sales Director', 219901, '13', '["Industrial", "Automotive"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(75, 'Donte', 'Johnson', '2019-06-05 06:29:51.521697', 'Human IT Liaison', 81207, '12', '["Beauty"]', '{"addresses": [{"state": "Illinois", "street": "54422 Haley Overpass", "country": "Tuvalu", "postal_code": "79700"}, {"state": "Maine", "street": "1854 Schuppe Parkway", "country": "Kyrgyz Republic", "postal_code": "43720-0533"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(76, 'Jimmie', 'Gottlieb', '2022-08-11 05:12:46.444454', 'District Mining Agent', 151332, '17', '["Sports", "Beauty"]', '{"addresses": [{"state": "Illinois", "street": "4265 Monty Brook", "country": "Albania", "postal_code": "38718-5885"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(77, 'Odis', 'Turner', '2020-08-10 09:02:06.752046', 'Human Manager', 217316, '24', '["Jewelry", "Clothing"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(78, 'Marcelino', 'Watsica', '2019-01-05 18:29:23.557427', 'Investor Design Developer', 103852, '1', '["Outdoors"]', '{"addresses": [{"state": "Nebraska", "street": "55931 Trantow Crossing", "country": "Netherlands", "postal_code": "71608"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(79, 'Danae', 'Carter', '2021-04-20 00:05:35.457915', 'Lead IT Coordinator', 75011, '13', '["Books"]', '{"addresses": [{"state": "Alabama", "street": "3089 Rutherford Viaduct", "country": "Algeria", "postal_code": "98647-6720"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(80, 'Ward', 'Rippin', '2019-12-27 22:10:58.873551', 'Design Producer', 88402, '18', '["Toys", "Movies"]', '{"addresses": [{"state": "Ohio", "street": "98194 Labadie Springs", "country": "Haiti", "postal_code": "51274"}, {"state": "West Virginia", "street": "142 Dooley Skyway", "country": "Tokelau", "postal_code": "75530"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(81, 'Ayako', 'Bogan', '2019-02-21 03:07:37.258163', 'Healthcare Representative', 161197, '15', '["Industrial"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(82, 'Amelia', 'Renner', '2020-07-26 07:07:01.008602', 'Forward Marketing Specialist', 125935, '1', '["Games", "Baby"]', '{"addresses": [{"state": "Missouri", "street": "7512 Daniel Meadows", "country": "Lao People''s Democratic Republic", "postal_code": "43666"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(83, 'Jeffrey', 'Schneider', '2022-07-20 11:49:14.749214', 'Central Hospitality Consultant', 102906, '21', '["Kids"]', '{"addresses": [{"state": "Massachusetts", "street": "3329 Sung Lakes", "country": "Switzerland", "postal_code": "11653-0063"}, {"state": "Kentucky", "street": "893 Hudson Freeway", "country": "Gambia", "postal_code": "63721"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(84, 'Sherita', 'Greenholt', '2021-08-13 09:01:11.304756', 'Sales Specialist', 132446, '17', '["Shoes"]', '{"addresses": [{"state": "Massachusetts", "street": "86819 Bernier Skyway", "country": "South Africa", "postal_code": "01212-1685"}, {"state": "Montana", "street": "1282 Blanda Ville", "country": "Virgin Islands, U.S.", "postal_code": "96689-4480"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}'),
(85, 'Sonya', 'Wilkinson', '2018-09-30 04:19:07.551602', 'Design Specialist', 160058, '28', '["Health", "Outdoors"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(86, 'Annemarie', 'Mayer', '2019-01-22 09:04:11.072461', 'Consulting Analyst', 213843, '2', '["Computers", "Computers"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(87, 'Dong', 'Murphy', '2022-08-02 18:51:38.044225', 'Technology Strategist', 201477, '27', '["Beauty"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 0, "admin_panel": 0}'),
(89, 'Virgilio', 'Pfeffer', '2018-11-06 16:28:50.932782', 'Dynamic Mining Consultant', 134940, '4', '["Baby"]', '{"addresses": [{"state": "Texas", "street": "5678 Russel Valleys", "country": "Comoros", "postal_code": "07715-1330"}, {"state": "Nebraska", "street": "8657 Penny Freeway", "country": "Netherlands Antilles", "postal_code": "50882-6189"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(90, 'Natacha', 'Bogisich', '2022-04-30 12:46:42.93552', 'Legacy Healthcare Technician', 46363, '28', '["Music"]', '{"addresses": [{"state": "Nevada", "street": "7219 Aleida Lodge", "country": "Vanuatu", "postal_code": "63879-5642"}, {"state": "Minnesota", "street": "6268 Rebbecca Curve", "country": "Macao", "postal_code": "60209"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(91, 'Cordell', 'Beer', '2019-06-20 02:27:51.902849', 'Regional Administrator', 233856, '7', '["Sports"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(92, 'Jon', 'Veum', '2020-10-06 15:30:51.55789', 'Consulting Director', 231795, '4', '["Automotive", "Clothing"]', '{"addresses": []}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(93, 'Portia', 'Gleason', '2021-03-31 09:03:17.929076', 'Legacy IT Planner', 150193, '11', '["Industrial", "Beauty"]', '{"addresses": [{"state": "Arizona", "street": "27108 Lorean Skyway", "country": "Jordan", "postal_code": "04175-2554"}]}', '{"crm": 0, "helpdesk": 1, "admin_panel": 1}'),
(94, 'Lara', 'Conroy', '2022-08-04 17:15:28.232697', 'Central Accounting Strategist', 138743, '4', '["Kids", "Computers"]', '{"addresses": [{"state": "South Dakota", "street": "11080 Almeta Turnpike", "country": "Paraguay", "postal_code": "14890-8453"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(95, 'Connie', 'Blanda', '2020-05-20 18:12:01.021634', 'Customer Technology Orchestrator', 138907, '8', '["Movies"]', '{"addresses": [{"state": "Michigan", "street": "722 Elden Run", "country": "Jamaica", "postal_code": "45337-1313"}, {"state": "Montana", "street": "966 Gregorio Springs", "country": "Macedonia", "postal_code": "09426"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 0}'),
(96, 'Irmgard', 'Sanford', '2021-08-02 13:59:35.862141', 'Legacy Specialist', 80177, '14', '["Automotive"]', '{"addresses": []}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(97, 'Desmond', 'Quitzon', '2020-06-16 13:30:14.162334', 'Education Specialist', 36070, '4', '["Music"]', '{"addresses": [{"state": "Iowa", "street": "3008 Ghislaine Manors", "country": "Sweden", "postal_code": "90207-1066"}]}', '{"crm": 0, "helpdesk": 0, "admin_panel": 1}'),
(98, 'Dudley', 'Deckow', '2020-05-31 19:45:24.489302', 'National Developer', 96730, '13', '["Games"]', '{"addresses": [{"state": "Oregon", "street": "850 Merlin Garden", "country": "Palestinian Territory", "postal_code": "23686"}]}', '{"crm": 1, "helpdesk": 0, "admin_panel": 1}'),
(99, 'Branden', 'Braun', '2020-01-26 02:44:46.465966', 'Central Design Consultant', 212981, '15', '["Tools"]', '{"addresses": [{"state": "Indiana", "street": "943 Britt Corners", "country": "Liechtenstein", "postal_code": "75985-1457"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 1}'),
(100, 'Fletcher', 'Conn', '2022-09-18 13:11:16.372809', 'Legal Architect', 220368, '14', '["Home", "Clothing"]', '{"addresses": [{"state": "New Mexico", "street": "7871 Bosco Terrace", "country": "Saint Martin", "postal_code": "79612-6393"}, {"state": "Wyoming", "street": "639 Purdy Camp", "country": "Congo", "postal_code": "22283"}]}', '{"crm": 1, "helpdesk": 1, "admin_panel": 0}');
SELECT pg_catalog.setval('public.employees_id_seq', 100, true);
ALTER TABLE ONLY public.employees
ADD CONSTRAINT employees_pkey PRIMARY KEY (id);
UPDATE employees
SET
systems_access = jsonb_build_object(
'crm', (CASE WHEN RANDOM() > 0.5 THEN now() - ((random() * 90)::text || ' days')::interval ELSE NULL END),
'helpdesk', (CASE WHEN RANDOM() > 0.5 THEN now() - ((random() * 90)::text || ' days')::interval ELSE NULL END),
'admin_panel', (CASE WHEN RANDOM() > 0.5 THEN now() - ((random() * 90)::text || ' days')::interval ELSE NULL END)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment