Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michele del Giudice
DevOps Tests
Commits
2a8a23d2
Commit
2a8a23d2
authored
Nov 17, 2025
by
Michele Del Giudice
Browse files
Added some db seeds
parent
a670ebe5
Changes
1
Hide whitespace changes
Inline
Side-by-side
seeds/seed_data.sql
0 → 100644
View file @
2a8a23d2
-- Seed data for the car_rental database
-- Creates the database if missing and inserts some sample cars and reservations.
-- Run with: mysql -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" -h "$MYSQL_HOST" -P "$MYSQL_PORT" "$MYSQL_DB" < seeds/seed_data.sql
CREATE
DATABASE
IF
NOT
EXISTS
`car_rental`
;
USE
`car_rental`
;
-- Cars
INSERT
INTO
cars
(
id
,
name
,
seats
,
ports
,
type
,
brand
,
license_plate
)
VALUES
(
1
,
'Toyota RAV4'
,
5
,
3
,
'suv'
,
'Toyota'
,
'ABC-1234'
),
(
2
,
'Honda Civic'
,
5
,
3
,
'small'
,
'Honda'
,
'CIV-2025'
),
(
3
,
'Ford Transit'
,
12
,
5
,
'van'
,
'Ford'
,
'VAN-9001'
)
ON
DUPLICATE
KEY
UPDATE
name
=
VALUES
(
name
);
-- Reservations
INSERT
INTO
reservations
(
id
,
pickup_date
,
return_date
,
car_id
,
customer_fullname
,
drive_license
)
VALUES
(
1
,
'2025-11-18 10:00:00'
,
'2025-11-20 12:00:00'
,
1
,
'Alice Example'
,
'DL1234567'
),
(
2
,
'2025-12-01 09:00:00'
,
'2025-12-05 17:00:00'
,
3
,
'Bob Driver'
,
'DL7654321'
)
ON
DUPLICATE
KEY
UPDATE
customer_fullname
=
VALUES
(
customer_fullname
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment