dcsimg

Introduction to Databases for the Web: Pt. 1 - Page 9

August 16, 1998

Logging on to the Database

It is important to note that for most databases, you will actually need to log on. That is, most databases implement a security system that gives various users different privileges to do different things such as READ ONLY or READ/WRITE.

Most likely, your database administrator will have provided you with a login name and a password. She will also have either provided you with the net address of the database so you can log in remotely, or has given you a direct command line shell.

Once you are logged in to a database, you can begin to populate the database with data or extract already existing data. Let's look first at populating the database.

A Sample Database

Okay, let's define a simple relational database that we can use to practice with...

We will define a database called "MY_COMPANY" with four tables, "CLIENTS", "EMPLOYEES", "PRODUCTS", and "SALES". These tables will look something like the following:

EMPLOYEES Table
EMP_NUM EMP_NAME EMP_COMMISSION EMP_SALARY
001 Lim Li Chuen 10% 90,000 USD
002 Lim Sing Yuen 20% 40,000 USD
003 Loo Soon Keat 20% 50,000 USD

 

CLIENTS Table
C_NUM C_NAME C_ADDR C_CITY C_STATE C_ZIP C_PHONE
001 Jason Lim 100 W 10th St LA CA 90027 456-7890
002 Rick Tan 21 Jack St LA CA 90031 649-2038
003 Stephen Petersen 1029#A Kent Ave. LA CA 90102 167-3333

 

PRODUCTS Table
P_NUM P_QUANTITY P_PRICE
001 104 99.99
002 12 865.99
003 2000 50.00

 

SALES Table
S_NUM P_NUM S_QUANITY S_AMOUNT E_NUM C_NUM
001 001 1 99.99 101 102
002 001 2 199.98 102 101
003 002 1 865.99 101 103







The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers