show databases
use company
CREATE TABLE CUSTOMERS(
ID INT NOT NULL,
NAME VARCHAR (20) NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR (25) ,
SALARY DECIMAL (18, 2),
PRIMARY KEY (ID)
);
show tables
describe customers
INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (1, 'Ramesh', 32, 'Ahmedabad',2000.0);
INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (2, 'Khilan', 25, 'Delhi', 1500.00 );
INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (3, 'kaushik', 23, 'Kota', 2000.00 );
INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (4, 'Chaitali', 25, 'Mumbai', 6500.00 );
INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (5, 'Hardik', 27, 'Bhopal', 8500.00 );
INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (6, 'Komal', 22, 'MP', 4500.00 );
INSERT INTO CUSTOMERS
VALUES (7, 'Muffy', 24, 'Indore', 10000.00 );
SELECT ID,NAME,AGE,ADDRESS,SALARY FROM CUSTOMERS
select * from customers
select ID,NAME,SALARY from customers
SELECT ID, NAME, SALARY
FROM CUSTOMERS
WHERE SALARY > 2000;
SELECT ID, NAME, SALARY
FROM CUSTOMERS
WHERE SALARY > 2000 and SALARY < 10000;
SELECT ID, NAME, SALARY
FROM CUSTOMERS
WHERE NAME = 'Hardik';
SELECT ID, NAME, SALARY, AGE
FROM CUSTOMERS
WHERE SALARY > 2000 AND age < 25;
SELECT ID, NAME, SALARY, AGE
FROM CUSTOMERS
WHERE SALARY > 2000 OR age < 25;
SELECT * FROM CUSTOMERS
WHERE NAME LIKE 'R%';
SELECT * FROM CUSTOMERS
WHERE NAME LIKE '%i%';
select upper(name), age+10 from customers
SELECT *
FROM CUSTOMERS
WHERE NAME LIKE '__a%';
SELECT *
FROM CUSTOMERS
order by name asc;