HPlogo Up and Running with ALLBASE/SQL: HP 3000 and HP 9000 Computer Systems > Chapter 1 Very Basic...

How Do I Create a Database?

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

To create a database, you need to perform at least some of the following tasks:

  • Create tables.

  • Create views.

  • Create indexes.

These tasks are part of the data definition process, which also includes placing the tables in specific DBEFilesets, and using the SQL DROP statement to remove tables or views that are no longer needed.

Most data definition tasks are carried out when you are setting up the database for the first time. But you may need to do some data definition tasks later, when, for example, you need additional database capacity.

Statements to Create Databases

You use SQL CREATE statements to create database tables and all the other components of a database. Each of these statements is shown in more detail later in this book; the following is only one example:

   CREATE PUBLICREAD TABLE Employees 

   (LastName VARCHAR(15) NOT NULL,

   FirstName VARCHAR(15) NOT NULL, 

   EmpNumber INTEGER NOT NULL)

After creating a table, you use the ISQL INPUT and LOAD commands or an application program to put data into it. You can also add single rows to a table by using the SQL INSERT statement. (These tasks are explained and illustrated in chapter 3.)

Feedback to webmaster