-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debug: fixed connection to postgres | create new user functionality w…
…orks
- Loading branch information
1 parent
1c185df
commit d11c098
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- List contents of account table. | ||
SELECT * FROM account; | ||
|
||
-- List all existing tables. | ||
SELECT table_name | ||
FROM information_schema.tables | ||
WHERE table_schema = 'public' | ||
ORDER BY table_name; | ||
|
||
-- Insert value into account table. | ||
INSERT INTO account (first_name, last_name, email, bank_number, balance, created_at) | ||
VALUES ('Ghost', 'Mac', 'macbobbychibuzor@gmail.com', 1234567890, 100.50, NOW()); | ||
|
||
-- Check type of `balance` column in account table. | ||
SELECT column_name, data_type | ||
FROM information_schema.columns | ||
WHERE table_name = 'account' AND column_name = 'balance'; | ||
|
||
-- Change type | ||
ALTER TABLE account ALTER COLUMN balance TYPE float8; | ||
|
||
-- Delete a row | ||
DELETE FROM account WHERE id = 2; |