From 57ff2d29806248c66a235081442b8925adedba03 Mon Sep 17 00:00:00 2001 From: Conor Heffron Date: Fri, 27 Sep 2024 17:47:48 +0100 Subject: [PATCH] #201 #202 Update data-h2.sql, data-mysql.sql & persons.sql (#249) --- src/main/resources/db/data-h2.sql | 3 +-- src/main/resources/db/data-mysql.sql | 8 ++++---- src/main/resources/db/persons.sql | 5 +++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/resources/db/data-h2.sql b/src/main/resources/db/data-h2.sql index ea80f51..6cc5d05 100644 --- a/src/main/resources/db/data-h2.sql +++ b/src/main/resources/db/data-h2.sql @@ -1,5 +1,4 @@ ---h2 +-- h2 initial data load INSERTS INSERT INTO IRONOC_DB.PERSON (id, title, first_name, surname, age) VALUES (1001, 'Mr', 'Conor', 'Heffron', 45); INSERT INTO IRONOC_DB.PERSON (id, title, first_name, surname, age) VALUES (1002, 'Mrs.', 'Nora', 'Jones', 29); INSERT INTO IRONOC_DB.PERSON (id, title, first_name, surname, age) VALUES (1003, 'Dr', 'Joe', 'Bloggs', 43); ---SELECT * FROM PERSON where title LIKE 'M%'; from H2 console \ No newline at end of file diff --git a/src/main/resources/db/data-mysql.sql b/src/main/resources/db/data-mysql.sql index 49a221a..a9b1cd9 100644 --- a/src/main/resources/db/data-mysql.sql +++ b/src/main/resources/db/data-mysql.sql @@ -1,4 +1,4 @@ --- ** Test Inserts for DEBUG ONLY ** -INSERT INTO `ironoc_db`.`person` (`id`, `title`, `first_name`, `surname`, `age`) VALUES (1001, "Mr", "Conor", "Heffron", 43); -INSERT INTO `ironoc_db`.`person` (`id`, `title`, `first_name`, `surname`, `age`) VALUES (1002, "Mr", "Joe", "Bloggs", 44); -INSERT INTO `ironoc_db`.`person` (`id`, `title`, `first_name`, `surname`, `age`) VALUES (1003, "Dr", "John", "Jones", 29); \ No newline at end of file +-- ** MySQL Test INSERTS for DEBUG & TESTING PURPOSES ONLY ** +INSERT INTO IRONOC_DB.PERSON (id, title, first_name, surname, age) VALUES (1001, 'Mr', 'Conor', 'Heffron', 45); +INSERT INTO IRONOC_DB.PERSON (id, title, first_name, surname, age) VALUES (1002, 'Mrs.', 'Nora', 'Jones', 29); +INSERT INTO IRONOC_DB.PERSON (id, title, first_name, surname, age) VALUES (1003, 'Dr', 'Joe', 'Bloggs', 43); diff --git a/src/main/resources/db/persons.sql b/src/main/resources/db/persons.sql index 6393a58..b702247 100644 --- a/src/main/resources/db/persons.sql +++ b/src/main/resources/db/persons.sql @@ -14,9 +14,10 @@ CREATE TABLE IRONOC_DB.PERSON ( -- Enter passw as ENV VAR for docker image or alter here later via SQL client -- ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY 'mypassword'; -- View Data ---SELECT `person`.`age`, +-- SELECT `person`.`age`, -- `person`.`id`, -- `person`.`title`, -- `person`.`first_name`, -- `person`.`surname` ---FROM `ironoc_db`.`person`; +-- FROM `ironoc_db`.`person`; +-- SELECT * FROM IRONOC_DB.PERSON where title LIKE 'M%'; from H2 console