learn-sql-live

create table transactions
(
tdate date,
ttime time,
p_id int,
c_id int,
card varchar(25)
);

insert into transactions
values ('2018-04-19', '16:59:00', 3, 11, 'diners-club-carte-blanche'),
('2018-08-05', '00:16:00', 24, 22, 'china-unionpay'),
('2017-12-16', '12:20:00', 19, 24, 'diners-club-international'),
('2018-08-11', '16:17:00', 18, 3, 'jcb'),
('2018-08-30', '08:22:00', 5, 15, 'jcb'),
('2017-10-01', '16:25:00', 23, 31, 'jcb'),
('2018-05-18', '03:25:00', 16, 19, 'bankcard'),
('2018-01-26', '13:22:00', 28, 44, 'mastercard'),
('2018-04-30', '21:32:00', 19, 2, 'jcb'),
('2017-12-02', '15:11:00', 1, 13, 'jcb'),
('2018-03-29', '17:47:00', 1, 40, 'bankcard'),
('2017-11-27', '02:30:00', 3, 28, 'visa-electron'),
('2018-09-09', '20:27:00', 17, 28, 'diners-club-enroute'),
('2017-11-07', '08:53:00', 27, 27, 'jcb'),
('2018-01-29', '22:11:00', 5, 31, 'bankcard'),
('2017-10-28', '13:21:00', 17, 10, 'diners-club-international'),
('2018-03-19', '05:42:00', 11, 41, 'diners-club-enroute'),
('2017-11-08', '14:01:00', 15, 50, 'maestro'),
('2018-05-25', '22:48:00', 11, 46, 'jcb'),
('2017-09-27', '02:11:00', 19, 14, 'maestro'),
('2017-12-28', '18:20:00', 14, 9, 'jcb'),
('2017-10-29', '06:47:00', 11, 18, 'diners-club-enroute'),
('2017-12-01', '09:13:00', 5, 8, 'jcb'),
('2017-09-24', '02:52:00', 28, 38, 'china-unionpay'),
('2017-09-27', '22:19:00', 25, 46, 'mastercard'),
('2018-05-18', '16:48:00', 5, 48, 'switch'),
('2018-04-11', '04:02:00', 28, 32, 'maestro'),
('2018-01-30', '06:57:00', 28, 39, 'jcb'),
('2018-03-17', '05:39:00', 27, 6, 'jcb'),
('2018-02-09', '16:50:00', 15, 15, 'instapayment'),
('2018-05-10', '01:30:00', 8, 47, 'jcb'),
('2018-08-23', '16:36:00', 12, 18, 'diners-club-carte-blanche'),
('2018-08-20', '08:14:00', 2, 47, 'jcb'),
('2018-03-07', '02:40:00', 16, 36, 'jcb'),
('2018-08-20', '05:22:00', 9, 41, 'jcb'),
('2018-02-28', '08:44:00', 18, 10, 'jcb'),
('2018-08-14', '12:35:00', 19, 19, 'jcb'),
('2017-11-19', '06:17:00', 18, 29, 'diners-club-enroute'),
('2018-09-08', '10:17:00', 14, 28, 'china-unionpay'),
('2017-09-22', '22:26:00', 5, 6, 'jcb'),
('2018-09-03', '16:15:00', 26, 12, 'jcb'),
('2017-12-19', '15:47:00', 15, 8, 'visa-electron'),
('2018-07-13', '07:21:00', 29, 13, 'jcb'),
('2018-08-15', '21:57:00', 8, 25, 'jcb'),
('2018-02-13', '23:03:00', 17, 14, 'mastercard'),
('2018-02-22', '06:00:00', 23, 50, 'diners-club-enroute'),
('2018-08-04', '22:02:00', 6, 18, 'mastercard'),
('2017-10-18', '16:13:00', 4, 33, 'visa-electron'),
('2017-12-19', '22:05:00', 12, 19, 'jcb'),
('2018-05-28', '17:00:00', 9, 31, 'maestro'),
('2017-12-13', '14:09:00', 28, 8, 'jcb'),
('2018-09-10', '19:43:00', 21, 19, 'switch'),
('2018-03-31', '03:13:00', 9, 43, 'jcb'),
('2018-08-16', '16:18:00', 14, 42, 'jcb'),
('2018-04-11', '13:47:00', 6, 26, 'jcb'),
('2018-04-19', '13:59:00', 18, 36, 'jcb'),
('2017-12-04', '06:33:00', 29, 5, 'jcb'),
('2018-02-03', '10:33:00', 3, 32, 'jcb'),
('2018-01-19', '08:40:00', 2, 31, 'jcb'),
('2017-10-23', '03:23:00', 25, 41, 'visa-electron'),
('2018-09-16', '08:59:00', 29, 39, 'americanexpress'),
('2018-08-07', '12:32:00', 25, 48, 'china-unionpay'),
('2018-03-17', '12:25:00', 7, 50, 'jcb'),
('2018-06-28', '20:53:00', 1, 44, 'jcb'),
('2018-07-21', '02:16:00', 4, 23, 'switch'),
('2018-07-07', '23:41:00', 12, 5, 'jcb'),
('2017-11-01', '19:10:00', 15, 37, 'jcb'),
('2018-07-22', '05:18:00', 22, 18, 'jcb'),
('2018-05-30', '10:17:00', 2, 14, 'maestro'),
('2017-12-04', '23:56:00', 13, 36, 'jcb'),
('2018-05-09', '18:24:00', 13, 48, 'diners-club-carte-blanche'),
('2018-06-21', '20:53:00', 28, 28, 'visa'),
('2018-08-23', '14:20:00', 30, 40, 'instapayment'),
('2018-03-16', '06:13:00', 16, 44, 'diners-club-carte-blanche'),
('2018-07-07', '06:36:00', 27, 38, 'maestro'),
('2017-09-24', '23:45:00', 23, 28, 'visa-electron'),
('2018-05-28', '17:42:00', 22, 19, 'bankcard'),
('2018-04-11', '21:44:00', 13, 21, 'jcb'),
('2018-07-21', '03:30:00', 12, 19, 'americanexpress'),
('2018-06-29', '06:29:00', 10, 23, 'jcb'),
('2018-08-25', '21:16:00', 13, 45, 'jcb'),
('2018-09-20', '00:59:00', 11, 27, 'switch'),
('2018-06-09', '20:04:00', 5, 17, 'bankcard'),
('2017-12-10', '19:45:00', 19, 45, 'solo'),
('2017-09-28', '09:04:00', 13, 3, 'diners-club-carte-blanche'),
('2017-12-18', '20:14:00', 22, 15, 'visa-electron'),
('2017-10-18', '03:05:00', 28, 29, 'americanexpress'),
('2018-01-22', '00:23:00', 1, 18, 'jcb'),
('2018-04-25', '20:24:00', 11, 47, 'jcb'),
('2018-08-23', '04:34:00', 22, 10, 'mastercard'),
('2018-04-05', '12:17:00', 23, 27, 'jcb'),
('2018-03-28', '12:54:00', 24, 22, 'americanexpress'),
('2017-12-05', '15:42:00', 3, 38, 'jcb'),
('2018-05-03', '23:28:00', 7, 27, 'jcb'),
('2018-01-04', '00:35:00', 27, 8, 'mastercard'),
('2017-12-18', '07:59:00', 8, 29, 'americanexpress'),
('2017-10-18', '02:26:00', 19, 26, 'americanexpress'),
('2018-08-07', '19:49:00', 29, 31, 'jcb'),
('2017-10-22', '21:32:00', 15, 39, 'jcb'),
('2018-09-11', '00:16:00', 14, 35, 'switch'),
('2017-12-30', '21:03:00', 4, 6, 'jcb'),
('2017-12-19', '00:40:00', 16, 44, 'diners-club-enroute'),
('2018-07-30', '15:14:00', 12, 5, 'china-unionpay'),
('2017-11-29', '18:45:00', 14, 37, 'diners-club-international'),
('2018-03-10', '22:22:00', 16, 11, 'jcb'),
('2017-09-23', '01:50:00', 9, 46, 'jcb'),
('2018-04-28', '00:57:00', 6, 11, 'bankcard'),
('2017-11-22', '14:34:00', 8, 13, 'jcb'),
('2018-03-26', '00:13:00', 22, 13, 'visa'),
('2018-05-23', '14:51:00', 23, 23, 'visa-electron'),
('2017-12-14', '18:32:00', 4, 17, 'visa-electron'),
('2018-04-22', '13:17:00', 7, 10, 'switch'),
('2018-01-10', '19:15:00', 28, 33, 'mastercard'),
('2018-09-05', '23:54:00', 15, 48, 'diners-club-us-ca'),
('2017-11-21', '00:56:00', 19, 24, 'switch'),
('2018-05-12', '05:44:00', 18, 24, 'jcb'),
('2017-11-22', '09:05:00', 19, 47, 'jcb'),
('2018-05-17', '19:34:00', 29, 12, 'americanexpress'),
('2018-05-31', '13:28:00', 13, 45, 'jcb'),
('2018-07-07', '03:14:00', 17, 16, 'jcb'),
('2017-10-10', '18:10:00', 13, 48, 'jcb'),
('2018-02-04', '01:01:00', 11, 23, 'jcb'),
('2018-05-10', '03:28:00', 19, 37, 'jcb'),
('2018-07-07', '13:51:00', 7, 44, 'switch'),
('2018-06-19', '07:33:00', 6, 30, 'americanexpress'),
('2018-05-10', '23:29:00', 17, 35, 'maestro'),
('2018-08-23', '02:51:00', 27, 1, 'jcb'),
('2018-05-31', '23:10:00', 8, 18, 'jcb'),
('2018-05-13', '05:55:00', 13, 22, 'solo'),
('2018-01-03', '23:12:00', 28, 37, 'mastercard'),
('2018-08-06', '01:21:00', 17, 8, 'bankcard'),
('2017-12-17', '16:07:00', 10, 13, 'visa-electron'),
('2018-03-20', '23:42:00', 16, 21, 'mastercard'),
('2017-12-01', '01:46:00', 23, 42, 'americanexpress'),
('2017-10-28', '00:24:00', 10, 23, 'visa-electron'),
('2018-05-05', '00:05:00', 25, 39, 'jcb'),
('2018-09-06', '16:12:00', 29, 40, 'americanexpress'),
('2017-11-04', '16:10:00', 28, 23, 'switch'),
('2018-07-17', '13:45:00', 18, 15, 'jcb'),
('2018-01-28', '06:20:00', 25, 29, 'jcb'),
('2018-05-08', '09:02:00', 28, 10, 'maestro'),
('2018-06-09', '12:24:00', 10, 13, 'mastercard'),
('2018-04-30', '12:37:00', 21, 47, 'jcb'),
('2017-10-13', '06:56:00', 15, 47, 'visa'),
('2018-05-18', '02:40:00', 4, 4, 'visa'),
('2018-04-26', '18:38:00', 2, 44, 'jcb'),
('2017-12-22', '07:01:00', 25, 42, 'maestro'),
('2018-04-18', '00:50:00', 26, 5, 'americanexpress'),
('2017-10-26', '13:37:00', 8, 38, 'jcb'),
('2018-02-17', '05:02:00', 23, 47, 'mastercard'),
('2018-07-17', '09:26:00', 15, 29, 'jcb'),
('2017-11-13', '08:54:00', 21, 31, 'jcb'),
('2018-03-15', '00:53:00', 3, 15, 'jcb'),
('2017-11-18', '17:29:00', 6, 41, 'jcb'),
('2017-10-07', '00:45:00', 5, 48, 'bankcard'),
('2018-05-27', '11:12:00', 17, 46, 'jcb'),
('2018-09-11', '16:23:00', 27, 36, 'jcb'),
('2018-06-13', '08:02:00', 19, 16, 'jcb'),
('2018-07-02', '18:32:00', 6, 18, 'diners-club-us-ca'),
('2018-04-16', '14:52:00', 20, 48, 'switch'),
('2017-11-19', '05:34:00', 13, 40, 'jcb'),
('2017-11-15', '21:48:00', 5, 12, 'jcb'),
('2017-12-16', '00:09:00', 26, 6, 'jcb'),
('2017-12-31', '15:25:00', 3, 21, 'jcb'),
('2018-09-07', '21:12:00', 29, 31, 'jcb'),
('2018-03-24', '12:47:00', 23, 47, 'jcb'),
('2018-09-20', '14:14:00', 14, 47, 'jcb'),
('2018-07-25', '07:39:00', 23, 27, 'switch'),
('2018-01-19', '23:50:00', 27, 38, 'jcb'),
('2018-09-05', '07:42:00', 3, 17, 'diners-club-carte-blanche'),
('2018-05-29', '12:05:00', 25, 29, 'jcb'),
('2017-12-14', '11:44:00', 23, 50, 'diners-club-carte-blanche'),
('2017-10-07', '16:25:00', 25, 28, 'china-unionpay'),
('2018-04-17', '10:44:00', 18, 16, 'maestro'),
('2018-01-31', '09:08:00', 16, 32, 'china-unionpay'),
('2018-02-20', '12:24:00', 6, 36, 'jcb'),
('2017-12-15', '23:44:00', 6, 12, 'jcb'),
('2018-07-07', '11:23:00', 7, 5, 'jcb'),
('2018-07-15', '09:45:00', 9, 25, 'maestro'),
('2018-09-20', '19:49:00', 15, 18, 'jcb'),
('2017-09-26', '03:41:00', 13, 35, 'visa'),
('2017-09-28', '17:15:00', 22, 10, 'maestro'),
('2018-09-16', '21:21:00', 21, 49, 'jcb'),
('2018-05-31', '22:21:00', 9, 20, 'instapayment'),
('2018-08-08', '06:14:00', 13, 12, 'diners-club-enroute'),
('2018-07-08', '00:29:00', 19, 37, 'diners-club-us-ca'),
('2018-07-01', '02:34:00', 16, 10, 'visa-electron'),
('2017-12-02', '23:23:00', 17, 31, 'mastercard'),
('2017-10-17', '20:31:00', 26, 26, 'jcb'),
('2018-09-01', '02:33:00', 7, 40, 'solo'),
('2017-12-17', '13:06:00', 21, 23, 'mastercard'),
('2017-12-05', '02:12:00', 28, 15, 'mastercard'),
('2017-11-05', '22:34:00', 20, 47, 'mastercard'),
('2018-01-29', '13:57:00', 13, 12, 'jcb'),
('2018-07-07', '20:58:00', 9, 46, 'jcb'),
('2017-12-29', '13:56:00', 13, 40, 'laser'),
('2018-09-08', '02:29:00', 10, 8, 'bankcard'),
('2018-05-25', '22:56:00', 10, 21, 'jcb'),
('2018-05-30', '00:50:00', 25, 50, 'switch'),
('2018-08-18', '20:41:00', 2, 22, 'diners-club-enroute'),
('2017-10-02', '02:56:00', 15, 16, 'jcb'),
('2018-03-03', '11:30:00', 25, 3, 'americanexpress'),
('2018-08-29', '10:40:00', 15, 12, 'visa'),
('2017-10-06', '10:09:00', 25, 18, 'jcb'),
('2018-02-09', '12:01:00', 11, 12, 'jcb'),
('2018-06-18', '08:37:00', 3, 46, 'switch'),
('2018-01-14', '17:42:00', 27, 8, 'laser'),
('2018-02-01', '23:14:00', 1, 48, 'diners-club-carte-blanche'),
('2018-06-05', '01:32:00', 5, 40, 'jcb'),
('2018-07-08', '07:38:00', 21, 2, 'americanexpress'),
('2018-09-18', '12:17:00', 7, 2, 'visa-electron'),
('2018-08-17', '05:36:00', 6, 27, 'diners-club-carte-blanche'),
('2018-04-26', '11:55:00', 20, 19, 'jcb'),
('2018-01-20', '18:06:00', 27, 17, 'maestro'),
('2018-01-27', '19:01:00', 26, 48, 'mastercard'),
('2018-09-12', '06:31:00', 1, 50, 'visa-electron'),
('2018-06-17', '22:30:00', 12, 37, 'jcb'),
('2018-04-13', '03:19:00', 8, 31, 'jcb'),
('2018-06-07', '11:12:00', 2, 50, 'jcb'),
('2018-09-19', '23:49:00', 4, 12, 'instapayment'),
('2017-10-21', '09:50:00', 8, 46, 'mastercard'),
('2018-02-24', '02:09:00', 7, 43, 'jcb'),
('2018-02-25', '22:45:00', 17, 13, 'switch'),
('2018-09-16', '06:39:00', 24, 17, 'diners-club-carte-blanche'),
('2018-02-22', '01:15:00', 15, 33, 'jcb'),
('2017-11-09', '01:21:00', 12, 8, 'mastercard'),
('2018-09-05', '23:02:00', 10, 13, 'jcb'),
('2018-08-10', '03:32:00', 19, 34, 'diners-club-carte-blanche'),
('2018-02-17', '18:21:00', 28, 27, 'jcb'),
('2018-09-14', '01:41:00', 29, 48, 'diners-club-carte-blanche'),
('2018-07-26', '09:28:00', 28, 15, 'diners-club-carte-blanche'),
('2017-12-19', '04:21:00', 24, 37, 'visa'),
('2018-02-10', '06:44:00', 25, 44, 'maestro'),
('2018-03-30', '14:48:00', 5, 18, 'americanexpress'),
('2017-10-01', '15:27:00', 24, 7, 'jcb'),
('2018-07-23', '16:24:00', 23, 25, 'switch'),
('2018-09-04', '20:38:00', 3, 46, 'jcb'),
('2017-10-21', '16:38:00', 7, 22, 'jcb'),
('2017-11-30', '22:34:00', 20, 4, 'visa'),
('2018-06-11', '05:38:00', 13, 15, 'bankcard'),
('2018-01-31', '08:29:00', 30, 7, 'diners-club-enroute'),
('2017-11-03', '02:11:00', 12, 34, 'jcb'),
('2018-04-12', '01:42:00', 5, 37, 'jcb'),
('2017-10-08', '16:34:00', 22, 27, 'china-unionpay'),
('2018-03-03', '04:54:00', 2, 44, 'jcb'),
('2018-04-17', '07:49:00', 15, 23, 'diners-club-international'),
('2018-05-17', '09:48:00', 26, 23, 'jcb'),
('2017-11-25', '09:15:00', 26, 12, 'jcb'),
('2018-08-16', '08:30:00', 18, 45, 'diners-club-international'),
('2018-06-03', '14:16:00', 3, 40, 'china-unionpay'),
('2018-04-26', '20:00:00', 7, 28, 'china-unionpay'),
('2017-10-03', '08:18:00', 13, 46, 'jcb'),
('2018-01-04', '18:44:00', 23, 7, 'switch'),
('2017-11-30', '07:15:00', 16, 34, 'diners-club-enroute'),
('2018-06-23', '05:21:00', 3, 20, 'mastercard'),
('2018-04-23', '03:03:00', 17, 18, 'jcb'),
('2018-04-18', '07:40:00', 25, 30, 'bankcard'),
('2018-09-05', '17:41:00', 15, 43, 'jcb'),
('2018-09-13', '10:18:00', 10, 26, 'jcb'),
('2018-06-24', '08:57:00', 5, 35, 'visa'),
('2018-05-12', '13:58:00', 2, 3, 'mastercard'),
('2018-03-22', '20:55:00', 23, 20, 'mastercard'),
('2017-12-13', '19:03:00', 3, 28, 'diners-club-carte-blanche'),
('2017-10-20', '05:20:00', 15, 15, 'visa-electron'),
('2018-02-25', '06:01:00', 8, 4, 'visa-electron'),
('2018-08-16', '12:53:00', 9, 46, 'jcb'),
('2017-10-24', '11:29:00', 9, 40, 'bankcard'),
('2018-03-03', '00:56:00', 15, 33, 'jcb'),
('2018-06-15', '11:22:00', 18, 35, 'jcb'),
('2018-03-20', '20:10:00', 19, 4, 'jcb'),
('2018-06-21', '14:32:00', 17, 13, 'mastercard'),
('2018-06-08', '09:54:00', 13, 13, 'visa-electron'),
('2017-12-08', '23:29:00', 29, 33, 'maestro'),
('2018-01-16', '23:06:00', 6, 27, 'switch'),
('2017-10-19', '10:43:00', 5, 8, 'diners-club-carte-blanche'),
('2017-12-30', '07:33:00', 11, 27, 'visa'),
('2017-12-30', '00:48:00', 7, 41, 'jcb'),
('2017-12-24', '16:30:00', 14, 44, 'jcb'),
('2017-11-05', '00:24:00', 5, 33, 'jcb'),
('2018-01-28', '09:38:00', 17, 13, 'switch'),
('2018-07-18', '11:17:00', 19, 47, 'visa'),
('2018-08-01', '13:50:00', 15, 41, 'jcb'),
('2018-09-13', '02:30:00', 4, 18, 'jcb'),
('2018-07-30', '14:25:00', 16, 35, 'jcb'),
('2018-08-27', '20:44:00', 2, 21, 'jcb'),
('2018-02-03', '13:04:00', 29, 11, 'jcb'),
('2018-01-25', '05:16:00', 1, 27, 'maestro'),
('2018-04-08', '13:40:00', 27, 29, 'jcb'),
('2018-02-14', '13:45:00', 12, 21, 'solo'),
('2018-06-27', '23:07:00', 23, 28, 'visa-electron'),
('2018-02-16', '22:18:00', 6, 49, 'jcb'),
('2018-09-11', '22:39:00', 8, 43, 'jcb'),
('2017-09-21', '07:30:00', 28, 44, 'diners-club-carte-blanche'),
('2018-09-15', '01:07:00', 16, 33, 'americanexpress'),
('2018-06-19', '17:01:00', 17, 48, 'laser'),
('2018-08-03', '06:18:00', 30, 44, 'jcb'),
('2018-04-19', '21:33:00', 13, 27, 'jcb'),
('2018-06-09', '06:14:00', 29, 25, 'jcb'),
('2018-01-04', '17:06:00', 4, 38, 'diners-club-enroute'),
('2017-11-30', '01:40:00', 30, 34, 'jcb'),
('2018-04-11', '03:00:00', 5, 26, 'jcb'),
('2018-06-22', '07:45:00', 12, 6, 'jcb'),
('2017-12-12', '17:50:00', 23, 29, 'mastercard'),
('2018-06-01', '05:47:00', 28, 12, 'jcb'),
('2018-06-16', '05:04:00', 4, 48, 'maestro'),
('2017-12-21', '02:53:00', 16, 1, 'jcb'),
('2018-01-17', '09:40:00', 27, 44, 'jcb'),
('2018-01-20', '05:52:00', 26, 36, 'jcb'),
('2018-05-31', '02:10:00', 10, 8, 'visa'),
('2017-12-17', '08:56:00', 22, 35, 'jcb'),
('2018-03-05', '22:57:00', 19, 3, 'jcb'),
('2017-09-30', '03:43:00', 3, 26, 'jcb'),
('2017-12-27', '14:03:00', 15, 24, 'americanexpress'),
('2018-02-19', '16:31:00', 27, 19, 'visa-electron'),
('2018-03-12', '23:12:00', 2, 27, 'jcb'),
('2018-01-08', '15:20:00', 11, 32, 'jcb'),
('2017-12-25', '22:48:00', 17, 27, 'mastercard'),
('2018-06-27', '11:15:00', 10, 42, 'jcb'),
('2018-06-09', '13:40:00', 4, 26, 'jcb'),
('2017-10-15', '09:45:00', 27, 42, 'bankcard'),
('2018-04-10', '08:50:00', 16, 38, 'bankcard'),
('2018-03-11', '07:07:00', 24, 46, 'mastercard'),
('2017-12-18', '19:25:00', 24, 12, 'visa-electron'),
('2018-07-27', '04:25:00', 9, 42, 'jcb'),
('2017-11-22', '20:14:00', 22, 1, 'jcb'),
('2018-04-29', '17:08:00', 2, 33, 'mastercard'),
('2017-12-01', '01:59:00', 29, 46, 'laser'),
('2017-11-21', '02:46:00', 15, 18, 'jcb'),
('2018-07-23', '00:01:00', 25, 9, 'diners-club-enroute'),
('2018-08-11', '01:43:00', 8, 10, 'bankcard'),
('2017-10-01', '06:19:00', 19, 6, 'diners-club-carte-blanche'),
('2017-10-16', '14:17:00', 17, 2, 'americanexpress'),
('2018-07-10', '01:43:00', 16, 5, 'americanexpress'),
('2018-01-07', '09:58:00', 13, 48, 'jcb'),
('2018-06-26', '12:45:00', 6, 11, 'jcb'),
('2018-05-15', '12:49:00', 24, 35, 'jcb'),
('2018-09-20', '17:00:00', 25, 46, 'mastercard'),
('2018-03-01', '05:33:00', 23, 1, 'mastercard'),
('2018-04-22', '07:25:00', 16, 13, 'jcb'),
('2018-06-22', '18:27:00', 27, 34, 'diners-club-enroute'),
('2017-12-10', '07:04:00', 17, 43, 'visa-electron'),
('2018-01-27', '17:23:00', 5, 20, 'solo'),
('2018-09-11', '12:07:00', 28, 31, 'jcb'),
('2018-01-12', '12:17:00', 8, 35, 'instapayment'),
('2018-09-09', '13:14:00', 8, 16, 'mastercard'),
('2018-08-11', '04:10:00', 25, 11, 'visa-electron'),
('2018-03-02', '06:20:00', 4, 36, 'jcb'),
('2018-01-30', '17:55:00', 28, 5, 'mastercard'),
('2018-02-09', '04:18:00', 19, 47, 'china-unionpay'),
('2018-02-26', '08:59:00', 29, 30, 'jcb'),
('2017-09-23', '16:57:00', 3, 5, 'diners-club-carte-blanche'),
('2018-05-05', '05:29:00', 28, 12, 'jcb'),
('2018-01-08', '05:43:00', 17, 7, 'mastercard'),
('2018-06-12', '12:12:00', 15, 16, 'jcb'),
('2018-06-01', '23:39:00', 7, 31, 'jcb'),
('2018-03-15', '00:54:00', 10, 29, 'maestro'),
('2018-07-15', '00:16:00', 29, 30, 'bankcard'),
('2018-02-19', '00:20:00', 19, 36, 'jcb'),
('2018-06-05', '00:17:00', 6, 6, 'jcb'),
('2018-05-29', '20:04:00', 7, 25, 'jcb'),
('2017-11-23', '12:33:00', 17, 3, 'jcb'),
('2017-10-14', '06:03:00', 2, 42, 'laser'),
('2017-12-26', '06:55:00', 18, 34, 'jcb'),
('2018-04-01', '03:55:00', 2, 2, 'maestro'),
('2018-09-15', '06:54:00', 19, 35, 'jcb'),
('2018-07-10', '03:40:00', 20, 3, 'jcb'),
('2018-05-06', '04:41:00', 11, 3, 'visa'),
('2017-10-21', '06:52:00', 4, 7, 'instapayment'),
('2018-04-21', '11:29:00', 12, 44, 'visa-electron'),
('2017-12-29', '23:15:00', 21, 12, 'jcb'),
('2018-03-01', '10:34:00', 29, 37, 'jcb'),
('2018-01-13', '16:18:00', 16, 2, 'instapayment'),
('2017-11-24', '19:57:00', 16, 32, 'jcb'),
('2017-11-01', '23:58:00', 8, 34, 'jcb'),
('2018-02-20', '23:19:00', 21, 4, 'instapayment'),
('2018-05-27', '08:16:00', 15, 37, 'jcb'),
('2018-07-16', '06:34:00', 4, 26, 'jcb'),
('2018-01-24', '15:35:00', 20, 22, 'jcb'),
('2018-06-09', '14:35:00', 23, 28, 'jcb'),
('2018-02-05', '15:42:00', 27, 5, 'diners-club-international'),
('2017-10-11', '10:36:00', 11, 7, 'jcb'),
('2017-09-22', '12:04:00', 19, 10, 'jcb'),
('2017-12-05', '12:03:00', 17, 14, 'maestro'),
('2017-09-23', '11:10:00', 24, 1, 'jcb'),
('2017-11-25', '09:57:00', 3, 27, 'jcb'),
('2018-09-01', '18:38:00', 26, 43, 'mastercard'),
('2018-08-09', '06:15:00', 18, 43, 'visa-electron'),
('2018-05-15', '04:04:00', 5, 41, 'switch'),
('2018-07-11', '11:29:00', 30, 6, 'jcb'),
('2018-02-11', '15:28:00', 7, 30, 'jcb'),
('2018-03-10', '15:07:00', 30, 45, 'visa-electron'),
('2018-07-02', '07:56:00', 16, 26, 'jcb'),
('2017-12-12', '05:42:00', 29, 12, 'switch'),
('2018-06-08', '08:31:00', 14, 46, 'laser'),
('2018-05-12', '22:27:00', 12, 24, 'jcb'),
('2018-08-17', '00:50:00', 18, 14, 'china-unionpay'),
('2018-01-29', '00:35:00', 4, 29, 'jcb'),
('2018-07-29', '01:00:00', 4, 49, 'jcb'),
('2018-02-20', '21:34:00', 20, 3, 'diners-club-carte-blanche'),
('2017-11-05', '01:53:00', 20, 19, 'mastercard'),
('2018-06-08', '23:50:00', 18, 39, 'visa'),
('2018-01-25', '08:33:00', 23, 5, 'jcb'),
('2018-05-22', '08:43:00', 9, 20, 'jcb'),
('2018-01-05', '19:54:00', 21, 5, 'laser'),
('2017-10-26', '17:07:00', 2, 20, 'jcb'),
('2017-12-02', '02:35:00', 14, 45, 'maestro'),
('2018-07-10', '18:11:00', 6, 14, 'solo'),
('2018-03-21', '14:15:00', 21, 20, 'mastercard'),
('2017-12-28', '03:44:00', 1, 36, 'visa'),
('2018-02-02', '07:59:00', 28, 12, 'jcb'),
('2017-11-06', '13:54:00', 3, 11, 'jcb'),
('2018-04-13', '22:28:00', 1, 12, 'jcb'),
('2018-04-16', '04:38:00', 28, 4, 'jcb'),
('2017-11-04', '23:23:00', 11, 33, 'visa-electron'),
('2018-08-17', '06:02:00', 10, 15, 'diners-club-carte-blanche'),
('2018-07-03', '03:26:00', 13, 22, 'maestro'),
('2018-09-02', '22:58:00', 24, 18, 'jcb'),
('2017-10-20', '01:54:00', 21, 40, 'jcb'),
('2017-10-10', '08:50:00', 8, 39, 'solo'),
('2018-07-11', '08:27:00', 23, 28, 'jcb'),
('2017-11-01', '13:14:00', 1, 46, 'jcb'),
('2018-02-16', '13:34:00', 29, 28, 'mastercard'),
('2018-08-01', '05:29:00', 14, 24, 'laser'),
('2018-03-04', '12:56:00', 24, 4, 'jcb'),
('2018-03-07', '06:38:00', 23, 26, 'jcb'),
('2017-09-30', '01:51:00', 4, 14, 'instapayment'),
('2018-02-12', '04:21:00', 9, 37, 'jcb'),
('2017-10-20', '10:38:00', 19, 2, 'china-unionpay'),
('2018-09-09', '21:25:00', 24, 25, 'instapayment'),
('2018-01-07', '12:58:00', 15, 47, 'jcb'),
('2018-01-04', '23:14:00', 13, 15, 'maestro'),
('2018-05-18', '01:54:00', 26, 49, 'mastercard'),
('2018-03-19', '00:32:00', 16, 6, 'visa'),
('2018-08-26', '23:46:00', 21, 22, 'jcb'),
('2018-03-23', '17:49:00', 27, 12, 'maestro'),
('2018-09-18', '20:47:00', 24, 1, 'bankcard'),
('2018-04-13', '01:52:00', 2, 43, 'jcb'),
('2018-05-08', '20:50:00', 11, 35, 'jcb'),
('2017-09-25', '19:29:00', 19, 47, 'americanexpress'),
('2018-02-19', '20:06:00', 10, 23, 'jcb'),
('2018-05-10', '03:49:00', 30, 39, 'jcb'),
('2018-04-21', '03:46:00', 12, 17, 'diners-club-international'),
('2017-10-21', '18:20:00', 28, 31, 'jcb'),
('2018-08-26', '06:25:00', 18, 7, 'laser'),
('2018-05-14', '20:08:00', 6, 47, 'americanexpress'),
('2017-09-22', '17:39:00', 3, 25, 'diners-club-carte-blanche'),
('2018-05-23', '17:48:00', 13, 13, 'bankcard'),
('2018-08-08', '11:40:00', 4, 42, 'jcb'),
('2018-07-08', '21:04:00', 1, 47, 'jcb'),
('2018-06-29', '07:43:00', 9, 43, 'diners-club-carte-blanche'),
('2018-05-15', '09:14:00', 12, 9, 'solo'),
('2018-03-17', '17:44:00', 6, 31, 'jcb'),
('2018-06-21', '14:13:00', 18, 24, 'jcb'),
('2017-12-23', '15:25:00', 12, 10, 'jcb'),
('2017-12-19', '22:15:00', 7, 45, 'jcb'),
('2018-07-31', '14:40:00', 28, 30, 'maestro'),
('2017-10-31', '03:48:00', 15, 45, 'jcb'),
('2018-06-19', '14:53:00', 22, 37, 'mastercard'),
('2018-09-15', '05:32:00', 20, 39, 'diners-club-enroute'),
('2017-09-29', '16:04:00', 4, 31, 'visa-electron'),
('2017-11-26', '12:44:00', 17, 8, 'instapayment'),
('2018-04-10', '22:46:00', 5, 20, 'americanexpress'),
('2018-03-02', '05:30:00', 13, 3, 'visa-electron'),
('2017-11-17', '01:42:00', 15, 36, 'jcb'),
('2018-06-03', '21:07:00', 1, 23, 'maestro'),
('2017-12-22', '00:59:00', 6, 44, 'diners-club-international'),
('2018-02-05', '12:19:00', 23, 44, 'jcb'),
('2018-04-30', '02:25:00', 12, 15, 'jcb'),
('2017-12-12', '06:03:00', 16, 14, 'mastercard'),
('2018-04-01', '20:35:00', 4, 6, 'jcb'),
('2018-06-28', '21:14:00', 22, 35, 'bankcard'),
('2018-06-11', '00:43:00', 17, 39, 'jcb'),
('2017-12-16', '13:37:00', 18, 26, 'diners-club-enroute'),
('2018-04-06', '01:46:00', 26, 22, 'china-unionpay'),
('2018-09-06', '18:37:00', 27, 38, 'mastercard'),
('2018-02-04', '13:58:00', 4, 18, 'jcb'),
('2018-04-22', '15:49:00', 12, 18, 'maestro'),
('2018-03-13', '16:24:00', 20, 24, 'mastercard'),
('2018-01-23', '03:07:00', 10, 12, 'jcb'),
('2018-05-01', '07:26:00', 7, 34, 'switch'),
('2018-02-09', '07:49:00', 13, 11, 'jcb'),
('2017-12-19', '20:28:00', 28, 42, 'solo'),
('2017-11-07', '14:27:00', 7, 16, 'jcb'),
('2017-12-29', '14:30:00', 17, 6, 'jcb'),
('2018-07-20', '13:26:00', 15, 20, 'mastercard'),
('2017-12-22', '17:37:00', 18, 8, 'jcb'),
('2017-11-14', '05:55:00', 4, 21, 'jcb'),
('2018-07-17', '16:41:00', 29, 35, 'solo'),
('2018-05-21', '01:19:00', 24, 36, 'jcb'),
('2018-01-02', '17:15:00', 22, 10, 'jcb'),
('2018-03-06', '12:16:00', 24, 41, 'jcb'),
('2017-11-24', '10:45:00', 3, 43, 'visa'),
('2018-05-05', '11:01:00', 28, 46, 'jcb'),
('2018-06-04', '22:11:00', 23, 29, 'china-unionpay'),
('2018-07-23', '07:11:00', 6, 25, 'jcb'),
('2018-05-30', '05:03:00', 11, 18, 'china-unionpay'),
('2017-10-04', '15:23:00', 11, 26, 'americanexpress'),
('2017-12-06', '00:44:00', 7, 19, 'jcb'),
('2018-09-10', '07:40:00', 5, 40, 'jcb'),
('2018-05-05', '15:52:00', 29, 42, 'bankcard');
------------------------------------------------------------------------
create table customers
(
c_id int,
fname varchar(10),
lname varchar(15),
email varchar(30)
);

insert into customers
values (1, 'Sherman', 'Forlonge', 'sforlonge0@desdev.cn'),
(2, 'Carolus', 'Lantry', 'clantry1@cornell.edu'),
(3, 'Fulvia', 'Antonchik', 'fantonchik2@about.me'),
(4, 'Victoria', 'Awcock', 'vawcock3@va.gov'),
(5, 'Denis', 'Lorkin', 'dlorkin4@walmart.com'),
(6, 'Drusilla', 'Catton', 'dcatton5@amazonaws.com'),
(7, 'Rurik', 'Dreger', 'rdreger6@bloomberg.com'),
(8, 'Renaldo', 'Cowdrey', 'rcowdrey7@163.com'),
(9, 'Sidonia', 'Hasnney', 'shasnney8@godaddy.com'),
(10, 'Sher', 'Wickson', 'swickson9@blogger.com'),
(11, 'Hy', 'Thirwell', 'hthirwella@domainmarket.com'),
(12, 'Lyle', 'Deware', 'ldewareb@hexun.com'),
(13, 'Kellie', 'Jobling', 'kjoblingc@netlog.com'),
(14, 'Joceline', 'Evamy', 'jevamyd@forbes.com'),
(15, 'Rahal', 'Taaffe', 'rtaaffee@oaic.gov.au'),
(16, 'Aloysius', 'Newbury', 'anewburyf@nbcnews.com'),
(17, 'Damita', 'Espinho', 'despinhog@npr.org'),
(18, 'Leyla', 'MacCarrane', 'lmaccarraneh@youtu.be'),
(19, 'Kleon', 'Fortnam', 'kfortnami@vkontakte.ru'),
(20, 'Myrle', 'Derdes', 'mderdesj@istockphoto.com'),
(21, 'Wheeler', 'Pallin', 'wpallink@purevolume.com'),
(22, 'Gawain', 'Bordman', 'gbordmanl@about.me'),
(23, 'Cecile', 'Scawton', 'cscawtonm@alibaba.com'),
(24, 'Randy', 'Schruurs', 'rschruursn@tinypic.com'),
(25, 'Cirilo', 'Attenborough', 'cattenborougho@discuz.net'),
(26, 'Brennen', 'Hayzer', 'bhayzerp@chicagotribune.com'),
(27, 'Dewitt', 'MacTrustey', 'dmactrusteyq@house.gov'),
(28, 'Jodie', 'Futcher', 'jfutcherr@kickstarter.com'),
(29, 'Ibbie', 'Usmar', 'iusmars@ask.com'),
(30, 'Stormie', 'Bernet', 'sbernett@hibu.com'),
(31, 'Geri', 'Forryan', 'gforryanu@privacy.gov.au'),
(32, 'Brewer', 'Mughal', 'bmughalv@foxnews.com'),
(33, 'Cozmo', 'Matteau', 'cmatteauw@yahoo.com'),
(34, 'Zacharie', 'Siemons', 'zsiemonsx@columbia.edu'),
(35, 'Horatius', 'Stepney', 'hstepneyy@altervista.org'),
(36, 'Jasen', 'Warboys', 'jwarboysz@unblog.fr'),
(37, 'Carrol', 'McCrann', 'cmccrann10@hubpages.com'),
(38, 'Clarissa', 'Giraudoux', 'cgiraudoux11@clickbank.net'),
(39, 'Wain', 'Oslar', 'woslar12@instagram.com'),
(40, 'Anabel', 'Clatworthy', 'aclatworthy13@amazon.com'),
(41, 'Manon', 'Gaenor', 'mgaenor14@macromedia.com'),
(42, 'Sukey', 'Belcher', 'sbelcher15@issuu.com'),
(43, 'Pietrek', 'Chaunce', 'pchaunce16@webeden.co.uk'),
(44, 'Siffre', 'Blanche', 'sblanche17@yandex.ru'),
(45, 'Zane', 'Romanet', 'zromanet18@china.com.cn'),
(46, 'Meryl', 'Whitmell', 'mwhitmell19@pcworld.com'),
(47, 'Lauren', 'Snoad', 'lsnoad1a@un.org'),
(48, 'Dorree', 'Anderl', 'danderl1b@sun.com'),
(49, 'Ivett', 'Boatswain', 'iboatswain1c@washington.edu'),
(50, 'Gearard', 'Celiz', 'gceliz1d@addthis.com');
---------------------------------------------------------------------
create table products
(
p_id int,
item varchar(35),
sku varchar(10),
price decimal(5,2),
category varchar(10)
);

insert into products
values (1, 'Chicken - Base', '57di54ocd', 12.6, 'meat'),
(2, 'Veal - Round, Eye Of', '74cr50lig', 17.85, 'meat'),
(3, 'Beef - Ground Lean Fresh', '89sa00ice', 8.89, 'meat'),
(4, 'Corn - Mini', '25zj86aej', 15.46, 'vegetable'),
(5, 'Cinnamon - Ground', '03ho15csi', 11.46, 'seasoning'),
(6, 'Trout - Hot Smkd, Dbl Fillet', '21cx34vem', 6.79, 'seafood'),
(7, 'Beef - Baby, Liver', '67pp52yld', 7.87, 'meat'),
(8, 'Bay Leaf Fresh', '32zh57myu', 16.88, 'vegetable'),
(9, 'Wine - Toasted Head', '13ei22kyr', 15.68, 'alcohol'),
(10, 'Wine - Red, Mosaic Zweigelt', '23cy96pao', 12.33, 'alcohol'),
(11, 'Paper Cocktail Umberlla 80 - 180', '71pd97qou', 16.93, 'decor'),
(12, 'Butter - Unsalted', '69mi95ykm', 5.36, 'dairy'),
(13, 'Artichokes - Jerusalem', '76sj92qqd', 11.93, 'vegetable'),
(14, 'Amarula Cream', '08tu01iyk', 14.55, 'dairy'),
(15, 'Barramundi', '26ld61tsv', 10.69, 'seafood'),
(16, 'Fudge - Chocolate Fudge', '95kg94uda', 16.79, 'dessert'),
(17, 'Beef - Bresaola', '67aw71hvd', 5.87, 'meat'),
(18, 'Extract Vanilla Pure', '86zg38pai', 5.63, 'seasoning'),
(19, 'Onions - Red Pearl', '27vm73oac', 17.79, 'vegetable'),
(20, 'Lemonade - Mandarin, 591 Ml', '64ry73uzl', 16.79, 'drink'),
(21, 'Ecolab - Ster Bac', '80kz42pzi', 14.44, 'cleaner'),
(22, 'Wine - Remy Pannier Rose', '03ko95dxv', 7.68, 'alcohol'),
(23, 'Wine - Red, Cabernet Merlot', '78cb94vul', 18.11, 'alcohol'),
(24, 'Broom - Angled', '27ys29xkd', 6.24, 'tool'),
(25, 'Doilies - 10, Paper', '25rj15ggm', 14.26, 'toiletries'),
(26, 'Corn Syrup', '12np58dve', 19.23, 'seasoning'),
(27, 'Blackberries', '76dj68eap', 7.02, 'fruit'),
(28, 'Coconut - Shredded, Sweet', '93jp14rze', 12.53, 'fruit'),
(29, 'Mustard Prepared', '79xh54ijh', 6.43, 'seasoning'),
(30, 'Vinegar - Balsamic, White', '28jd85blj', 5.58, 'seasoning');