Skip to content

Instantly share code, notes, and snippets.

@nguyenhaison183
Last active April 19, 2024 08:11
Show Gist options
  • Save nguyenhaison183/082ba6b908de9c47ce8bd66eb73fb2b4 to your computer and use it in GitHub Desktop.
Save nguyenhaison183/082ba6b908de9c47ce8bd66eb73fb2b4 to your computer and use it in GitHub Desktop.
Project: Create a table | Codecademy | Analyze data with SQL | 1. Getting started with SQL | Manipulation
CREATE TABLE friends (
id INTEGER,
name TEXT,
birthday DATE
);
INSERT INTO friends
VALUES (1, 'Jane Doe', 1990-05-30);
SELECT *
FROM friends;
INSERT INTO friends
VALUES (2, 'Vu Minh', 1993-08-27);
INSERT INTO friends
VALUES (2, 'Hai Son', 1993-03-18);
UPDATE friends
SET name = 'Jane Smith'
WHERE ID = 1;
ALTER TABLE friends
ADD COLUMN email TEXT;
UPDATE friends
SET email = 'jane@codecademy.com'
WHERE id = 1;
DELETE FROM friends
WHERE id = 1;
SELECT *
FROM friends;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment