SQL - Databases
What's a Database?
A
SQL 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
database objects
called
tables
, 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
Databases
folder of the Object Explorer gives you the option to create a
New Database
. After selecting the New Database... option,name your database "MyDatabase" and press "OK". Now is the time to press the
New Query
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
Execute
button or striking the (
F5
) key.
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
Leave a Comment