source: DB/polnenje.sql

Last change on this file was 364f27d, checked in by MetodiMladenovski <meto.18@…>, 14 months ago

added projects and db scripts

  • Property mode set to 100644
File size: 3.7 KB
Line 
1INSERT INTO admin_table(email, encrypted_password, first_name, surname)
2VALUES ('admin@gmail.com', 'eYweUU23KK321MM', 'Admin', 'Admin');
3
4INSERT INTO driver (email, encrypted_password, first_name, surname,
5price_per_km, is_approved, admin_id)
6VALUES ('goce.naumovski@gmail.com', 'eUoafcakfo23OKC', 'Goce', 'Naumovski',
7 20, true, (SELECT admin_id FROM admin_table WHERE first_name='Admin')),
8 ('stole.petkov@gmail.com', 'ads2EA421da23DD', 'Stole', 'Petkov',
9 30, true, (SELECT admin_id FROM admin_table WHERE first_name='Admin')),
10 ('filip.filipovski@yahoo.com', 'adw321FAWF23cc', 'Filip', 'Filipovski',
11 25, true, (SELECT admin_id FROM admin_table WHERE first_name='Admin'));
12
13
14INSERT INTO car(license_plate, model, make, car_year, driver_id)
15VALUES ('SK-424-NMK', 'Astra', 'Opel', 2012, (SELECT driver_id FROM driver WHERE first_name='Goce')),
16 ('KP-3213-MK', 'A7', 'Audi', 2020, (SELECT driver_id FROM driver WHERE first_name='Stole')),
17 ('PP-6453-NMK', '320d', 'BMW', 2015, (SELECT driver_id FROM driver WHERE first_name='Filip'));
18
19
20
21INSERT INTO passenger (email, encrypted_password, first_name, surname)
22VALUES ('marko.markovic@gmail.com', 'eYweUU23KK321MM', 'Marko', 'Markovic'),
23 ('petar.petkov@gmail.com', 'd4kAO421OPAWF2K', 'Petar', 'Petkovski'),
24 ('igor.dzambazov@yahoo.com', 'opa4paKLC213L', 'Igor', 'Dzambazov');
25
26
27INSERT INTO request (city_address, street_address, number_address,
28latitude, longitude, passenger_id, confirmed_by_driver_id, chosen_driver_id)
29VALUES ('Skopje', '8-mi Septemvri', 100,
30 41.99393959013524, 21.417377667964814,
31 (SELECT passenger_id FROM passenger WHERE first_name='Marko'),
32 (SELECT driver_id FROM driver WHERE first_name='Goce'),
33 (SELECT driver_id FROM driver WHERE first_name='Goce')),
34 ('Skopje', 'Sekspirova', 1000,
35 42.00507009481923, 21.393345075915562,
36 (SELECT passenger_id FROM passenger WHERE first_name='Petar'),
37 (SELECT driver_id FROM driver WHERE first_name='Stole'),
38 (SELECT driver_id FROM driver WHERE first_name='Stole')),
39 ('Skopje', 'Londonska', 2000,
40 41.99818153071492, 21.39870949368447,
41 (SELECT passenger_id FROM passenger WHERE first_name='Igor'),
42 (SELECT driver_id FROM driver WHERE first_name='Filip'),
43 (SELECT driver_id FROM driver WHERE first_name='Filip'));
44
45
46INSERT INTO drive (driver_id, request_id, car_id, grade, km_travelled, destination_latitude, destination_longitude)
47VALUES ((SELECT driver_id FROM driver WHERE first_name='Goce'),
48 (SELECT request_id _id FROM request WHERE number_address=100),
49 (SELECT car_id FROM car WHERE make='Opel'), 4.5, 10.1, 41.98658487414903, 21.417779251761253),
50 ((SELECT driver_id FROM driver WHERE first_name='Stole'),
51 (SELECT request_id FROM request WHERE number_address=1000),
52 (SELECT car_id FROM car WHERE make='Audi'), 5.0, 2.2, 41.993953125548614, 21.436189933794598),
53 ((SELECT driver_id FROM driver WHERE first_name='Filip'),
54 (SELECT request_id FROM request WHERE number_address=2000),
55 (SELECT car_id FROM car WHERE make='BMW'), 3.0, 5.4, 41.99806749233745, 21.391557977533605);
56
57
58INSERT INTO payment (total_sum_payed, drive_id, passenger_id)
59VALUES (20*10.1,
60 (SELECT drive_id FROM drive WHERE (SELECT driver_id FROM driver WHERE first_name='Goce')=driver_id),
61 (SELECT passenger_id FROM passenger WHERE first_name='Marko')),
62 (25*2.2,
63 (SELECT drive_id FROM drive WHERE (SELECT driver_id FROM driver WHERE first_name='Stole')=driver_id),
64 (SELECT passenger_id FROM passenger WHERE first_name='Petar')),
65 (30*5.4,
66 (SELECT drive_id FROM drive WHERE (SELECT driver_id FROM driver WHERE first_name='Filip')=driver_id),
67 (SELECT passenger_id FROM passenger WHERE first_name='Igor'));
Note: See TracBrowser for help on using the repository browser.