> For the complete documentation index, see [llms.txt](https://docs.tribalknowledge.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tribalknowledge.tech/ratifier-tutorials/sql-simulator/sql-server-setup/sql-server-database-setup.md).

# 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:

```sql
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.

```plsql
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');
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tribalknowledge.tech/ratifier-tutorials/sql-simulator/sql-server-setup/sql-server-database-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
