Compare commits

...

4 commits

Author SHA1 Message Date
caminsha 3d924c1359 Started a script to call the function 2022-07-15 22:16:25 +02:00
caminsha af2b7063b1 Small query to show all entries 2022-07-15 22:16:10 +02:00
caminsha 8b67b0a9c1 Simplified insert mechanism 2022-07-15 22:15:53 +02:00
caminsha 12e9eee3a4 Added gitignore file 2022-07-15 22:15:35 +02:00
4 changed files with 15 additions and 5 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.db

View file

@ -1,5 +1,4 @@
INSERT INTO customers (ID, NAME, SURNAME, CITY, PLZ)
VALUES(1, 'Egger', 'Stefan', 'St. Gallen', '9000')
VALUES(2, 'Müller', 'Sepp', 'St.Gallen', '9000')
VALUES(3, 'Kurt', 'Kurtl', 'St. gallen', '9000')
VALUES(3, 'Kurt', 'Kurtl', 'St.gallen', '9000')
INSERT INTO customers VALUES(1, 'Egger', 'Stefan', 'St. Gallen', '9000');
INSERT INTO customers VALUES(2, 'Müller', 'Sepp', 'St.Gallen', '9000');
INSERT INTO customers VALUES(3, 'Kurt', 'Kurtl', 'St. gallen', '9000');
INSERT INTO customers VALUES(4, 'Kurt', 'Kurtl', 'St.gallen', '9000');

9
script.sh Normal file
View file

@ -0,0 +1,9 @@
#!/bin/bash
if [[ $1 -eq "0" ]]; then
sqlite3 test.db ".read create_db.sql"
elif [[ $1 -eq "1" ]]; then
sqlite3 test.db ".read insert_data.sql"
elif [[ $1 -eq "9" ]]; then
sqlite3 test.db ".read show_all.sql"
fi

1
show_all.sql Normal file
View file

@ -0,0 +1 @@
SELECT * from customers;