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 NOT NULL DEFAULT 25000
);
-- 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', 27000),
('Lucy', 'Brown', 'Cashier', 'LOAN', 23000),
('Ravi', 'Kumar', 'Developer', 'IT', 35000),
('Mina', 'Patel', 'Accountant', 'Finance', 29000),
('Sam', 'Wilson', 'HR Specialist', 'HR', 32000),
('Tina', 'Jones', 'Sales Executive', 'loan', 26000),
('Alex', 'Morris', 'Team Lead', 'IT', 42000);
#SPACE CONSUMING MORE
SELECT * FROM employees WHERE salary = 29000 OR salary = 26000 or salary = 42000 or dept = 'sales';
#EFFICENT WAY IS USING (IN)
SELECT * FROM employees WHERE dept In('Finance', 'IT', 'Loan');
#not in
SELECT * FROM employees WHERE dept Not In('Finance', 'IT', 'Loan');
To embed this project on your website, copy the following code and paste it into your website's HTML: