SQL - Databases
What's a Database?
is nothing more than anempty shell, like a vacant warehouse. It offers no realfunctionality whatsoever, but does provide a virtual space tostore data. Data is stored inside of
, and tables are the containers that actually hold specifictypes of data, such as numbers, files, strings, and dates.A single database can house hundreds of tables containing morethan 1,000 table columns each and they may be jam packedwith relational data ready to be retrieved by SQL. Perhaps thegreatest feature SQL offers is that it doesn't take much effort torearrange your warehouse to meet your ever-growing businessneeds.
SQL - Creating a Database
Creating a database inside of SQL Express has its advantages.After launching Microsoft's SQL Server Management StudioExpress application, simply right-clicking on the
folder of the Object Explorer gives you the option to create a
. After selecting the New Database... option,name your database "MyDatabase" and press "OK". Now is the time to press the
button located towardthe top of the screen, just above the Object Explorer pane.Pressing this button offers an empty tab. All SQL querystatements (code) that we will be exploring will be entered hereand executed against the SQL Express database.If you haven't yet created a new database, you may also create adatabase by typing the following SQL query statement intoyour new empty query tab, and then pressing the
button or striking the (
SQL Create Database Query:
CREATE DATABASE MyDatabase;
After executing this query, SQL will notify you that your queryhas run successfully and that the database was created