Tribal Knowledge
  • Welcome
  • Getting Started
    • Install Guide
    • Introduction to Tribal Knowledge
      • About Exemplar
      • About Ratifier
      • About Kulvert
      • About Redactor
    • Supported Languages
  • Exemplar Tutorials
    • Knowledge Sharing Code Review
      • Create a New Project
      • Create a CheckList
      • Add Files for Code Review
      • Start Automated Code Review
  • Ratifier Tutorials
    • SQL Sanity Check
      • Oracle Setup
        • Oracle Database Setup
        • Create SQL File for Sanity Check
      • SQL Server Setup
        • SQL Server Database Setup
        • Copy of Create SQL File for Sanity Check
      • Create a New Project
      • Add SQL File for Sanity Check
      • SQL Sanity Check - Datasource Config
      • SQL Sanity Check - Start
    • SQL Simulator
      • Technical Overview
        • Step 1
        • Step 2
        • Step 3
        • Step 4
        • Step 5
      • Oracle Setup
        • Oracle Database Setup
        • Create SQL File for SQL Simulator
        • Create a New Project
        • Add SQL File for SQL Simulator
        • Datasource Config
        • Start Simulation
      • SQL Server Setup
        • SQL Server Database Setup
        • Create SQL File for SQL Simulator
        • Create a New Project
        • Add SQL File for SQL Simulator
        • Datasource Config
        • Start Simulation
  • Kulvert
    • CI/CD Pipeline
      • Oracle Setup
        • Oracle Database Setup
        • Create SQL File for Kulvert
      • SQL Server Setup
        • SQL Server Database Setup
        • Create SQL File for SQL simulator
      • Create a New Project
      • Add SQL File for Kulvert
      • Kulvert - Datasource Config
      • Kulvert - PipeLine Start
  • Redactor
    • About Redactor
  • About
    • About Tribal Knowledge
Powered by GitBook
On this page
  1. Ratifier Tutorials
  2. SQL Simulator
  3. SQL Server Setup

SQL Server Database Setup

SQL Simulator Setup

The first thing you will need to do is to set up blank schema for the SQL Simulator to run in. It is important that you set this blank schema up in a non production database. Use the below script for this task:

CREATE LOGIN sql_simulator_1   
    WITH PASSWORD = '12345';  
GO  

CREATE USER sql_simulator_1 FOR LOGIN sql_simulator_1;  
GO  

CREATE SCHEMA sql_simulator_1;
GO

Next please run the following in a different database than the one you used to create the sql_simulator_1 schema.

CREATE TABLE employees
( employee_id int NOT NULL PRIMARY KEY,
  employee_ssn varchar(9) NOT NULL,
  employee_first_name varchar(50) NOT NULL,
  employee_last_name varchar(50) NOT NULL,
  employee_address varchar(50) NOT NULL,
  city varchar(50),
  state varchar(50),
  zip varchar(50)
);


CREATE TABLE payroll (
    payroll_id int NOT NULL PRIMARY KEY,	
	paycheck_status varchar(1),
    account_number varchar(20),
    employee_id int  REFERENCES employees(employee_id)
);


insert into employees (employee_id, employee_ssn, employee_first_name, employee_last_name, employee_address, city, state, zip) 
values (1,'123456789', 'MARTINEZ','RODRIGUEZ', '110 WEATHERSFIELD DR','chester','va','21111');

insert into employees (employee_id, employee_ssn, employee_first_name, employee_last_name, employee_address, city, state, zip) 
values (2,'223466781', 'THOMAS','SMITH', '124 NEW CASTLE DR','chester','va','21111');

insert into employees (employee_id, employee_ssn, employee_first_name, employee_last_name, employee_address, city, state, zip) 
values (3,'323476782', 'WHITE','LOPEZ', '364 LEIGH FARM RD','chester','va','21111');

insert into employees (employee_id, employee_ssn, employee_first_name, employee_last_name, employee_address, city, state, zip) 
values (4,'423486783', 'HARRIS','WILLIAMS', '413 NOTTINGHAM DR','chester','va','21111');

insert into employees (employee_id, employee_ssn, employee_first_name, employee_last_name, employee_address, city, state, zip) 
values (5,'523496784', 'jason','LEWIS', '5006 MILL HILL LN','chester','va','21111');



insert into payroll (payroll_id, employee_id, paycheck_status, account_number) 
values (6, 1, 'S','00001234');
insert into payroll (payroll_id, employee_id, paycheck_status, account_number) 
values (7, 2, 'S','00001234');
insert into payroll (payroll_id, employee_id, paycheck_status, account_number) 
values (8, 3, 'S','00001234');
insert into payroll (payroll_id, employee_id, paycheck_status, account_number) 
values (9, 4, 'S','00001234');
insert into payroll (payroll_id, employee_id, paycheck_status, account_number) 
values (10, 5, 'S','00001234');
PreviousSQL Server SetupNextCreate SQL File for SQL Simulator

Last updated 2 years ago