Skip to content

In this project, you will create your own “Friends” table and add/delete data from it.

Notifications You must be signed in to change notification settings

Fran0616/CreatingTableSQLProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 

Repository files navigation

CreatingTableSQLProject

Objective

In this project, you will create your own “Friends” table and add/delete data from it.

  1. Create a table named friends with three columns:
  • id that stores INTEGER

  • name that stores TEXT

  • birthday that stores DATE

CREATE TABLE friends (
 id INTEGER,
 name TEXT,
 birthday DATE
);
  1. Beneath your current code, add Ororo Munroe to friends. Her birthday is May 30th, 1940.
INSERT INTO friends (id, name, birthday)
VALUES (1, "Ororo Munroe","05/30/40");
  1. Add two of your friends to the table.
  • Insert an id,
  • name, and
  • birthday for each of them.
INSERT INTO friends (id, name, birthday)
VALUES (2, "Francisco", "03/23/90");
INSERT INTO friends (id, name, birthday)
VALUES (3, "Stefanie", "09/28/02");
  1. Ororo Munroe just realized that she can control the weather and decided to change her name. Her new name is “Storm”. Update her record in friends.
UPDATE friends
SET name = "Storm"
WHERE id = 1;
  1. Add a new column named email.
ALTER TABLE friends
ADD email VARCHAR;
  1. Update the email address for everyone in your table.
UPDATE friends
SET email = "[email protected]"
WHERE id = 1;
  1. Wait, Storm is fictional…
  • Remove her from friends.
DELETE FROM friends
WHERE id = 1;
  1. Let’s take a look at the result one last time
SELECT *
FROM friends;

Friends Table

id name birthday email
2 Francisco 03/23/90
3 Stefanie 09/28/02

About

In this project, you will create your own “Friends” table and add/delete data from it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published