CREATE TABLE employees (
    emp_id INT PRIMARY KEY AUTO_INCREMENT,
    fname VARCHAR(50) NOT NULL,
    lname VARCHAR(50) NOT NULL,
    desig VARCHAR(50) NOT NULL DEFAULT 'Probation',
    dept VARCHAR(50) NOT NULL,
    salary INT 
);
-- Inserting 10 tuples into the employees table
INSERT INTO employees (fname, lname, desig, dept, salary) VALUES 
('John', 'Doe', 'Manager', 'HR', 30000),
('Jane', 'Smith', 'Developer', 'IT', 40000),
('Paul', 'Adams', 'Associate', 'Sales', null),
('Lucy', 'Brown', 'Cashier', 'LOAN', 23000),
('Ravi', 'Kumar', 'Developer', 'IT', 35000),
('Mina', 'Patel', 'Accountant', 'Finance', 49000),
('Sam', 'Wilson', 'HR Specialist', 'HR', 32000),
('Tina', 'Jones', 'Sales Executive', 'loan', 26000),
('Alex', 'Morris', 'Team Lead', 'IT', 42000);

#select fname, salary, CASE WHEN salary >= 27000 THEN 'HIGHER SALARY' ElsE 'LOWER SALARY' END AS 'SALARY CATEGORY' from employees  order by salary desc;
#select fname,lname,salary,case when salary <= 25000 then 'lower salary' when salary between 25000 and 42000 then 'Mid Salary'  ELSE 'high SALARY' END AS 'SALARY CATEGORY' FROM employees order by salary ;

# to check the null values in the table
#SELECT * FROM employees where salary IS NULL;

#not like 
select * from employees where fname LIKE 'j%'; #output start from letter j
select * from employees where fname NOT LIKE 'j%'; #output start not from letter j



Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: