Grade 7 Science: Coding Project 13 – Design a Store Database

This project is from the SQL section in Khan Academy.

The objective of this project is to design a store’s database.

https://www.khanacademy.org/computer-programming/spin-off-of-project-design-a-store-database/4839932328558592

 

CREATE TABLE Sophia_Candy_Store(id INTEGER PRIMARY KEY, name TEXT, price INTEGER, weight INTEGER, aisle TEXT);

INSERT INTO Sophia_Candy_Store VALUES(1, “M&M”, 1, 10, “Chocolate Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(2, “Hershey”, 2, 50, “Chocolate Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(3, “Almond Joy”, 1, 10, “Chocolate Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(4, “Reese’s Pieces”, 3, 30, “Chocolate Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(5, “Bounty”, 2, 70, “Chocolate Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(6, “Werthers”, 5, 100, “Hard Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(7, “Altoids”, 3, 200, “Hard Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(8, “Jolly Ranchers”, 6, 300, “Hard Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(9, “Runts”, 2, 100, “Hard Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(10, “Giant Jawbreakers”, 5, 300, “Hard Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(11, “Jelly Beans”, 2, 200, “Chewy Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(12, “Mentos”, 5, 100, “Chewy Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(13, “Atomic Fireballs”, 6, 300, “Chewy Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(14, “Skittles”, 4, 100, “Chewy Candy Aisle”);
INSERT INTO Sophia_Candy_Store VALUES(15, “Starburst”, 5, 200, “Chewy Candy Aisle”);
SELECT * FROM Sophia_Candy_Store;

SELECT * FROM Sophia_Candy_Store GROUP BY name;

Unknown's avatar

Author: sophiaelahirpc

10th Grade student in the Ron Paul Curriculum. Full-time teen writer living in Singapore.

Leave a comment

Design a site like this with WordPress.com
Get started