-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadv.sql
66 lines (42 loc) · 1.08 KB
/
adv.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use mydatabase;
LOAD DATA INFILE 'c:/users/aman_tiwari/desktop/book2.csv'
INTO TABLE abc
FIELDS TERMINATED BY ','
-- ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
create table abc(col1 varchar(30),col2 varchar(30));
C:\Users\Aman_Tiwari\Desktop
LOAD DATA INFILE 'C:/Book1.csv'
INTO TABLE abc
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n';
SHOW VARIABLES LIKE "secure_file_priv";
insert into abc values ('aman','tiwari');
select * from abc;
LOAD DATA INFILE 'c:/temp/student.csv'
INTO TABLE abc
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
use mydatabase;
create table student (sname char(30));
create table teacher (tname char(30),sname char(30));
DELIMITER @@
create trigger tinsert
before insert on student for each row
begin
insert into teacher(sname) values(new.sname);
end @@
DELIMITER ;
insert into student values('aman');
select * from teacher;
drop trigger tinsert;
show triggers;
DELIMITER @@
create trigger tinsert
before insert on student for each row
begin
insert into teacher(sname) values(sname);
end @@
DELIMITER ;