Schema for chips
CREATE TABLE allegations(ctype VARCHAR, code BIGINT, allegations VARCHAR);
CREATE TABLE c_address(case_number VARCHAR, address VARCHAR, city VARCHAR, state_alpha VARCHAR, state_numeric BIGINT);
CREATE TABLE c_consolid(case_number VARCHAR, consolidation DATE, consol_id VARCHAR, consolidation_type VARCHAR, consolidation_code VARCHAR, consolidation_stage VARCHAR, date_severed VARCHAR, severance_id VARCHAR, severance_type VARCHAR, severance_code BIGINT, severance_stage BIGINT, key_consol_case_number VARCHAR, sub_consol_case_number VARCHAR);
CREATE TABLE c_formal1(case_number VARCHAR, cf1_date DATE, date_last_action DATE, consol_type VARCHAR, consol_code VARCHAR, update_control VARCHAR, code_date_complt_iss BIGINT, date_complaint_issued DATE, allegations VARCHAR, number_discrim BIGINT, complaint_control BIGINT, code_date_ro_disp BIGINT, date_ro_disp DATE, ro_disp_control VARCHAR, date_hearing_opened DATE, code_date_hearing_closed BIGINT, date_hearing_closed DATE, hearing_control VARCHAR, code_date_disp_issed_recd BIGINT, date_disp_issued_recd DATE, type_disposition VARCHAR, allegations_uphld VARCHAR, allegations_dismd VARCHAR, discrim_upheld VARCHAR, discrim_dismissed VARCHAR, back_pay_control BIGINT, admin_law_judge_disp BIGINT, board_decision_control BIGINT, card_control VARCHAR, number_discrim_reinst_ca BIGINT, number_rec_back_pay_uni_emp_cb BIGINT, number_rec_back_pay_only_ca BIGINT, number_discrim_restor_cb BIGINT, number_discrim_preferd BIGINT, remedy VARCHAR, code_date_hearing_opened BIGINT, chips_amended_code BIGINT, consol_server VARCHAR, case_state_action VARCHAR, complaint_calendar_year BIGINT, complaint_fical_year BIGINT, consol_case_number VARCHAR, sub_consol_case_number VARCHAR);
CREATE TABLE c_formal2(case_number VARCHAR, cf2_date DATE, date_last_action DATE, consolidation_type VARCHAR, consolidation_code VARCHAR, update_control BIGINT, code_date_transfer_board BIGINT, date_transfer_board DATE, control_type BIGINT, date_decision_issued DATE, type_decision VARCHAR, disp_allegations VARCHAR, allegations_uphld VARCHAR, allegations_dismd VARCHAR, number_discrim_reinstated_ca BIGINT, number_receive_back_pay_uni_emp_cb BIGINT, number_receive_back_pay_only_ca BIGINT, number_discrim_restored_cb BIGINT, number_discrim_dismissed BIGINT, number_discrim_preferred BIGINT, remedy VARCHAR, board_members VARCHAR, board_disposition_allegations BIGINT, close_control BIGINT, card_control VARCHAR, code_date_dec_issued VARCHAR, volume_number VARCHAR, issue_number VARCHAR, party_filing_excpt VARCHAR, board_members_5 VARCHAR);
CREATE TABLE c_formal3(case_number VARCHAR, cf3_date DATE, date_last_action DATE, consol_type VARCHAR, consol_code VARCHAR, update_control VARCHAR, date_ref_app_ct DATE, type_ref VARCHAR, date_pet_answ_filed DATE, date_ref_pet_answ DATE, date_ca_opinion DATE, date_brief_filed DATE, type_disposition BIGINT, ca_no VARCHAR, date_ca_decree DATE, type_decree BIGINT, control_case BIGINT, card_control VARCHAR, code_date_brief_filed BIGINT);
CREATE TABLE c_formal4(case_number VARCHAR, cf4_date DATE, date_last_action DATE, stage_last_action VARCHAR, consolidation_type VARCHAR, consolidation_code VARCHAR, upate_control VARCHAR, date_referred_scb VARCHAR, date_recom_writ_cert BIGINT, type_recom VARCHAR, date_pret_writ_cert_filed DATE, party_filing BIGINT, date_sc_action DATE, sc_ruling BIGINT, date_supreme_court_argue BIGINT, date_supreme_court_dec VARCHAR, type_supreme_court_dec VARCHAR, date_back_pay_specs DATE, stage_back_pay_specs VARCHAR, date_hearing_closed DATE, date_administrative_law_judge_dec_issued DATE, date_board_suppl_decision DATE, type_board_suppl_decision VARCHAR, date_ref_acb VARCHAR, date_suppl_ca_decree VARCHAR, card_control BIGINT, code_date_hearing_closed BIGINT, code_date_administrative_law_judges_decision_issued BIGINT, code_date_board_suppl_decision BIGINT);
CREATE TABLE c_master(case_number VARCHAR, region BIGINT, ctype VARCHAR, docket BIGINT, suffix BIGINT, file_date DATE, close_date DATE, date_last_action DATE, county VARCHAR, state BIGINT, industry VARCHAR, complainant BIGINT, joint_complainant BIGINT, respondent VARCHAR, joint_respondent BIGINT, number_employed BIGINT, allegations BIGINT, number_discrim BIGINT, situation BIGINT, number_of_charges BIGINT, type_charge VARCHAR, number_allegations BIGINT, status VARCHAR, formal_action_control VARCHAR, machine_control VARCHAR, proceeding_control VARCHAR, fact_advice VARCHAR, type_refusal VARCHAR, fact_appeal VARCHAR, code_date_ro_disp BIGINT, date_ro_disp DATE, method_disposition BIGINT, collyer_deferral VARCHAR, date_collyer_began DATE, date_collyer_end DATE, code_date_closed FLOAT, stage_close VARCHAR, method_close VARCHAR, reason_remedy_close VARCHAR, status_barg_close FLOAT, solic_stages_investig BIGINT, contact_witness VARCHAR, date_re_advice_received DATE, date_action_on_advice DATE, date_appeal_received DATE, date_action_on_appeal DATE, hearing_held_code BIGINT, decision_made_code VARCHAR, chips_close_flag VARCHAR, chips_close_date DATE, related_case BIGINT, chips_amended_code VARCHAR, formal_setl VARCHAR, filed_calendar_year BIGINT, closed_calendar_year BIGINT, filed_fiscal_year BIGINT, closed_fiscal_year BIGINT, key_case_number VARCHAR, sub_key_case_number VARCHAR, transferred_case_number VARCHAR, PRIMARY KEY(case_number));
CREATE TABLE c_names(case_number VARCHAR, "name" VARCHAR);
CREATE TABLE c_trailer(case_number VARCHAR, trailer_date DATE, date_last_action DATE, allegations_adjusted BIGINT, settlement VARCHAR, approval_requested BIGINT, number_reinstated BIGINT, number_w_reinstated BIGINT, number_d_reinstated BIGINT, number_p_list BIGINT, number_restored BIGINT, number_withdrawn_employment BIGINT, number_rcu_employed BIGINT, number_allegations BIGINT, number_made_whole BIGINT, number_receiving_back_pay BIGINT, total_amt BIGINT, amt_pd_co BIGINT, amt_pd_un BIGINT, back_pay_control BIGINT, f_installment VARCHAR, number_rcu_dues BIGINT, total_comp BIGINT, total_pd_co BIGINT, total_pd_un BIGINT, dues_control BIGINT, remedy VARCHAR, date_end_picket DATE, date_end_work_stop DATE, number_employs_picket BIGINT, number_employes_stop BIGINT, number_to_be_reinst BIGINT, related_combined_code VARCHAR, related_key_case_number VARCHAR);
CREATE TABLE l_c_case_closing(stage VARCHAR, "method" VARCHAR, definition VARCHAR);
CREATE TABLE l_c_case_pending_status_codes(status BIGINT, definition VARCHAR);
CREATE TABLE l_case_types(code VARCHAR, "type" VARCHAR);
CREATE TABLE l_county(alpha_state_code VARCHAR, numeric_state_code BIGINT, county_number BIGINT, county_name VARCHAR, resident_code VARCHAR, region BIGINT, district BIGINT, resident_office VARCHAR, "Unnamed: 8" VARCHAR);
CREATE TABLE l_elect_conclusive(code BIGINT, conclusive_election_control VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_elect_incumbent_union(code BIGINT, incumbent_union VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_elect_method_of_disposition(code VARCHAR, "action" VARCHAR, method_of_close VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_elect_participating_union(code VARCHAR, participating_union VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_elect_stage_of_closing(code VARCHAR, stage_of_closing VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_elect_union_type(code VARCHAR, definition VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_party_filing_objection(code BIGINT, situation VARCHAR);
CREATE TABLE l_size_of_unit_codes(code BIGINT, number_of_employees VARCHAR);
CREATE TABLE l_stage_of_disposition(code VARCHAR, stages_of_disposition_before_hearing_and_after_hearing_closed VARCHAR);
CREATE TABLE l_state_codes(code BIGINT, state_name VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_transaction_codes(trans VARCHAR, "action" VARCHAR, PRIMARY KEY(trans));
CREATE TABLE l_type_elections(code VARCHAR, type_election VARCHAR, description VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_union_codes_and_names(code BIGINT, union_name VARCHAR, PRIMARY KEY(code));
CREATE TABLE l_unit_codes(code VARCHAR, definition VARCHAR, PRIMARY KEY(code));
CREATE TABLE r_address(case_number VARCHAR, address VARCHAR, city VARCHAR, state_alpha VARCHAR, state_numeric VARCHAR);
CREATE TABLE r_blocking(case_number VARCHAR, block_date DATE, blocking_case_number VARCHAR);
CREATE TABLE r_consolid(case_number VARCHAR, consolidation_date DATE, consol_id BIGINT, key_consol_case_reg BIGINT, key_consol_case_type VARCHAR, key_consol_case_docket BIGINT, key_consol_case_suffix VARCHAR, sub_consol_case_reg VARCHAR, sub_consol_case_type VARCHAR, sub_consol_case_docket VARCHAR, sub_consol_case_suffix VARCHAR, consolidation_type VARCHAR, consolidation_code VARCHAR, consolidation_stage VARCHAR, date_severed DATE, severance_id VARCHAR, severance_type VARCHAR, severance_code BIGINT, severance_stage BIGINT);
CREATE TABLE r_formal1(case_number VARCHAR, rf1_date DATE, date_last_action DATE, consol_code VARCHAR, code_date_hearing_close BIGINT, date_hearing_close DATE, control BIGINT, update_control BIGINT, date_dec_issued DATE, unit VARCHAR, type_dec BIGINT, type_specl_elect VARCHAR, date_waiver VARCHAR, date_req_review DATE, party_filing BIGINT, date_ruling_reg DATE, ruling_control BIGINT, date_board_dec_req VARCHAR, board_dec VARCHAR, type_board_dec VARCHAR, board_unit VARCHAR, volume_number VARCHAR, issue_number VARCHAR, board_members_5 VARCHAR, chips_amended_code VARCHAR);
CREATE TABLE r_formal2(case_number VARCHAR, suffix VARCHAR, rf2_date DATE, date_last_action DATE, "transaction" BIGINT, action_777 BIGINT, consol_code VARCHAR, date_election_held DATE, date_obj_chall_filed DATE, number_obj_filed BIGINT, number_chall BIGINT, date_hearing_ordered DATE, basis_election VARCHAR, party_filing_ob BIGINT, hearing_code VARCHAR, hearing_ordered_by BIGINT, date_rps_no_hearing_held DATE, update_control VARCHAR, date_hearing_closed DATE, date_hearing_opened DATE, date_rpt_on_obj_chall DATE, first_election_rpt BIGINT, rpt_control VARCHAR, date_rd_suppl_dec VARCHAR, ruling_on_obj BIGINT, type_decision BIGINT, decision_control BIGINT, another_election VARCHAR, previously_reported BIGINT, date_certification DATE, stage VARCHAR, "method" VARCHAR, rd_of_bd_dec VARCHAR, date_review_waivered BIGINT, date_exception_filed DATE, exception_code BIGINT, date_ruling_on_exc DATE, ruling_on_exc_code BIGINT, date_reg_for_review DATE, party_filing_req BIGINT, date_ruling_on_req DATE, ruling_on_req_code BIGINT, date_board_dec BIGINT, type_board_dec VARCHAR, number_obj_sustained BIGINT, number_obj_overuled BIGINT, number_obj_withdrawn BIGINT, number_chall_sustained BIGINT, number_chall_overuled BIGINT, number_chall_withdrawn BIGINT, date_obj_chall_resolved DATE, ruling_on_obj_r BIGINT, "ruling_on_obj_r.1" BIGINT, date_bd_dec_on_rev BIGINT, bd_dec_on_rev BIGINT);
CREATE TABLE r_master(case_number VARCHAR, region BIGINT, ctype VARCHAR, docket BIGINT, file_date DATE, close_date DATE, date_last_action DATE, industry VARCHAR, state BIGINT, county BIGINT, petitioner_type VARCHAR, petitioner BIGINT, joint_petitioner BIGINT, local_number VARCHAR, recogn_union_type VARCHAR, recogn_union BIGINT, joint_recogn_union BIGINT, unit VARCHAR, number_emp BIGINT, proposed_no_emp BIGINT, picket_8b7c BIGINT, status BIGINT, machine_control VARCHAR, proceeding_control VARCHAR, date_appeal BIGINT, ruling_code BIGINT, consol_code VARCHAR, date_notice_hearing_issued DATE, date_hearing_opened DATE, date_hearing_closed DATE, hearing_control VARCHAR, code_date_closed BIGINT, stage_closed VARCHAR, method_closed VARCHAR, reason_close VARCHAR, hearing_held_code BIGINT, dec_made_code BIGINT, date_agree_approv DATE, date_appea_recd DATE, date_action_on_appeal DATE, chips_amended_code BIGINT, date_hearing2_closed_108 DATE, date_hearing2_open_108 DATE, blocking_case_code VARCHAR, consol_sever VARCHAR, case_stage_action VARCHAR, consol_type BIGINT, chips_close_flag BIGINT, chips_close_date DATE, filed_calendar_year BIGINT, filed_fiscal_year BIGINT, closed_calendar_year BIGINT, closed_fiscal_year BIGINT, blocking_case_number VARCHAR, consol_case_number VARCHAR, sub_consol_case_number VARCHAR, transfer_case_number VARCHAR, PRIMARY KEY(case_number));
CREATE TABLE r_names(case_number VARCHAR, "name" VARCHAR);
CREATE TABLE rc_elect(case_number VARCHAR, suffix VARCHAR, election_date DATE, unit VARCHAR, description_election VARCHAR, expedited BIGINT, date_election_held DATE, type_election VARCHAR, no_elig BIGINT, join_union_won BIGINT, union_won_votes BIGINT, union_won_intl_type BIGINT, union_won_intl BIGINT, joint_union_lost_1 BIGINT, union_lost_votes_1 BIGINT, union_lost_intl_1_type BIGINT, union_lost_intl_1 BIGINT, joint_union_lost_2 BIGINT, union_lost_votes_2 BIGINT, union_lost_intl_2_type BIGINT, union_lost_intl_2 BIGINT, joint_union_lost_3 BIGINT, union_lost_votes_3 BIGINT, union_lost_intl_3_type VARCHAR, union_lost_intl_3 BIGINT, joint_union_lost_4 BIGINT, union_lost_votes_4 BIGINT, union_lost_intl_4_type VARCHAR, union_lost_intl_4 BIGINT, votes_against_union BIGINT, challenges BIGINT, void_votes BIGINT, elect_vote_control BIGINT, control BIGINT, conclusive BIGINT, challenges_determinative BIGINT, patric_union VARCHAR, incumb_union VARCHAR, mail_ballot BIGINT, union_control VARCHAR, cross_petition BIGINT, runoff_necessary BIGINT, cross_pet_case_number VARCHAR, rerun_runoff_number BIGINT, impounded BIGINT, date_elect_certified DATE, stage VARCHAR, "method" VARCHAR);
CREATE TABLE regions(region_num BIGINT, district_num_fk BIGINT, region_name VARCHAR, subregion_flag BIGINT, belongs_to_region BIGINT, PRIMARY KEY(region_num));
CREATE TABLE ud_elect(case_number VARCHAR, suffix VARCHAR, election_date DATE, cunion VARCHAR, description_election VARCHAR, expedited BIGINT, unit VARCHAR, date_election_held DATE, type_election VARCHAR, no_elig BIGINT, v_votes BIGINT, for_prop BIGINT, agn_prop BIGINT, chall BIGINT, void BIGINT, cout BIGINT, control BIGINT, date_election_certified DATE, stage VARCHAR, "method" BIGINT, mail_ballot BIGINT, cross_pet_region VARCHAR, cross_pet_type VARCHAR, cross_pet_docket VARCHAR, cross_pet_suffix VARCHAR, rerun_runoff_number VARCHAR, impounded BIGINT);