-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQL_EP_9.sql
45 lines (32 loc) · 883 Bytes
/
SQL_EP_9.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
-- in this chapter we will learn about Where Clause commands and its works:
create database company;
use company;
create table employee(
id int primary key,
name varchar(50),
age int ,
department varchar(50),
city varchar(50),
salary int
);
insert into employee(id,name,age,department,city,salary)
values
(1,"rahul",21,"IT","Mumbai",1500),
(2,"afsara",26,"hr","pune",2000),
(3,"abi",27,"IT","Mumbai",2500),
(4,"raj",25,"marketing","surat",2400),
(5,"adhi",24,"finace","indore",2000);
select * from employee;
SET SQL_SAFE_UPDATES = 0; -- use this query while you have got the error like safe mode
update employee
set salary = 50000
where department = "hr";
-- delete command:
-- delete from employee
-- where department = "IT";
-- select command:
-- select name,age from employee;
-- select * from employee;
-- where clause command:
select * from employee
where age>25;