Warmachine28

Untitled

Feb 18th, 2022 (edited)
332
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create table credit_card_frauds(
  2.     credit_card_no bigint,
  3.     cardholder_name varchar(255),
  4.     cardholder_home_address varchar(255),
  5.     billing_address varchar(255),
  6.     transaction_amt int,
  7.     transaction_mode varchar(255),
  8.     transaction_date_time datetime,
  9.     country varchar(255),
  10.     type_of_card varchar(255)
  11. );
  12.  
  13. create table cyber_crime(
  14.     crime_name varchar(255),
  15.     crime_date_time datetime,
  16.     crime_city varchar(255),
  17.     crime_country varchar(255),
  18.     victim_name varchar(255)
  19. );
  20.  
  21. insert into credit_card_frauds values
  22.     (
  23.     7889123451439641,
  24.     "Dhruv Sachdeva",
  25.     "Karnal,Haryana",
  26.     "Preet Vihar",
  27.     6500,
  28.     "POS",
  29.     "2022-10-12 15:25:30",
  30.     "India",
  31.     "Diner Club"
  32.     ),
  33.     (
  34.     4522620045711987,
  35.     "Harmandeep Singh Mavi",
  36.     "Sangroor, Punjab",
  37.     "Navi Mumbai",
  38.     25000,
  39.     "online",
  40.     "2022-12-02 16:30:34",
  41.     "Canada",
  42.     "American Express"
  43.     ),
  44.     (
  45.     2400157736524271,
  46.     "Tanmay Singh",
  47.     "Daman",
  48.     "Gurugram",
  49.     2412,
  50.     "POS",
  51.     "2021-07-28 12:05:11",
  52.     "India",
  53.     "Visa"
  54.     ),
  55.     (
  56.     6522781254238514,
  57.     "Kumar Jyotirmay",
  58.     "Dhaka, Bihar",
  59.     "Delhi",
  60.     1650,
  61.     "online",
  62.     "2022-02-12 04:30:10",
  63.     "India",
  64.     "Mastercard"
  65.     ),
  66.     (
  67.     4590254412758963,
  68.     "Shailesh Dhaundiyal",
  69.     "Pawri,Uttarakhand",
  70.     "Uttam Nagar, Delhi",
  71.     43000,
  72.     "online",
  73.     "2022-03-02 04:14:20",
  74.     "India",
  75.     "Rupay"
  76.     );
  77.    
  78.     insert into cyber_crime values
  79.         (
  80.         "Phishing",
  81.         "2022-01-02 07:14:20",
  82.         "Saharanpur",
  83.         "India",
  84.         "Harsh Aggarwal"
  85.         ),
  86.         (
  87.         "Identity Theft",
  88.         "2022-01-03 15:13:25",
  89.         "Indore",
  90.         "India",
  91.         "Fulchand Sahoo"
  92.         ),
  93.         (
  94.         "Data Breach",
  95.         "2022-02-28 13:10:20",
  96.         "Delhi",
  97.         "India",
  98.         "Deva Kaushik"
  99.         ),
  100.         (
  101.         "Harrasment",
  102.         "2021-01-10 10:25:20",
  103.         "Karnal",
  104.         "India",
  105.         "Dhruv Sachdeva"
  106.         ),
  107.         (
  108.         "Cyber Extortion",
  109.         "2022-01-28 05:10:20",
  110.         "Pawri",
  111.         "India",
  112.         "Shailesh Daundiyal"
  113.         );
  114.        
  115. select * from credit_card_frauds inner join cyber_crime on credit_card_frauds.cardholder_name = cyber_crime.culprit_name;
  116. select * from credit_card_frauds where transaction_amt >= 25000;
  117. select distinct type_of_card, count(type_of_card) from credit_card_frauds group by type_of_card;
  118. select crime_country, count(crime_country) from cyber_crime group by crime_country;
  119. select distinct crime_name from cyber_crime;
  120.    
  121.    
RAW Paste Data Copied