Real world payroll data based on two Public Domain datasets published by the city of Baton Rouge, Louisiana.
City-Parish Employees: "City-Parish employees, both active and inactive, that exist in the City-Parish Payroll System."
City-Parish Employee Annual Salaries: "City-Parish employees' annual salaries and other payroll related information. Information is calculated after the last payroll is run for the year specified."
The data was downloaded, cleaned and split into multiple normalized tables in January 2019. A random date (based upon hire_date & years in service) was added as an employee's birthdate. All files contain tab-delimited data:
br_departments.tsv, 53 rows: Departments within City-Parish government (PK: department_number)
br_divisions.tsv, 271 rows: Divisions within City-Parish government (PK: division_number)
br_jobs.tsv, 1226 rows: Jobs within City-Parish government, both active and inactive (PK: job_code)
br_pay_plan.tsv, 2479 rows: A pay plan defines the salary ranges for each job class (PK: pay_grade, pay_step)
br_payroll.tsv, 24740 rows: City-Parish employees, both active and inactive, that exist in the City-Parish Payroll System (PK: employee_number)
br_salary_hist.tsv, 54338 rows: City-Parish employees' annual salaries and other payroll related information (years 2008 to 2017)
-
BTEQmust be installed on your client. -
The load user needs the
CREATE TABLEright in the target database.
-
Download payroll_db_Teradata.zip and extract the zip file to a folder, e.g.
C:\Samples\payroll_db_Teradata. -
Modify the file
br_install.btqto match your target system. Optionally modify the database name. -
Open a cmd (or PowerShell) window, change to the folder and run the file using BTEQ:
cd C:\Samples\payroll_db_Teradata
bteq < br_install.btq > br_install.log
-
Download payroll_db_Teradata.zip and extract the zip file to a folder, e.g.
~/Samples/payroll_db_Teradata. -
Modify the file
br_install.btqto match your target system. Optionally modify the database name. -
Open a terminal window, change to the folder and run the file using BTEQ:
cd ~/Samples/payroll_db_Teradata
bteq < br_install.btq > br_install.log
The script should finish in a few minutes.
If there's an error message returned check the br_install.log for the failing step.
Before re-running the install script the tables must be dropped in a specific order due to the FK constraints
ALTER TABLE br_departments
DROP FOREIGN KEY (manager_employee_number) REFERENCES WITH NO CHECK OPTION br_payroll (employee_number);
DROP TABLE br_payroll;
DROP TABLE br_salary_hist;
DROP TABLE br_pay_plan;
DROP TABLE br_divisions;
DROP TABLE br_departments;
DROP TABLE br_jobs;
DROP VIEW br_active_employees;
DROP VIEW br_active_jobs;