There are essentially 3 levels to any (well designed) web page / web application. I'll try to simplify things for you since you seem to be a beginner.
1. Data Model
2. Business Logic
3. User Interface
Data Model
Databases are most commonly used here to store data saved by the system and the users. This is raw data and is sent to the Business Logic tier for processing. A database uses SQL (Structured Query Language) to retrieve and persist data.
Business Logic
This is where your server-side languages (Python, Perl, PHP, Java, etc.) will retrieve data from the database, process it and send it to the User Interface to show the user. Also, this tier will take input from the User Interface, process it and send it to the database for future retrieval.
User Interface
This is what the user looks at. This tier will translate user actions into Business Logic, sending input to the Business Logic. Ideally, your User Interface should ONLY consist of styling and the look-and-feel of your application. Other than simple form validation, the User Interface should never process data. The User interface (for web applications) will use HTML and CSS.
I guess I could have linked this:
http://en.wikipedia.org/wiki/Multitier_architecture but I wrote all this out before realizing it...
So, in order for someone to create an entire web app, one should know all three tiers and they're respective languages.
To me, a Web Designer works on the User Interface, a Web Developer works on the Business Logic, and a Data Architect (DBA) works on the Data Model.