Compare commits
No commits in common. "a162408275fa522d2f23701f7e03c6f39337caf1" and "d324ddb3c9bda744caedc637c3941117704fe3ba" have entirely different histories.
a162408275
...
d324ddb3c9
5 changed files with 0 additions and 19 deletions
|
@ -4,8 +4,6 @@ if [[ $1 -eq "0" ]]; then
|
|||
sqlite3 test.db ".read sql/create_db.sql"
|
||||
elif [[ $1 -eq "1" ]]; then
|
||||
sqlite3 test.db ".read sql/insert_data.sql"
|
||||
elif [[ $1 -eq "2" ]]; then
|
||||
sqlite3 test.db ".read sql/show_sg.sql"
|
||||
elif [[ $1 -eq "9" ]]; then
|
||||
sqlite3 test.db ".read sql/show_all.sql"
|
||||
fi
|
||||
|
|
|
@ -2,4 +2,3 @@ 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');
|
||||
INSERT INTO customers VALUES(5, 'Kurt', 'Kurtl', 'St. Moritz', '9200');
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
SELECT *
|
||||
from customers
|
||||
where CITY LIKE "St.%gallen";
|
|
@ -1,3 +0,0 @@
|
|||
UPDATE customers
|
||||
SET CITY = 'St. Gallen'
|
||||
WHERE CITY LIKE "St.%gallen";
|
10
start.py
10
start.py
|
@ -23,11 +23,6 @@ def parse_args():
|
|||
default='table',
|
||||
help='prints all the cells from the table',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-u', '--update',
|
||||
action='store_true',
|
||||
help='Updates the city names'
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
@ -44,11 +39,6 @@ def execute_sql(args):
|
|||
print("insert")
|
||||
with open ('sql/insert_data.sql', 'r') as sql_file:
|
||||
cur.executescript(sql_file.read())
|
||||
elif args.update:
|
||||
print("Updating database")
|
||||
with open ('sql/update_sg.sql', 'r') as sql_file:
|
||||
cur.executescript(sql_file.read())
|
||||
|
||||
elif args.print:
|
||||
cur.execute("SELECT * from customers")
|
||||
if args.print == 'table':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue