- Home
- Anonymous
- Sign in
- Create
- Ask a question
- Spaces
- Site Issues (NOT FOR DATABASE QUESTIONS)
- Explore
- Topics
- Questions
- Users
- Badges

Select * from YogaTimeTable; Delete from YogaTimeTable Where RoomNum IN (select tt.RoomNum from YogaRooms r, YogaTypes t, YogaTimeTable tt where r.RoomNum = tt.roomNum and ((r.RoomCapacity * t.ClassPrice) - (r.CostPerHour * tt.duration / 60)) < 200); Select * from YogaTimeTable; The goal is to delete any classes from the timetable that can make less than $200 profit. To calculate the profitability of each class, multiply the roomcapacity by the classprice and then subtract the cost of the room. To calculate the cost of the room multiply the costperhour by the duration divided by 60. but it isn't giving the right result, can someone tell me where I made my mistake. Thanks. The tables are attached. [Tables][1] [1]:
https://i.stack.imgur.com/Q4Q3n.jpg

sqlmysql
Comment

**19** People are following this question.

Copyright 2019 Redgate Software.
Privacy Policy