Hello I am practising and learning SQLite,
I created a SQLite file manually on VSCODE I call the file project_1.sqlite but when I try run the command
sqlite3 project_1.sqlite i get
$ sqlite3 project_1.sqlite
SQLite version 3.36.0 2021-06-18 18:36:39
Enter ".help" for usage hints.
sqlite>
then when I say SELECT * FROM friends; I get
sqlite> SELECT * FROM friends;
Error: file is not a database
sqlite>
I have already set up my SQLite inside the Control Pannel
Why am I getting the Error: file is not database ??
my project_1.sqlite file I already have populated it like this:
CREATE TABLE friends (
id INTEGER,
name TEXT,
birthday DATE
);
INSERT INTO friends (id, name, birthday)
VALUES (1, 'Ororo Munroe', '1940-05-30');
INSERT INTO friends (id, name, birthday)
VALUES (2, 'Sham', '1990-01-01');
INSERT INTO friends (id, name, birthday)
VALUES (3, 'Maria', '1991-01-01');
UPDATE friends
SET name = 'Storm'
WHERE id = 1;
ALTER TABLE friends
ADD COLUMN email TEXT;
UPDATE friends
SET email = 'storm@bffemail.com'
WHERE id = 1;
UPDATE friends
SET email = 'sham@bffemail.com'
WHERE id = 2;
UPDATE friends
SET email = 'maria@bffemail.com'
WHERE id = 3;
DELETE FROM friends
WHERE id = 1;
SELECT * FROM friends;
I have Windows but I have installed Bash so I am using Bash commands hope that makes sense I dont have Linux I am new to Programming as well sorry