#SELECT * FROM employees LIMIT 3; --syntaxx
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
);
INSERT into employees (emp_id,fname,lname,desig,dept) VALUES (101,'Raju','DWIVEDI','Manager','Loan');
INSERT into employees (fname,lname,desig,dept) VALUES ('Sham','SUNDAR','Cashier','Cash');
INSERT into employees (fname,lname,desig,dept) VALUES ('Paul','TIWARI','Asscociate','Loan');
INSERT into employees (fname,lname,desig,dept) VALUES ('Alex','MISHRA','Accountant','Loan');
INSERT into employees (fname,lname,desig,dept) VALUES ('Victor','TRIPATHI','Asscociate','Deposit');
ALTER TABLE employees ADD Column salary INT Not NULL Default 25000;
#UPDATE employees set salary = 12000 where emp_id =102;
UPDATE employees
SET salary = CASE
WHEN emp_id = 101 THEN 15000
WHEN emp_id = 102 THEN 12000
WHEN emp_id = 103 THEN 18000
WHEN emp_id = 104 THEN 14000
WHEN emp_id = 105 THEN 16000
ELSE salary -- Keep the salary unchanged for other employees
END;
#The LIMIT clause in SQL is used to specify the maximum number of rows to return in a query result.
#SELECT * FROm employees;
select * from employees LIMIT 2; #This will return the first 5 rows from the employees table.
select * from employees LIMIT 2, 4;
#salary>
select * from employees order by salary desc LIMIT 1;
To embed this project on your website, copy the following code and paste it into your website's HTML: