A server is a digital space where files and folders from your website are stored. A database also stores data from your website (e.g. site settings, login credentials, posts and pages, installed software, etc) but it runs on your server. In other words, your website server stores your database, and the database collects and stores certain data from your website. Think of it like a Russian doll set where wooden dolls of decreasing sizes are placed inside one another.