Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7618793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:29:48+00:00 2026-05-31T03:29:48+00:00

My task is to build a simple database to hold information on IT infrastructure

  • 0

My task is to build a simple database to hold information on IT infrastructure at my work.

I know very little about databases, but it’s not critical, it’s only going to be used by my team. I can’t go into the specifics as they’re confidential and also somewhat technical, so I’ll use a simple analogy.

Say I need to build a database holding information on various animals in an animal shelter. For the purposes of the analogy, each animal could easily have all its information held in a single table without redundancy. The fields for this table could be, say,

ANIMAL_ID, ANIMAL_NAME, SPECIES, NUMBER_LEGS, NUMBER_TOES... (bear with me, here).

Now, lets say this shelter only keeps two species, dogs and birds. Obviously you can limit NUMBER_LEGS to accept values from 0-4 only. However,

in the case of birds, they would never have more than two legs.

Similarly, a bird with only one leg (the other having been bitten off by a dog) would only have a maximum of 3 toes rather than the usual six (whereas a dog might have anything from 1 to twenty toes).

I plan to have a limit on this at the application (or even presentation) layer of the program that will access this data. It will take the form of a decision tree

(eg. choose animal, then choose number of legs, then number toes, etc). However, I am wondering if:

A) If it is typical to enforce these constraints at the data level, so that it is impossible for the database to hold, say,

a bird with three legs, or a three-legged dog with 20 toes.

B) If A is true, how would I go about doing this in a generic relational database?

(Note that although number of toes and number of claws are both numerical fields, this will not always be true in the real thing. I might need a set of a certain attribute (say ANIMAL_COLOUR), where possible values are BLACK, BLUE, RED, PURPLE, BRINDLE etc. But then a DOG cannot have the COLOUR value PURPLE; meanwhile a BIRD can be PURPLE or BLUE but not BRINDLE.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:29:50+00:00Added an answer on May 31, 2026 at 3:29 am

    They are known as check constraints. An example for Oracle is:

    create table ANIMALS
    (
      ANIMAL_ID     number
     ,ANIMAL_NAME   varchar2(100)
     ,SPECIES       varchar2(100)
     ,NUMBER_LEGS   number
     ,NUMBER_TOES   number
     ,constraint NUM_TOES_CK check(NUMBER_TOES <= NUMBER_LEGS * 3)
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple script that uses Copy-Item in the Task Build section
When I set out this morning the task seemed simple: build a list of
I'm trying to write an MSBuild task to build a database using FluentNhibernate mappings.
I want to use the <nant> task in my build script but I want
I have a very, very simple any build script: <project name=quiz_jar default=all> <target name=all>
This seems like such a simple task, but I'm having a hard time finding
I'm using ant to build my web-app. I'm sure this is simple but I
I want to build a simple code generator in java that can take database
I thought this would be a simple task, but I'm currently unable to get
i have the task to build an artifact of an application that should be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.