0% found this document useful (0 votes)
57 views45 pages

Prelims Lab Exercise #10 - M2U4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views45 pages

Prelims Lab Exercise #10 - M2U4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

Nimuel Vincent F.

Reyes
BSIT 101

Prelims Lab Exercise #10- M2U4

Lab 10 / Creating and Using a Database

Exercise 1 / Installing Apache Open Office

1. If necessary, start your computer and sign in.

2. Open a browser and navigate to java.com/en/download/windows_offline.jsp


3. If necessary, accept the use of cookies by the site. On the main page, click the Agree and
Start Free Download button.

4. In the prompt at the bottom of the window, click Save. When download is complete, in the

prompt, click Run.


5. In the User Account Control window, read the warning but click Yes.

6. If necessary, on the taskbar, click the Java icon. In the Java Setup wizard, click Install. At
the license terms warning prompt, click OK.
7. When prompted, click Close.
8. In the browser, navigate to openoffice.org/download

9. Under the Download Apache OpenOffice heading, select Windows (EXE) and English (US).

Then click Download full installation.

10. If necessary, accept the use of cookies by the SourceForge site. In the prompt at the bottom
of the window, click Save.
11. When download is complete, in the prompt, click Run.

12. In the User Account Control window, read the warning but click Yes.

13. In

the OpenOffice Setup wizard, click Next.


14. On the Choose Install Location page, click Install.

15.

On the Welcome to the Install Wizard for OpenOffice page, click Next.
16. On the Customer Information page, click Next.

17.
O

the Setup Type page, click Custom and then click Next.

18. Review the components. Click Next.


19. On the File Type page, clear all check boxes and then click Next. This step is very important
if you already have Microsoft Office installed.

20.

On the Ready to Install the Program page, click Install.


21. When prompted, click Finish.

22.
C

lose the browser.

23.
O

n the desktop, double-click the OpenOffice icon.


24.
O

n the Welcome page, click Next.


25. Complete the User name information and then click Finish.
Software is already installed before.

26. From the Tools menu, select Options. In the Options dialog, select Java.

27.
Click OK.

28. Close the Open Office window.


Exercise 2 / Creating a New Database

1. On the desktop, double-click the OpenOffice icon.


2. In Open Office, click Database.

3. In

the Database Wizard, on the Select database tab, click Create a new database and then
click Next.

4. On the Save and proceed tab, click Finish.


5. In the Save as window, in the navigation pane, click Documents.

6. In the File name box, type CompTIA and then click Save.

7. In the open database window, click Tables and then click Create Table in Design View.

8. In the new table window, in the Field Name column, type CustomerID
9. In the Field Type column, select Integer [INTEGER], and in the Description column, type
Primary key for the Customer table

10. In

the lower panel, from the AutoValue box, select Yes.


11. Click back in the field name area.

12.
N

ot in the PDF

13. Not in the PDF

14. Not in the PDF

15. Add an address field to the table with the following properties:
 Field Name: Address
 Field Type: Text [VARCHAR]
 Description: Enter the address
 Required: No
 Length: 50
16. Add a telephone field to the table with the following properties:
 Field Name: Telephone
 Field Type: Number [NUMERIC]
 Description: Enter the phone number with no spaces
 Required: No
 Length: 10

17.

On the toolbar, click Save.

18. In the Save As box, type the name Customer and click OK.

19. Close the Customer table. In the database window, click Create Table in Design View.
20. In the new table window, in the Field Name column, type ContactID.

21. In the Field Type column, select Integer [INTEGER], and in the Description column, type
Primary key for the Contact table

22. In the lower panel, from the AutoValue box, select Yes.

23. Click back in the field name area. The field is set as a primary key automatically.

24. In the Field Name column, type Customer.

25. In the Field Type column, select Integer [INTEGER], and in the Description column, type
Select a customer record
26. In the lower panel, from the Entry required box, select Yes.

27. Add a first name field to the table with the following properties:
 Field name: FirstName
 Field type: Text [VARCHAR]
 Required: Yes
 Length: 25
28. Add a surname field to the table with the following properties:
 Field name: Surname
 Field type: Text [VARCHAR]
 Required: Yes
 Length: 25

29. Click Save.


30. In the Save As window, in the Table Name box, type Contact and click OK.

31. Close the table window.

32. From the Tools menu, select Relationships

33. In the Add Tables dialog, with Customer selected, click Add then select Contact and click
Add.Click Close.
34. Drag the CustomerID field from the Customer table over the Customer field in the Contact
table.

35. Close the Table Relationships window. Click Yes to save when prompted.

36. On the menu bar, click Save to save the database tables.
Exercise 3 / Creating a Form and Entering Data

1. With the CompTIA database open, click the Forms button.


2. In the Tasks list, click Use Wizard to Create Form.

3. In the Form Wizard, in the Tables or queries list, select Table: Customer.
4. In the Available fields list, select Name, Address, and Telephone then click >.

5. Click Next.

6. Check the Add Subform box and the Subform based on existing relation option button.
Select Contact.

7. Click Next.
8. Add the FirstName and Surname fields then click Next.

9. On the Arrange controls lab, under Arrangement of the main form, click Columnar – Labels
left icon. Under Arrangement of the subform, click As Data Sheet.

10. Click Next.

11. Leave the defaults selected and click Next.


12. Click Next twice to accept the default style and name.

13. Select Work with the form and click Finish.


14. In the open form, type the following data in the appropriate fields:
 Name: Widget
 Address: 123 Address Street
 Telephone: 9990001111

15. Click in the subform data sheet and enter the following information:
 FirstName: Dave
 Surname: Martin
16. Type the following data in the next row:
 FirstName: Sue
 Surname: Smith

17.

Click back in the main form (in the Name field for instance) then click the New Record button
18. In the open form, type the following data in the appropriate fields:
 Name: Grommet
 Address: 321 Main Road
 Telephone: 8880002222
19. Click in the subform data sheet and enter one or two contacts.

20. Close the current form.


21. In the database window, select the Tables object. Open the Customer table. Make a note of
the values in the CustomerID primary key field for the two records

22. Close the table.

23.

Open the Contact table and check the Customer field—you should see the values you recorded
above entered in the foreign key.

24. Close the Contact table.

Exercise 4 / Working with Queries


1. With the CompTIA database open, click the Queries button.

2. Click Use Wizard to Create Query.

3. In the Query Wizard window, from the Tables list, select Table:Customer.

4. Select all fields except CustomerID and then click>.


5. From the Tables list, click Table:Contact

6. Select the FirstName and Surname fields then click>.

7. Click Next.
8. On the Sorting order tab, in the Sort by list, select Customer.Name and in the Then by list,
select Contact.Surname
9. Click Next.

10. With
Match all of the following selected, from the Fields list box, select Contact.FirstName. From
the Condition box, select is not equal to, and in the Value box, type Dave
11. Click Finish. What is wrong with the query results?
I think the output.

12.

Close the query window. In the database window, right-click Query_Customer and select Edit.

13.

Drag the CustomerID field from the Customer table over the Customer field in the Contact table.
14. Click the Save button then press F5

15.

Close the query window. In the database window, right-click Query_Customer and select Edit in
SQL View.
 The SELECT statement chooses records for viewing (data manipulation). It is followed
by a list of columns (field) names to use in the output. The AS keyword specifies an alias
for each field.
 The FROM keyword lists the data sources (Customer and Contacts).
 The WHERE keyword states the join and the criteria excluding “Dave”.

16. Close the SQL window.

17. Close Open Office, choosing to save changes when prompted.

You might also like