SQL, or Structured Query Language, is a simplistic method of calling for data from database software like Microsoft SQL Server or MySQL databases. Using SQL, you can add, edit and store large or small amounts of data.
If you're getting into website programming, learning SQL is a must if you plan on developing or heavily customizing with web applications to do exactly what you want them to do. This skill is most commonly learned by attempting to make your application do things that you want them to do and learning how other scripts produced a similar result.
For instance, a simple content management system calls data from a database and simply displays it on the webpage.
You might wonder, "Why not just edit the HTML on the page to display the content? Why bother separating the two?"
For one thing, you can do a lot more with plain data in a database than with text on a webpage. In some cases, you can probably get by with just editing the HTML on a page, especially if your doing a small site for someone. But throw a database into the mix to store your content, you can develop a script that not only displays the data on the page, but you can also develop another script that allows the client to login to his site and edit the page without ever seeing one bit of code! (Most people freak out when they see the first bit of code and then try to explain FTP to them)
That makes your life a lot easier now that you don't have to deal with the small content changes on a webpage!
A simple content script outline will look sort of like this:
testscript.php
PHP Code:
-- (DB)Connect to Database
-- (DB)SQL Query (for content - See sample below)
-- Header
-- Content body (print content from database)
-- Footer
-- (DB) Close Connection
Sample SQL Query
PHP Code:
SELECT * FROM web_content WHERE content_id=1 LIMIT 1
(SELECTs all columns FROM the data table "web_content" WHERE the column "content_id" has a value of "1" and LIMITs the number of total results to 1 )
Sample Data Table
PHP Code:
ID | PAGE_TITLE | PAGE_CONTENT
-----|----------------|------------------
1 | My page title | Hello World!
Hopefully that will help provide a bit more insight as to a database's role in web programming. There are obviously many applications to a database, but in the field of web programming it's most commonly used to manage large amounts of data.