Basically, the hub only has 4 to 12 ports while the switch generally has more ports is 24.
Switch generally if the terms of safety, have a more strictly level of security than Hub.
Switch has faster data transfer than Hub.
Hub has a cheaper than switch.
Hub is influenced by the number of ports, if Hub more numerous and larger the speed goes to more slowly of the transmission process unlike the case with the switch because the number of ports does not affect the speed of data transmission.