If you are using plywood for the top and/or base, the easiest way would be to screw the legs on, as you suggested. If you are using solid wood for construction, you may end up with problems from wood movement if you screw it all together. If I was building this out of solid wood, I’d probably mortise and tenon the legs to the bottom and screw the top to the legs with elongated screw slots to account for wood movement.
Rob, Sault Ste. Marie, Ontario