SQL INTERVIEW QUESTION | Indian Income Tax Calculations

Rules

1. Sec 80C - 150000 or the value which ever is lower

2. Sec 80D - 25000 or the value which ever is lower

3. Sec 80G - The value in the table

4. Standard Deduction - 50000


Income Range Tax Rate

Up to ₹2,50,000 Nil

₹2,50,001 – ₹5,00,000 5%

₹5,00,001 – ₹10,00,000 20%

Above ₹10,00,000 30%



 DROP TABLE IF EXISTS EmployeeTaxDetails;



CREATE TABLE EmployeeTaxDetails (

    emp_id INT PRIMARY KEY,

    Sec80C INT,

    Sec80D INT,

    Sec80G INT,

    Total_Salary INT

);


-- Insert the 10 rows of data

INSERT INTO EmployeeTaxDetails (emp_id, Sec80C, Sec80D, Sec80G, Total_Salary) VALUES

(1, 100000.00, 20000.00, 5000.00, 250000.00),

(2, 250000.00, 25000.00, 10000.00, 300000.00),

(3, 80000.00, 40000.00, 15000.00, 350000.00),

(4, 120000.00, 30000.00, 8000.00, 500000.00),

(5, 170000.00, 35000.00, 12000.00, 650000.00),

(6, 175000.00, 40000.00, 18000.00, 900000.00),

(7, 100000.00, 45000.00, 25000.00, 1250000.00),

(8, 150000.00, 50000.00, 20000.00, 1800000.00),

(9, 140000.00, 55000.00, 30000.00, 2500000.00),

(10, 150000.00, 60000.00, 35000.00, 3500000.00);


SELECT * FROM EmployeeTaxDetails



Comments

Popular posts from this blog

50 Essential SQL Questions to Land Your Dream Job

How to find all the customers who placed orders on three consecutive days | SQL Scenario questions

ACCENTURE SQL INTERVIEW QUESTION | Change the ProductIDs