Searching...

Creating a Database

22:39

Option 1: Programatically

Many database administrators (DBAs) use Structured Query Language (SQL) to perform many of their database tasks. To enter SQL, you need to open an interface that allows you to enter your code. For example, if you use SQL Server, you would normally use Query Analyzer.

The following example is the basic code for creating a new database. Parameters can be added to this example if your requirements are more specific.
Code

Note: This example assumes you know how to use your database system to run scripts like this. If you don't you, will probably find it easier to use the user interface method (below).

Option 2: User Interface

Most database systems make it very easy to create a database via a user interface. Generally, it's just a matter of selecting an option from a menu, then providing a name for your database.
The following examples demonstrate how to create a database in Microsoft Access.
  1. From the "File" menu, click on "New Database":
    Creating a new database in Access - step 1
  2. Choose "Blank Database". (MS Access also gives you the ability to choose from a template, but we'll just use a blank database here):
    Creating a new database in Access - step 2
  3. Choose a location to save the database:
    Creating a new database in Access - step 3

Your New Database

Once you've completed the above tasks, you should see a blank database, like this:
Creating a new database in Access - step 4 We know this database is blank because it doesn't have any tables. If it did, you would see these tables in the middle pane of the table tab. Now that we have our blank database, we can start adding some tables.

What is a Table?

In database terms, a table is responsible for storing data in the database. Database tables consist of rows and columns.
In the following example, the second row is highlighted in black:
Database row In the next example, the second column is highlighted in black. This column has been given a name of "FirstName":
Database column A row contains each record in the table, and the column is responsible for defining the type of data that goes into each cell. Therefore, if we need to add a new person to our table, we would create a new row with the person's details.
OK, now lets go ahead and create a table.

0 komentar:

Post a Comment

Mohon Saran dan Komentarnya