I think you should change this :
create table pets(
id_pet int identity not null primary key,
type_pets nvarchar (20) not null,
breed nvarchar (20) not null,
stock int not null,
created_by varchar(20),
--getdate()
created_date datetime
);
-- description of an animal --
create table description_of_animal (
ages decimal (2,2),
weight decimal (10,3),
gender nvarchar (30),
threshold_of_life nvarchar (45) not null,
color nvarchar (20) not null,
price decimal (5,4),
vaccine BIT,
created_by varchar(20),
--getdate()
created_date datetime
);
Because, this information should be displayed, you need some master table, and change your existing tables :
pets, and
description_of_animal .
Information should be displayed on:
- Species, breeds of animals
- Description of animals
Try to change the existing table to be like this approximately.
create table pets(
id_pet int identity not null primary key,
type_pets nvarchar (20) not null,
breed nvarchar (20) not null,
stock int not null,
created_by varchar (20),
created_date varchar(20)
);
-- description of an animal --
create table description_of_animal (
--id is auto generated ID
id int identity(1,1) not null primary key,
--foreign key for pets table
id_pet int,
ages decimal (2,2),
weight decimal (10,3),
gender nvarchar (30),
threshold_of_life nvarchar (45) not null,
color nvarchar (20) not null,
price decimal (5,4),
vaccine BIT,
created_by varchar (20),
created_date varchar(20)
);
create table breed (
id int identity(1,1) not null primary key,
code varchar(20),
name varchar(100)
)
create table type_pets (
id int identity(1,1) not null primary key,
code varchar(20),
name varchar(100)
)
Try to make clear the information, from system analyst. what is difference between breeds and Species. Is that making difference on some part functionalities like price, or filtering?