CREATE TABLE reservations (code NUMBER, room CLOB, checkin CLOB, checkout CLOB, rate NUMBER, lastname CLOB, firstname CLOB, adults NUMBER, kids NUMBER)
CREATE TABLE rooms (roomid CLOB, roomname CLOB, beds NUMBER, bedtype CLOB, maxoccupancy NUMBER, baseprice NUMBER, decor CLOB)

How many times the number of adults and kids staying in a room reached the maximum capacity of the room?
SELECT COUNT(*) FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid WHERE T2.maxoccupancy = T1.adults + T1.kids
SELECT COUNT(*) FROM "reservations" "T1" JOIN "rooms" "T2" ON "T1"."room" = "T2"."roomid" AND "T2"."maxoccupancy" = "T1"."adults" + "T1"."kids"