# Kaun Si SQL File Use Karein?

## Do SQL Files Hain:

### 1. `hrm/database/schema.sql` (NEW - Simplified)
**Location:** `c:\xampp\htdocs\hrm2\hrm\database\schema.sql`
**Size:** ~4.6 KB
**Created:** Latest (11:37 PM)

**Contains:**
- ✅ `roles` table (4 roles: super_admin, hr_admin, manager, employee)
- ✅ `users` table
- ✅ `sites` table
- ✅ `user_sites` table (many-to-many relationship)
- ✅ Basic structure only

**Use This If:**
- Aap naya database setup kar rahe hain
- Aapko sirf basic tables chahiye (roles, users, sites)
- Aap step-by-step modules add karna chahte hain

---

### 2. `database/schema.sql` (OLD - Complete)
**Location:** `c:\xampp\htdocs\hrm2\database\schema.sql`
**Size:** ~26 KB
**Created:** Earlier (11:21 PM)

**Contains:**
- ✅ `roles` table
- ✅ `users` table
- ✅ `sites` table
- ✅ `permissions` table
- ✅ `role_permissions` table
- ✅ `employees` table
- ✅ `departments` table
- ✅ `designations` table
- ✅ `attendance` table
- ✅ `leave_types` table
- ✅ `leave_applications` table
- ✅ `employee_leave_balances` table
- ✅ `salary_components` table
- ✅ `employee_salary_structure` table
- ✅ `payroll_periods` table
- ✅ `payroll_records` table
- ✅ `payroll_details` table
- ✅ `system_settings` table
- ✅ `audit_logs` table
- ✅ `user_sessions` table
- ✅ Complete initial data (roles, permissions, settings)

**Use This If:**
- Aapko complete system chahiye
- Sab modules ek saath chahiye
- Production ready database chahiye

---

## Recommendation (Suggestion):

### Option 1: Complete System (Recommended)
**Use:** `database/schema.sql` (OLD - Complete)

**Reason:**
- Sab tables ek saath mil jayengi
- Attendance, Leave, Payroll modules ke liye ready
- Initial data already included
- Production ready

**Steps:**
1. phpMyAdmin kholen
2. Database create karein: `hrm2`
3. `database/schema.sql` import karein
4. Done! ✅

---

### Option 2: Step by Step
**Use:** `hrm/database/schema.sql` (NEW - Simplified)

**Reason:**
- Pehle basic structure setup karein
- Phir modules one by one add karein

**Steps:**
1. `hrm/database/schema.sql` import karein
2. Phir baad mein baaki tables manually add karein

---

## Final Answer:

**Use `database/schema.sql` (OLD - Complete file)**

Kyunki:
- ✅ Sab modules ke liye tables ready hain
- ✅ Attendance, Leave, Payroll sab kaam karega
- ✅ Initial data already hai
- ✅ Complete system ek saath setup ho jayega

**Import Command:**
```sql
-- phpMyAdmin mein:
-- 1. Database select karein: hrm2
-- 2. Import tab click karein
-- 3. File select karein: database/schema.sql
-- 4. Go button click karein
```

Ya command line se:
```bash
mysql -u root -p hrm2 < database/schema.sql
```

