Sohana Nizam 2121715630 - Activities

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Vet Database Lab using LibreOffice Base

Preface: Data at a Veterinary Clinic


A veterinary clinic is a hospital, doctor's office, or medical building for the treatment of non-human animals. The
patients are mostly the pet animals who are very dear to their Owners. That is why it is very important to keep a
track of the pet’s information as well as the owner’s information for further assistance.

Organization
Owner/Customer Information
The owner of a pet is the customer of the Vet. Clinic. The owner bears the responsibility of a pet, therefore, owner
details are of great importance like his/her name, occupation, phone number, and related information. We might
consider having the owners’ information in a separate table to reduce redundancies.

A table is a set of columns and rows. Each column is called a field. The fields included in the above mentioned tables
are given below

Field Name Field Type Field Property


Customer ID Integer Primary Key, Auto Value
First Name Text [VARCHAR] 20 Required
Last Name Text [VARCHAR] 30 Required
Phone Number Text [VARCHAR] 15 Required
Address Text [VARCHAR] 100 Required
Pet Information
The pets are the patient. Information about the pets/patients can be kept in another table to reduce redundancies.
The basic information about an animal includes type, breed, birthdate, and gender. We will consider creating a
separate table with the pet’s information.

Field Name Field Type Field Property


Pets ID Integer (Primary Key) Primary Key, Auto Value
Pet’s Name Text [VARCHAR] 20 Required
Type Of Animal Text [VARCHAR] 20 Required
Breed Text [VARCHAR] 30
Date of Birth Date
Gender Text [VARCHAR] 5
Visits/Transaction
Keeping a history about previous visits of the pet can provide the clinic with information to improve the service
level. We will consider adding a third table that contains information like the date and time of the visit(s), services
rendered, amount paid, and notes.

Field Name Field Type Field Property


Visit ID Integer (Primary Key) Primary Key, Auto Value
Date & Time Date & Time Required
Service Rendered Text [VARCHAR] 100 Required
Amount Decimal
Invoiced Boolean

Vet Database: Lab Manual


Tasks to Perform
Task 0: Creating a Blank Database

Figure: Creating Blank Database

Vet Database: Lab Manual


Task 1.1: Creating the Visits table in “Design View”

Consider the fields types and their attributes.

Vet Database: Lab Manual


Task 1.2: Customer Table from Templates/Wizard

Review table attributes, modify fields

Vet Database: Lab Manual


Task 1.3: Importing the Pets Table

Copy both table structure and data from spreadsheet.

Vet Database: Lab Manual


Task 2: Relationship and Foreign Keys

Create the foreign keys by “edit”ing the tables

Now create the relationships.

Vet Database: Lab Manual


Vet Database: Lab Manual
Task 3.1: Enter data Manually
Enter your name as a customer and your NSU ID as the phone number.

FirstName LastName Phone Address

Nusrat Smart Faria 780 Gulshan 1

Task 3.2: Import data from spreadsheet


Paste data from a spreadsheet.

Customer data.

Pets data- already imported with the table.

Visits data.

Total
VisitID Visit Date Service Invoiced PetID Amount

2020-01-01 Grooming 1 8 240

2020-01-01 Grooming 1 16 150

2020-01-01 Grooming 0 2 100

2020-01-01 Grooming 0 2 200

2020-01-01 Grooming 1 12 290

2020-01-01 Grooming 0 20 290

2020-01-01 Grooming 0 20 220

2020-01-01 Grooming 1 11 290

2020-01-01 Grooming 0 17 140

2020-01-01 Grooming 0 11 230

2020-01-01 Grooming 1 7 260

...

Vet Database: Lab Manual


Task 4.1: Creating the customer Form to enter data
Create the customer form to enter customer data using the “Wizard”.

Add a title to the form.

Make the CustomerID readonly

Vet Database: Lab Manual


Add Control Buttons

Vet Database: Lab Manual


Task 4.2: Creating the Pet form with Visits Subform

Vet Database: Lab Manual


Make the Gender information a list box.

Vet Database: Lab Manual


Change the date format as in the figure.

Vet Database: Lab Manual


Task 4.3: Use form for data entry
● View customer and pet information.
● Use the form to search “Tuffy”
● Edit Tuffy’s information
● Add a new pet for yourself

Task 5.1: Query the pets


It is always difficult to fetch information from a complex and large database. Query helps to fetch
information in a much easier way.

Vet Database: Lab Manual


● Create a query listing all the pets and their owners.
● Use aliases and sort to organize your data.

Vet Database: Lab Manual


Query is the the question you want to ask to find a particular set of information. Adding criteria to show only
dogs.

Vet Database: Lab Manual


Fig: Query

Task 5.2: Query the outstanding customers

List the customers and total amount spent.

Review the SQL code generated.

Vet Database: Lab Manual


Task 6: Create a printable report of the outstanding customers
Use the query as an input to the report.

Edit Report header.

Reference
A very powerful software. fSome capability demonstrated.

LibreOffice Base 4.1 Tutorals @ thefrugalcomputerguy.com & @ youtube

Vet Database: Lab Manual

You might also like