-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpet_mart_queries.sql
More file actions
47 lines (40 loc) · 952 Bytes
/
pet_mart_queries.sql
File metadata and controls
47 lines (40 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
-- To get all pets
-- SELECT * FROM tblPets;
-- To get pets based on ID
-- SELECT * FROM tblPets WHERE pet_id=1;
-- To get pets based on active status
-- SELECT * FROM tblPets WHERE pet_status = true;
-- To get pets based on category
-- SELECT * FROM tblPets WHERE pet_category='dog';
-- To add pet
-- INSERT INTO tblPets(
-- pet_name,
-- pet_description,
-- pet_img,
-- pet_price,
-- pet_category,
-- pet_isOnOffer,
-- pet_status
-- )
-- VALUES (
-- "Labrador",
-- "Cute,frienldy",
-- "xyz.png",
-- 18000,
-- "dog",
-- false,
-- true
-- );
-- To update pet based on id
-- UPDATE tblPets SET
-- pet_name = 'a_pet_name',
-- pet_description = 'a_description',
-- pet_price = 00000,
-- pet_category = 'a_category',
-- pet_isOnOffer = true,
-- pet_status = true,
-- WHERE pet_id = 1;
-- To delete a pet on id
-- DELETE FROM tblPets WHERE pet_id = 1;
-- To delete all pets
-- TRUNCATE tblPets;