0% found this document useful (0 votes)
7 views2 pages

DB_T22

Uploaded by

ali88ayyad88
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)
7 views2 pages

DB_T22

Uploaded by

ali88ayyad88
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/ 2

Field Data Type Description Validation Rules

Name

AnimalID INT Unique identifier for Primary Key, Must be unique


animals

Name VARCHAR(5 Name of the animal Cannot be null


0)

Gender VARCHAR(1 Gender of the animal Must be 'Male' or 'Female'


0)

YearArrive INT Year the animal Must be between 1990 and


d arrived current year

KeeperID INT Assigned keeper ID Foreign Key, Must exist in


Keeper table

EnclosureI INT Assigned enclosure ID Foreign Key, Must exist in


D Enclosure table

Comments on Design Decisions

This table design stores the necessary information about the animals in the zoo very
efficiently. Here's a breakdown of the design choices:

AnimalID (INT): A common and efficient method of having a unique identifier for
each animal is to use an integer as the primary key.
Name (VARCHAR(50)): An animal name can be stored in VARCHAR (up to 50
characters in length). The rule that says that the name of an animal cannot be null
means that there is always a name for each animal.
Gender (VARCHAR(10)): VARCHAR is fine, but there's a more efficient and possibly
less error prone way to do this, storing 'M' or 'F' for gender, for example, using
CHAR(1).
YearArrived (INT): For this, we can store the year as an integer. The year is within a
reasonable range is the validation rule.
KeeperID (INT): This links to a separate "Keeper" table (not shown in the image).
This is a good practice because it reduces data redundancy and also allows you to
store more details of keepers in their own table.
EnclosureID (INT): This is similar to KeeperID as it links to an Enclosure table for
efficient management of enclosure information and its relationship to the animals.
Overall

This design is a clear and concise way to store the fundamental data about the
animals. Primary key and foreign keys are used to ensure data integrity and also
help in establishing relationship with other tables of the database. It is also possible
to refine the Gender data type for better efficiency.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy