当前位置:网站首页>MySQL training report [with source code]

MySQL training report [with source code]

2022-06-12 01:26:00 RainstormGod

​​​​​

Catalog

Task a : Background setting

1. Open console :

2. Sign in MySQL

Task 2 : Establishment of fraudster database

1. First you create a fraud system database “scam_ Spell the name ”

2. Next, use the fraud system database

3. Then create the user table “user_ Spell the name ”, The field information in the table is as follows :

4. Then create the driver information table “driver_info_ Spell the name ”, The field information in the table is as follows :

​ edit 5. Then create a customer service information table “Customer_info_ Spell the name ”, The field information in the table is as follows :

6. Then create the canon information table card_farming_ Spell the name , The field information in the table is as follows :

7. Create a Kanon bank card table “card_farm _ Spell the name ”, The field information in the table is as follows :

8. Create a victim information table “victim_info _ Spell the name ”, The field information in the table is as follows :

9. Create victim bank card table “victim_card _ Spell the name ”, The field information in the table is as follows :

10. Create a fraud table “swindle_info _ Spell the name ”, The field information in the table is as follows :

11. Create a fraud detail table “scam_info_ Spell the name ”, The field information in the table is as follows :

12.    Create a log table “log_ Spell the name ”, The field information in the table is as follows :

13.    Create triggers to facilitate updating log tables ( All tables are required to add , Delete , Change Will be recorded in the log table (log))

Task three : The criminal recruits

1. Insert all fields into user table data in batch

 2. All fields are inserted into driver information table data in batch

 3. Specify fields to insert customer service information table data in batches

4. Specify fields to batch insert data in the canon table

5. View log table

Task 4 : Buy leek information

1. Specify the field to insert the victim information table data

2. After chatting, I learned that Zhang had recently moved to Fandou community and changed his home address to Fandou community

After verification, I learned that Li had changed his telephone number ( Change Li's telephone number to :13567787659)

Mission 5: Cannon buys bank cards

1. All fields are inserted into the card table data of the Agricultural Bank of China in batches

Task six : Wang was cheated

1. Members begin to act , They aimed at the first leek : Wang mou , Let you tell them about Wang

2. Insert data into the victim's bank card table

3. Insert information into the fraud table

4. Insert data into the fraud details table

5. Insert data into the fraud details table

6. So you decide to inquire about the distribution of stolen money according to the output ( Check the fraud of Wang when he was cheated twice ID, Customer service ID, Driver ID, Amount of fraud )

Task seven : Zhang was cheated …..

1. Members begin to act , They aimed at the second leek : zhang , Let you tell them about Zhang

( Query Zhang's gender , Company , Recent events , Home address )

2. Insert data into the victim's bank card

3. Insert data into the fraud table

4. Insert data into the fraud details table

5. Insert data into the fraud details table

Mission 8: Create a cheated view

1. Create a cheated view view_vc_ Spell the name ( The view contains victim information , Fraud details )

2. Create a cheated view view_scam_ Spell the name ( The view contains information about the fraudster )

Mission 9: Li was cheated

1. Members begin to act , They aimed at the second leek : Li Mou , You should check the information of Li as usual

( Query the gender of Li , Company , Recent events , Home address ).

2. Insert data into the victim's bank card

3. Insert data into the fraud table

 4. I learned that Li had just experienced divorce , The criminal gang pretended to be an acquaintance Li had not seen for a long time , Comfort Li , Then borrow two sums of money in case of emergencies .

Task ten : The police caught the fraudster Back up the fraud company database

1. Back up all databases , The file named “all_ Spell the name .sql”( Cut two pictures command + file )

2. Back up the fraud database , The file named “scam_ Spell the name .sql”( Cut two pictures command + file )

3. Delete the fraud database

4. Create a fraud database “scam_ Spell the name ”

5. sign out MySQL Sign in

6. Execute fraud database backup file

 7. Sign in MySQL

8. Using the fraud database

 9. View all tables ( Look at the log table , Record all your hard work )


  • Task a : Background setting

You are a new college student , As a newcomer to the society, you heard that there is a high paying job in northern Myanmar . It seems that you are glad to go . It turned out that he was deceived , Just as you were about to be executed , You just heard that this fraud organization is transforming into telecom fraud , There is a shortage of computer talents , In order to save your life , So he volunteered , Tell the criminals that they are computer majors who have practiced for two and a half years , So you were taken to the head of the criminal organization xx In front of

The leader asked you to show off your skills , Then consider whether to let you join the gang or execute you

So you turn on the computer

1. Open console :

2. Sign in MySQL

You introduced... To the leader MySQL, Told her MySQL The power of .

Although the leader doesn't understand , But I was shocked , I decided not to kill you , Agree to ask you to join the gang .

The leader sighed : Read less , If I had learned this in those days, I wouldn't have learned this wrong way .

The leader first introduced you to several members of the team , You also know the membership of the fraudster , Duziteng, the eldest brother of the gang ( President du ), The second brother Wei feeds oxygen ( President Wei ), Third brother fan Tong ( Fan Zhong )

( At present, only these three people are known , Seeing the three of them, you can't help feeling , Just these three cheated me )

  • Task 2 : Establishment of fraudster database

After you joined the gang , Mr. Du hurriedly urged you to use MySQL Build a database of fraudsters. You learned from President du , After the basic routine information of criminals, they start to build data

1. First you create a fraud system database “scam_ Spell the name ”

create database scam_zhongjinlin;

2. Next, use the fraud system database

use scam_zhongjinlin;

3. Then create the user table “user_ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

id

char

16

 

user ID(u_date_xxxxx)

phone

char

11

Primary key

 

User contact information

username

varchar

20

 

Non empty , only

user name

password

varchar

20

 

Non empty

password

question

text

 

 

Non empty

Password recovery problem

answer

text

 

 

Non empty

Find the answer to the password question

create table user_zhongjinlin(

    -> id char(16) comment" user ID(u_date_xxxxx)",

    -> phone char(11) comment" User contact information ",

    -> username varchar(20) not null unique comment" user name ",

    -> password varchar(20) not null comment " password ",

    -> question text not null comment" Password recovery problem ",

    -> answer text not null comment" Find the answer to the password question ",

    -> primary key(phone)

-> );

4. Then create the driver information table “driver_info_ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

driver_id

char

16

Primary key

 

Driver ID(d_date_xxxxx)

phone

char

11

Foreign keys

Non empty

Driver contact information

Entry_time

date

 

 

Non empty

Starting time

nickname

varchar

30

 

Non empty

Driver code

create table driver_into_zhongjinlin(

    -> driver_id char(16) primary key comment " Driver ID(d_date_xxxxx)",

    -> phone char(11) not null comment" Driver contact information ",

    -> Entry_time date not null comment" Starting time ",

    -> nickname varchar(30) not null comment" Driver code ",

    -> constraint fk_phone foreign key(phone) references user_zhongjinlin(phone)

-> );

5. Then create a customer service information table “Customer_info_ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

Customer_id

char

16

Primary key

 

Customer service ID(c_date_xxxxx)

phone

char

11

Foreign keys

Non empty , only

Customer service contact information

nickname

varchar

30

 

Non empty

Customer service code

Entry_time

date

 

 

Non empty

Starting time

create table customer_into_zhongjinlin(

    -> customer_id char(16) primary key comment" Customer service ID(c_date_xxxxx)",

    -> phone char(11) not null unique comment" Customer service contact information ",

    -> nickname varchar(30) not null comment" Customer service code ",

    -> Entry_time date not null comment" Starting time ",

    -> constraint fk_phone1 foreign key(phone) references driver_into_zhongjinlin(phone)

-> );

6. Then create the canon information table card_farming_ Spell the name , The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

card_fa_id

char

16

Primary key

 

Cannon IDf_date_xxxxx)

phone

char

11

Foreign keys

Non empty , only

Canon contact information

nickname

varchar

30

 

Non empty

Canon code

Entry_time

date

 

 

Non empty

Starting time

create table card_farming_zhongjinlin(

    -> card_fa_id char(16) primary key comment" Cannon ID(f_date_xxxxx)",

    -> phone char(11) not null unique comment" Canon contact information ",

    -> nickname varchar(30) not null comment" Canon code ",

    -> Entry_time date not null comment" Starting time ",

    -> constraint fk_phone2 foreign key(phone) references customer_into_zhongjinlin(phone)

-> );

7. Create a Kanon bank card table “card_farm _ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

card_farming_id

char

16

Primary key

 

Kanon bank card ID(bc_date_xxxxx)

card_fa_id

char

16

Foreign keys

 

Cannon ID(f_date_xxxxx)

bank_name

char

20

 

 

Name of Bank

card_number

char

16 

 

Non empty

Card number

is_deprecated

enum("yes","no")

 

 

Default no

Whether to discard

deprecated_time

datetime

 

 

Discard time

create table card_farm_zhongjinlin(

    -> card_farming_id char(16) primary key comment" Kanon bank card ID(bc_date_xxxxx)",

    -> card_fa_id char(16) comment" Cannon ID(f_date_xxxxx)",

    -> bank_name char(20) comment" Name of Bank ",

    -> card_number char(16) not null comment" Card number ",

    -> is_deprecated enum("yes","no") default"no" comment" Whether to discard ",

    -> deprecated_time datetime comment" Discard time ",

    -> constraint fk_card_fa_id foreign key(card_fa_id) references

    -> card_farming_zhongjinlin(card_fa_id)

-> );

8. Create a victim information table “victim_info _ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

victim_id

char

16

Primary key

 

The victim ID(v_date_xxxxx)

victim_name

char

16

 

Non empty

The victim's name

gender

enum("man","woman")

 

 

Non empty

Gender

workplace

char

200

 

Non empty

Company

recent_events

text

 

 

 

Recent events

home_address

text

 

 

 

Home address

victim_phone

char

11

 

Non empty

Contact information of the victim

create table victim_info_zhongjinlin(

    -> victim_id char(16) primary key comment" The victim ID(v_date_xxxxx)",

    -> victim_name char(16) not null comment" The victim's name ",

    -> gender enum("man","woman") not null comment" Gender ",

    -> workplace char(200) not null comment" Company ",

    -> recent_events text comment" Recent events ",

    -> home_address text comment" Home address ",

    -> victim_phone char(11) not null comment" Contact information of the victim "

-> );

9. Create victim bank card table “victim_card _ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

victim_card_id

char

16

Primary key

 

Victim's bank card ID(vc_date_xxxxx)

victim_id

char

16

Foreign keys

 

The victim ID(v_date_xxxxx)

vc_bank_name

char

20

 

 

Name of Bank

vc_card_number

int

 

 

Non empty

Transfer in card number

vc_out_amount

int

 

 

Non empty

balance

order_time

datetime

 

 

Non empty

Victimization time

create table victim_card_zhongjinlin(3//

    -> victim_card_id char(16) primary key comment" Victim's bank card ID(vc_date_xxxxx)",

    -> victim_id char(16) comment" The victim ID(v_date_xxxxx)",

    -> vc_bank_name char(20) comment" Name of Bank ",

    -> vc_card_number char(20) not null comment" Transfer in card number ",

    -> vc_out_amount char(20) not null comment" balance ",

    -> order_time datetime not null comment" Victimization time ",

    -> constraint fk_victim_id foreign key(victim_id) references victim_info_zhongjinlin(victim_id)

-> );

10. Create a fraud table “swindle_info _ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

scam_id

char

16

Primary key  

 

fraud ID(s_date_xxxxx)

Customer_id

char

16

Foreign keys

Non empty

Customer service ID(c_date_xxxxx)

victim_id

char

16

Foreign keys

Non empty

The victim ID((v_date_xxxxx))

amount

double

 

 

Non empty

Total amount of fraud

start_time

datetime

 

 

Non empty

Starting time

end_time

datetime

 

 

Non empty

End time

create table swindle_info_zhongjinlin(

    -> scam_id char(16) primary key comment" fraud ID(s_date_xxxxx)",

    -> customer_id char(16) not null comment" Customer service ID(c_date_xxxxx)",

    -> victim_id char(16) not null comment" The victim ID((v_date_xxxxx))",

    -> amount double not null comment" Total amount of fraud ",

    -> start_time datetime not null comment" Starting time ",

    -> end_time datetime not null comment" End time ",

    -> constraint fk_customer_id foreign key(customer_id) references  customer_into_zhongjinlin(customer_id),

    -> constraint fk_victim_id1 foreign key(victim_id) references  victim_info_zhongjinlin(victim_id)

-> );

11. Create a fraud detail table “scam_info_ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

details_id

char

16

Primary key

 

Fraud details ID(sc_date_xxxxx)

scam_id

char

16

Foreign keys

 

fraud ID(s_date_xxxxx)

driver_id

char

16

Foreign keys

 

Driver ID(d_date_xxxxx)

victim_id

char

16

Foreign keys

 

Victim's bank card id(v_date_xxxxx)

card_farming_id

char

16

Foreign keys

 

Kanon bank card ID(bc_date_xxxxx)

scam_amount

double

 

 

 

Amount of fraud

create table scam_info_zhongjinlin(

    -> details_id char(16) primary key comment" Fraud details ID(sc_date_xxxxx)",

    -> scam_id char(16) comment" fraud ID(s_date_xxxxx)",

    -> driver_id char(16) comment" Driver ID(d_date_xxxxx)",

    -> victim_id char(16) comment" Victim's bank card id(v_date_xxxxx)",

    -> card_farming_id char(16) comment" Kanon bank card ID(bc_date_xxxxx)",

    -> scam_amount double comment" Amount of fraud ",

    -> constraint fk_scam_id2 foreign key(scam_id) references swindle_info_zhongjinlin(scam_id),

    -> constraint fk_driver_id2 foreign key(driver_id) references driver_into_zhongjinlin(driver_id),

    -> constraint fk_victim_id4 foreign key(victim_id) references victim_card_zhongjinlin(victim_card_id),

    -> constraint fk_card_farming_id foreign key(card_farming_id) references card_farm_zhongjinlin(card_farming_id)

    -> );

12.    Create a log table “log_ Spell the name ”, The field information in the table is as follows :

Field name

data type

length

Lord 、 Foreign keys

Other constraints

Notes

table_name

char

100

 

 

Changed table name

Op_time

Datetime

Operating time

operate

enum("insert","update","delete")

 

 

operation

create table log_zhongjinlin(

    -> table_name char(100) comment" Changed table name ",

    -> op_time datetime comment" Operating time ",

    -> operate enum("insert","update","delete") comment" operation "

    -> );

13.    Create triggers to facilitate updating log tables ( All tables are required to add , Delete , Change Will be recorded in the log table (log))

create trigger tr_zjl before insert on user_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("user_zhongjinlin",now(),"insert");

create trigger tr_zjl1 before delete on user_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("user_zhongjinlin",now(),"delete");

create trigger tr_zjl2 before update on user_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("user_zhongjinlin",now(),"update");

create trigger tr_zjl3 before insert on driver_into_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("driver_into_zhongjinlin",now(),"insert");

create trigger tr_zjl4 before delete on driver_into_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("driver_into_zhongjinlin",now(),"delete");

create trigger tr_zjl5 before update on driver_into_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("driver_into_zhongjinlin",now(),"update");

create trigger tr_zjl6 before insert on customer_into_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("customer_into_zhongjinlin",now(),"insert");

create trigger tr_zjl7 before delete on customer_into_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("customer_into_zhongjinlin",now(),"delete");

create trigger tr_zjl8 before update on customer_into_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("customer_into_zhongjinlin",now(),"update");

create trigger tr_zjl9 before insert on card_farming_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("card_farming_zhongjinlin",now(),"insert");

create trigger tr_zjl10 before delete on card_farming_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("card_farming_zhongjinlin",now(),"delete");

create trigger tr_zjl11 before update on card_farming_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("card_farming_zhongjinlin",now(),"update");

create trigger tr_zjl12 before insert on card_farm_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("card_farm_zhongjinlin",now(),"insert");

create trigger tr_zjl13 before delete on card_farm_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("card_farm_zhongjinlin",now(),"delete");

create trigger tr_zjl14 before update on card_farm_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("card_farm_zhongjinlin",now(),"update");

create trigger tr_zjl15 before insert on victim_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("victim_info_zhongjinlin",now(),"insert");

create trigger tr_zjl16 before delete on victim_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("victim_info_zhongjinlin",now(),"delete");

create trigger tr_zjl17 before update on victim_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("victim_info_zhongjinlin",now(),"update");

create trigger tr_zjl18 before insert on victim_card_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("victim_card_zhongjinlin",now(),"insert");

create trigger tr_zjl19 before delete on victim_card_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("victim_card_zhongjinlin",now(),"delete");

create trigger tr_zjl20 before update on victim_card_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("victim_card_zhongjinlin",now(),"update");

create trigger tr_zjl21 before insert on swindle_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("swindle_info_zhongjinlin",now(),"insert");

create trigger tr_zjl22 before delete on swindle_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("swindle_info_zhongjinlin",now(),"delete");

create trigger tr_zjl23 before update on swindle_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("swindle_info_zhongjinlin",now(),"update");

create trigger tr_zjl24 before insert on scam_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("scam_info_zhongjinlin",now(),"insert");

create trigger tr_zjl25 before delete on scam_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("scam_info_zhongjinlin",now(),"delete");

create trigger tr_zjl26 before update on scam_info_zhongjinlin

    -> for each row

    -> insert into log_zhongjinlin values("scam_info_zhongjinlin",now(),"update");

After a busy time , You have finally set up the prototype of this fraud database , Next, just insert the data, so you go to the big brother to ask for information about other criminals

As a result, brother told you , The note came down a few days ago “ general cleaning ”, Many brothers were taken away , So I want you to go out with him “ hiring ”

  • Task three : The criminal recruits

So you go out with your eldest brother to see what kind of social idle talents there are ( The slip )

You and your eldest brother smuggled to the Mainland , Turn a circle , I didn't find any great wisdom , So brother Hu took you to a night market stall to drink to relieve your boredom , Just halfway through the drink, you hear a little noise on the table next to you , It turned out that a group of people at the next table quarreled over whether the aviation rockets burn coal or diesel , You have a look , These wise men , Not exactly what our organization needs “ personnel ” Do you , So you motioned to big brother , Brother seems to understand , So he got up , Take out a box of general Taishanhong , I spread a wave to this pile of people who should slip away , These people are talking about such high-end issues at a young age , Do you want to do big things with him …… After some deception , This group should have successfully entered our gang

After having someone, big brother decided to package our fraud Gang as a company , Let the only college student in the gang ( That's you ) Take a name

You decided to call it : There are a group of people in Myanmar “ wisdom ” Of young people believe that under the leadership of President du , Have a good money journey !

1. Insert all fields into user table data in batch

Id

phone

username

password

question

answer

u_2022_00001

010-6555111

that

u_2022_0000131

Liu

One

u_2022_00002

010-6609611

Chen er

u_2022_0000132

Chen

Two

u_2022_00003

010-6419336

Zhang San

u_2022_0000133

Zhang

3、 ... and

u_2022_00004

010-6608326

Li Si

u_2022_0000134

Li

Four

u_2022_00005

010-8287268

Wang Wu

u_2022_0000135

king

5、 ... and

u_2022_00006

010-5816060

Zhao Liu

u_2022_0000136

Zhao

6、 ... and

u_2022_00007

010-5816078

Sun Qi

u_2022_0000137

Grandchildren

7、 ... and

insert into user_zhongjinlin values

    -> ("u_2022_00001","010-6555111"," that ","u_2022_0000131"," Liu "," One "),

    -> ("u_2022_00002","010-6609611"," Chen er ","u_2022_0000132"," Chen "," Two "),

    -> ("u_2022_00003","010-6419336"," Zhang San ","u_2022_0000133"," Zhang "," 3、 ... and "),

    -> ("u_2022_00004","010-6608326"," Li Si ","u_2022_0000134"," Li "," Four "),

    -> ("u_2022_00005","010-8287268"," Wang Wu ","u_2022_0000135"," king "," 5、 ... and "),

    -> ("u_2022_00006","010-5816060"," Zhao Liu ","u_2022_0000136"," Zhao "," 6、 ... and "),

-> ("u_2022_00007","010-5816078"," Sun Qi ","u_2022_0000137"," Grandchildren "," 7、 ... and ");

 2. All fields are inserted into driver information table data in batch

driver_id

phone

Entry_time

nickname

d_2022_00001

010-6555111

2022/5/15

Wendao

d_2022_00002

010-6609611

2022/5/16

Otope

d_2022_00003

010-6419336

2022/5/17

Bow length

insert into driver_info_zhongjinlin values

    -> ("d_2022_00001","010-6555111","2022/5/15"," Wendao "),

    -> ("d_2022_00002","010-6609611","2022/5/16"," Otope "),

-> ("d_2022_00003","010-6419336","2022/5/17"," Bow length ");

 3. Specify fields to insert customer service information table data in batches

Customer_id

phone

nickname

Entry_time

c_2022_00004

010-6608326

Muzi

2022/5/16

c_2022_00005

010-8287268

Trinity

2022/5/17

insert into customer_info_zhongjinlin(customer_id,phone,nickname,Entry_time)

    -> values

    -> ("c_2022_00004","010-6608326"," Muzi ","2022/5/16"),

-> ("c_2022_00005","010-8287268"," Trinity ","2022/5/17");

4. Specify fields to batch insert data in the canon table

card_fa_id

phone

nickname

Entry_time

f_2022_00006

010-5816060

sixteen

2022/5/15

f_2022_00007

010-5816078

Zixiao

2022/5/13

insert into card_farming_zhongjinlin(card_fa_id,phone,nickname,Entry_time)

    -> values

    -> ("f_2022_00006","010-5816060"," sixteen ","2022/5/15"),

-> ("f_2022_00007","010-5816078"," Zixiao ","2022/5/13");

5. View log table

select * from log_zhongjinlin;

  • Task 4 : Buy leek information

Big brother goes in “ Further education ” My brother got to know an information peddler who sold other people's information , He bought a lot of information about leeks in his hands

1. Specify the field to insert the victim information table data

victim_id

victim_name

gender

workplace

recent_events

home_address

victim_phone

v_2023_00001

Wang mou

man

school

I was caught surfing the Internet

Tipping Garden

13555623159

v_2023_00002

zhang

man

factory

Be promoted

Tumbling Street

13555893159

v_2023_00003

Li Mou

woman

housewife

divorce

Tipping bucket community

13578623159

insert into victim_info_zhongjinlin(victim_id,victim_name,gender,workplace,recent_events,home_address,victim_phone) values

    -> ("v_2023_00001"," Wang mou ","man","school"," I was caught surfing the Internet "," Tipping Garden ","13555623159"),

    -> ("v_2023_00002"," zhang ","man","factory"," Be promoted "," Tumbling Street ","13555893159"),

-> ("v_2023_00003"," Li Mou ","woman","housewife"," divorce "," Tipping bucket community ","13578623159");

2. After chatting, I learned that Zhang had recently moved to Fandou community and changed his home address to Fandou community

After verification, I learned that Li had changed his telephone number ( Change Li's telephone number to :13567787659

update victim_info_zhongjinlin set home_address=" Tipping bucket community " where

    -> victim_name=" zhang ";

   update victim_info_zhongjinlin set victim_phone=13567787659 where

-> victim_name=" Li Mou ";

You sigh , Helpless shook his head , Can't , I had to keep on working

Mission 5: Cannon buys bank cards

1. All fields are inserted into the card table data of the Agricultural Bank of China in batches

card_farming_id

card_fa_id

bank_name

card_number

is_deprecated

deprecated_time

bc_2022_00001

f_2022_00006

Industrial and Commercial Bank of China

1234123412341230

yes

2024/5/20

bc_2022_00002

f_2022_00006

Bank for economic construction

1234567123418980

yes

2024/5/15

bc_2022_00003

f_2022_00007

Agricultural bank of

1234667123418980

no

bc_2022_00004

f_2022_00007

Bank for economic construction

1234567789418980

yes

2024/5/12

bc_2022_00005

f_2022_00006

Bank of Communications

1234567893418980

yes

2024/5/23

bc_2022_00006

f_2022_00007

Agricultural bank of

1234457123418980

no

bc_2022_00007

f_2022_00006

Bank of Communications

1234567823418980

no

When you try to insert data , I found the wrong report , Take a closer look , It is found that the data type of the bank card number field is set incorrectly , Change the data type to char(16), And insert the data again .

alter table card_farm_zhongjinlin change card_number card_number char(16);

insert into card_farm_zhongjinlin values

    -("bc_2022_00001","f_2022_00006"," Industrial and Commercial Bank of China ","1234123412341230","yes","2024/5/20"),

    -("bc_2022_00002","f_2022_00006"," Bank for economic construction ","1234567123418980","yes","2024/5/15"),

    -> ("bc_2022_00003","f_2022_00007"," Agricultural bank of ","1234667123418980","no",null),

    -("bc_2022_00004","f_2022_00007"," Bank for economic construction ","1234567789418980","yes","2024/5/12"),

    -("bc_2022_00005","f_2022_00006"," Bank of Communications ","1234567893418980","yes","2024/5/23"),

    -> ("bc_2022_00006","f_2022_00007"," Agricultural bank of ","1234457123418980","no",null),

    -> ("bc_2022_00007","f_2022_00006"," Bank of Communications ","1234567823418980","no",null);

After doing this , You finally breathe a sigh of relief , call , Now everything is ready except to cheat

Task six : Wang was cheated

1. Members begin to act , They aimed at the first leek : Wang mou , Let you tell them about Wang

( Query the gender of Wang , Company , Recent events , Home address )

select gender Gender ,workplace Company ,recent_events Recent events ,home_address Home address from victim_info_zhongjinlin where victim_name=" Wang mou ";

After telling them Wang's information , They began to act , Through Wang's information to get close to ( Pretend to borrow money from an acquaintance ) The way to get his balance

2. Insert data into the victim's bank card table

victim_card_id

victim_id

vc_bank_name

vc_card_number

vc_out_amount

order_time

vc_2022_00001

v_2023_00001

Industrial and Commercial Bank of China

1234123412341230

15098

2023/5/3

insert into victim_card_zhongjinlin values

    -> ("vc_2022_00001","v_2023_00001"," Industrial and Commercial Bank of China ","1234123412341230","15098","2023/5/3");

3. Insert information into the fraud table

scam_id

Customer_id

victim_id

amount

start_time

end_time

s_2022_00002

c_2022_00004

v_2023_00001

0

2023/5/3

2023/6/3

insert into swindle_info_zhongjinlin values

    -> ("s_2022_00002","c_2022_00004","v_2023_00001","0","2023/5/3","2023/6/3");

You borrow money by pretending that acquaintances are having trouble , Got the first pot of gold from this fraud gang 5000 fast

4. Insert data into the fraud details table

details_id

scam_id

driver_id

victim_id

card_farming_id

scam_amount

sc_2022_00001

s_2022_00001

d_2022_00001

vc_2022_00001

bc_2022_00001

5000

insert into scam_info_zhongjinlin values 

 ("sc_2022_00001","s_2022_00001","d_2022_00001","vc_2022_00001","bc_2022_00001",5000);

Then you're on a social software “ touch ” Pretend to be a beautiful woman and get to know Wang , Mr. Wang soon put it on , You take 520 Will be to , Other girls cheated Wang out of the second sum of money on the grounds that they had gifts

You can't help sighing : Although these should slip the eyes full of “ wisdom ”, But it's really a set of tricks , On fishing for the wrong gate , It has to be this group of people , It is true that there is a specialty in the art industry .

5. Insert data into the fraud details table

details_id

scam_id

driver_id

victim_id

card_farming_id

scam_amount

sc_2022_00002

s_2022_00001

d_2022_00001

vc_2022_00001

bc_2022_00001

10000

insert into scam_info_zhongjinlin values

    -> ("sc_2022_00002","s_2022_00001","d_2022_00001","vc_2022_00001","bc_2022_00001",10000);

After earning Mr. Wang's first payment, your criminal gang quarreled because of the uneven distribution of the stolen goods

6. So you decide to inquire about the distribution of stolen money according to the output ( Check the fraud of Wang when he was cheated twice ID, Customer service ID, Driver ID, Amount of fraud )

select a.scam_id fraud ID,a.customer_id Customer service ID,b.driver_id Driver ID,b.scam_amou Amount of fraud from

-> swindle_info_zhongjinlin a inner join scam_info_zhongjinlin b;

Task seven : Zhang was cheated …..

1. Members begin to act , They aimed at the second leek : zhang , Let you tell them about Zhang

( Query Zhang's gender , Company , Recent events , Home address )

select gender Gender ,workplace Company ,recent_events Recent events ,home_address Home address from victim_info_zhongjinlin where victim_name=" zhang ";

After telling them Zhang's information , They began to act , Through Zhang's information to get close to ( To pretend to be a bank worker ) The way to get his balance

2. Insert data into the victim's bank card

victim_card_id

victim_id

vc_bank_name

vc_card_number

vc_out_amount

order_time

vc_2022_00002

v_2023_00002

Bank for economic construction

1234567123418980

200678

2023/5/4

insert into victim_card_zhongjinlin values

("vc_2022_00002","v_2023_00002"," Bank for economic construction ","1234567123418980","200678","2023/5/4");

3. Insert data into the fraud table

scam_id

Customer_id

victim_id

amount

start_time

end_time

s_2022_00003

c_2022_00005

v_2023_00002

0

2023/5/4

2023/6/4

insert into swindle_info_zhongjinlin values

-> ("s_2022_00003","c_2022_00005","v_2023_00002","0","2023/5/4","2023/6/4");

The criminal gang found that Zhang had been promoted by the leaders recently , So he pretended to be Zhang's leader and asked for bribes

Defraud Zhang 100000 element

4. Insert data into the fraud details table

details_id

scam_id

driver_id

victim_id

card_farming_id

scam_amount

sc_2022_00004

s_2022_00002

d_2022_00002

vc_2022_00002

bc_2022_00002

100000

insert into scam_info_zhongjinlin values

    -> ("sc_2022_00004","s_2022_00002","d_2022_00002","vc_2022_00002","bc_2022_00002",100000);

The second time, the criminal gang looked at Zhang's full balance , Never give up , So I decided to cheat again , This time I decided to play a big one , The fraud Gang is in a dating software “ touch ” Pretending to be a beautiful woman with Zhang “ accidental ” Get to know each other , Make an appointment with Zhang to meet at XX hotel , Then the criminals 150 A young lady from the red romance senior club was hired at a high price of RMB , Meet Zhang , Just when Zhang thought he was lucky , The gang pretended that the young lady's family , Rush into the room , Ask Zhang why he molested him “ pure ” My sister . And control Zhang , Ask Zhang to give a statement , Zhang immediately understood , I am being “ Cactus dance ”,……….. After this fraud , The criminal gang has got it again 100000 element

5. Insert data into the fraud details table

details_id

scam_id

driver_id

victim_id

card_farming_id

scam_amount

sc_2022_00003

s_2022_00002

d_2022_00002

vc_2022_00002

bc_2022_00002

100000

insert into scam_info_zhongjinlin values

    -> ("sc_2022_00003","s_2022_00002","d_2022_00002","vc_2022_00002","bc_2022_00002",100000);

Mission 8: Create a cheated view

On the day , You are big brother “ The office ”( Red romance ktv) Accompany elder brother to see “ tea ”, At this time, your mobile phone suddenly receives an unknown call , The first line on the phone asks if there is anyone around you , If there is someone, go to a place where there is no one , You can see what he means ( It's the police uncle ), So , You look at big brother , Pretend to be a business call from a colleague ,

The police told you : They already know that you are forced to do business , Tell you to stabilize first , Help them collect the criminal evidence of the criminal , You quickly promised , After collection, you can give the data to them to insert in the criminal gang “ Informant ”, His code name : Rice bucket . Joint code : I'm cabbage . Reply number : It's a roll and a dish

After that, hang up ;

You think , Ah, this , Just give me a code and a connector code , How can I find it

No matter the , First prepare the data and give it to the police uncle

1. Create a cheated view view_vc_ Spell the name ( The view contains victim information , Fraud details )

When you create a view, you find that some field names are duplicate, resulting in the creation failure

Change the duplicate field name .

alter table scam_info_zhongjinlin change victim_id victim_id_sc char(16);

create view  view_vc_zhongjinlin as select * from victim_info_zhongjinlin inner join scam_info_zhongjinlin;

2. Create a cheated view view_scam_ Spell the name ( The view contains information about the fraudster )

create view view_scam_zhongjinlin as select * from swindle_info_zhongjinlin;

Just when you look at creating views , You suddenly find the deputy leader “ Fantong “ The mystery of the name , You realize that the deputy chief is the informant , So you meet him , And successfully handed over the data of the criminal gang to the informant .

Mission 9: Li was cheated

1. Members begin to act , They aimed at the second leek : Li Mou , You should check the information of Li as usual

( Query the gender of Li , Company , Recent events , Home address ).

select gender Gender ,workplace Company ,recent_events Recent events ,home_address Home address from victim_info_zhongjinlin where victim_name=" Li Mou ";

After telling them Li's information , They began to act , Through Li's information, I tried to get close to ( To pretend to be a bank worker ) The way to get his balance

2. Insert data into the victim's bank card

victim_card_id

victim_id

vc_bank_name

vc_card_number

vc_out_amount

order_time

vc_2022_00003

v_2023_00003

Agricultural bank of

1234667123418980

500987

2023/5/5

insert into victim_card_zhongjinlin values

-> ("vc_2022_00003","v_2023_00003"," Agricultural bank of ","1234667123418980 ","500987","2023/5/5");

3. Insert data into the fraud table

scam_id

Customer_id

victim_id

amount

start_time

end_time

s_2022_00004

c_2022_00004

v_2023_00003

0

2023/5/5

2023/6/5

insert into swindle_info_zhongjinlin values

-> ("s_2022_00004","c_2022_00004","v_2023_00003","0","2023/5/5","2023/6/5");

 4. I learned that Li had just experienced divorce , The criminal gang pretended to be an acquaintance Li had not seen for a long time , Comfort Li , Then borrow two sums of money in case of emergencies .

details_id

scam_id

driver_id

victim_id

card_farming_id

scam_amount

sc_2022_00005

s_2022_00003

d_2022_00003

vc_2022_00003

bc_2022_00003

260000

sc_2022_00006

s_2022_00003

d_2022_00003

vc_2022_00003

bc_2022_00003

240000

insert into scam_info_zhongjinlin values

    -> ("sc_2022_00005","s_2022_00003","d_2022_00003","vc_2022_00003","bc_2022_00003",260000),

    -> ("sc_2022_00006","s_2022_00003","d_2022_00003","vc_2022_00003","bc_2022_00003",240000);

Although Li is simple , But I soon realized that something was wrong , In addition, he downloaded the national anti fraud app, So I soon realized that it was wrong , Select alarm ………..

Task ten : The police caught the fraudster Back up the fraud company database

At this time, you are watching with your eldest brother ” tea “ When you not only sigh that the tea is really white and tender , A group of policemen broke in ,

Catch you . Back to the police station for questioning , Because you are not voluntary but under duress , Plus the active data transmission , So I was just educated . And the technician of the police station went out on business , So the police asked you to help them back up the criminal database

1. Back up all databases , The file named “all_ Spell the name .sql”( Cut two pictures command + file )

D:\software\mysql-8.0.28-winx64\mysql-8.0.28-winx64\biefensjk>mysqldump -u root -prain --all-databases>all_zhongjinlin.sql

You think again for fear of delaying the technician to find the fraud database for a while , So I decided to back up one separately

     The file name is the database name _ Spell the name

    

2. Back up the fraud database , The file named “scam_ Spell the name .sql”( Cut two pictures command + file )

D:\software\mysql-8.0.28-winx64\mysql-8.0.28-winx64\biefensjk>mysqldump -u root -prain scam_zhongjinlin>scam_zhongjinlin.sql

After the backup, you don't think it's good to keep the fraud data , So I decided to delete .

3. Delete the fraud database

drop database scam_zhongjinlin;

At this time, you are also an unforgettable experience , Still keep it , So I plan to restore the fraud database

4. Create a fraud database “scam_ Spell the name ”

create database scam_zhongjinlin;

5. sign out MySQL Sign in

\q

6. Execute fraud database backup file

D:\software\mysql-8.0.28-winx64\mysql-8.0.28-winx64\biefensjk>mysql -u root -prain scam_zhongjinlin<scam_zhongjinlin.sql

 7. Sign in MySQL

mysql -u root -prain

8. Using the fraud database

use scam_zhongjinlin;

 9. View all tables ( Look at the log table , Record all your hard work )

show tables;

select * from log_zhongjinlin;

After that , You take a long breath , It's finally over ( The man in front of the screen thinks so ). 

原网站

版权声明
本文为[RainstormGod]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206120121422312.html

随机推荐