Skip to content

Commit

Permalink
added catalog CRUD queries
Browse files Browse the repository at this point in the history
  • Loading branch information
chloecheng8 committed Nov 21, 2023
1 parent db6533e commit 847c958
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions server/queries/catalog.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- GET - Returns all data from the catalog table
SELECT * FROM catalog;


-- GET/:id - Returns the row that matches the id
SELECT * FROM catalog WHERE id = ?;


-- POST - Adds a new row to the catalog table
INSERT INTO catalog (id, host, title, event_type, subject, description, year)
VALUES (?, ?, ?, ?, ?, ?, ?);


-- PUT - Updates an existing row given an id
-- All fields are optional
UPDATE catalog
SET host = ?, title = ?, event_type = ?, subject = ?, description = ?, year = ?
WHERE id = ?;


-- DELETE - deletes an existing row given an id
DELETE FROM catalog WHERE id=?;

0 comments on commit 847c958

Please sign in to comment.