How to create relational database using openoffice.org base

How to create relational database using openoffice.org base
Create tables using wizard:
from sample table “Customers”, add fields:
“CustomerID”
“CompanyName”
-”set primary key”: “use an existing field as primary key”/”Fieldname”=”CustomerID”
“auto value”=on
-from sample table “Tasks”, add fields:
TaskID
Description
and from sample table “Customers”, add field:
CustomerID
-”set primary key”: “use an existing field as primary key”/”Fieldname”=”TaskID”
“auto value”=on
-Set relationship:
tools/relationship: Customers.CustomerID -> Tasks.CustomerID
Creating forms:
Forms/use wizard to create form
From Tasks table add all items
Finish.
Exit form.
Edit forms to show custom fields:
Right click on “Tasks” form, click edit
Right click on CustomerID
Replace with=listbox
Right click on CustomerID/column
“Type of list contents”=Sql
“List content”, click on “…”, add Customers table
(here we set display to show company name first instead of just company id.)
field cell=CompanyName
table cell=customers
visible=on
column next to it
field cell=CustomerID
table cell=customers
visible=on
Make sure CompanyName is first, then CustomerID.
Save. Close
save form. close.
(optional: if you want to display one record per page,
on “5. Arrange controls” part of form wizard, select one of the “columnar” form layout.
also, later when editing:
right click on group (text + text field), group/ungroup
right click on text field, control/properties, general/dropdown=yes.)
Using form:
add at least two rows in “customers” table using “tables” tool.
(just click on tables in left panel, then on customers in right panel)
You can add more data using “Tasks” form.
You can create another form for adding more customers.
Optional: Reports and query
-Query, use wizard:
add from tasks table: Description
add from Customers table: CompanyName
(you can choose whichever you want.)
Finish.
Edit query: Customers.CustomerID -> Tasks.CustomerID
so you do not have double display
Reports:
use query as source.
unfinished:
SELECT “LastName” || ‘, ‘ ||  “FirstName” FROM “Employees” AS “Employees”
relational databases:

How to create relational database using openoffice.org base
Create tables using wizard:from sample table “Customers”, add fields:”CustomerID””CompanyName”
-”set primary key”: “use an existing field as primary key”/”Fieldname”=”CustomerID””auto value”=on

-from sample table “Tasks”, add fields:TaskIDDescriptionand from sample table “Customers”, add field:CustomerID
-”set primary key”: “use an existing field as primary key”/”Fieldname”=”TaskID””auto value”=on

-Set relationship:tools/relationship: Customers.CustomerID -> Tasks.CustomerID

Creating forms:
Forms/use wizard to create formFrom Tasks table add all itemsFinish.Exit form.
Edit forms to show custom fields:
Right click on “Tasks” form, click editRight click on CustomerIDReplace with=listboxRight click on CustomerID/column”Type of list contents”=Sql”List content”, click on “…”, add Customers table(here we set display to show company name first instead of just company id.)

field cell=CompanyNametable cell=customersvisible=on
column next to itfield cell=CustomerIDtable cell=customersvisible=on
Make sure CompanyName is first, then CustomerID.
Save. Closesave form. close.

(optional: if you want to display one record per page, on “5. Arrange controls” part of form wizard, select one of the “columnar” form layout.also, later when editing:right click on group (text + text field), group/ungroupright click on text field, control/properties, general/dropdown=yes.)

Using form:add at least two rows in “customers” table using “tables” tool.(just click on tables in left panel, then on customers in right panel)

You can add more data using “Tasks” form.
You can create another form for adding more customers.

Optional: Reports and query-Query, use wizard:add from tasks table: Descriptionadd from Customers table: CompanyName(you can choose whichever you want.)Finish.
Edit query: Customers.CustomerID -> Tasks.CustomerIDso you do not have double display

Reports:use query as source.

relational databases: http://computer.howstuffworks.com/question599.htm

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: