Changes between Version 1 and Version 2 of UseCase11
- Timestamp:
- 01/25/26 19:15:24 (2 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UseCase11
v1 v2 8 8 SELECT clinic_id, name, city, address 9 9 FROM vet_clinics 10 WHERE clinic_id = $1;10 WHERE name = 'Happy Paws Clinic'; 11 11 }}} 12 12 2. Clicks the "Leave review" button. … … 15 15 BEGIN; 16 16 17 INSERT INTO reviews (reviewer_id, rating, comment, created_at) 18 VALUES ($1, $2, $3, NOW()) 19 RETURNING review_id; 20 17 WITH new_review AS ( 18 INSERT INTO reviews (reviewer_id, rating, comment, created_at) 19 VALUES ( 20 (SELECT user_id FROM users WHERE username = 'client.viktor'), 21 5, 22 'Excellent clinic, very professional staff.', 23 NOW() 24 ) 25 RETURNING review_id 26 ) 21 27 INSERT INTO clinic_reviews (review_id, target_clinic_id) 22 VALUES ($4, $5); 28 SELECT 29 nr.review_id, 30 (SELECT clinic_id FROM vet_clinics WHERE name = 'Happy Paws Clinic') 31 FROM new_review nr; 23 32 24 33 COMMIT;
