Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

draw an ERD diagram according to the given information for veteniery clinic below. CREATE TABLE Customers ( customer _ id INT PRIMARY KEY, name VARCHAR

draw an ERD diagram according to the given information for veteniery clinic below. CREATE TABLE Customers (
customer_id INT PRIMARY KEY,
name VARCHAR(100),
contact_details VARCHAR(255)
);
CREATE TABLE Pets (
pet_id INT PRIMARY KEY,
name VARCHAR(100),
date_of_birth DATE,
genre VARCHAR(50),
type VARCHAR(50),
special_foods VARCHAR(255),
habitat VARCHAR(255),
care VARCHAR(255),
license_number VARCHAR(50),
customer_id INT,
FOREIGN KEY (customer_id) REFERENCES Customers(customer_id)
);
CREATE TABLE Vets (
vet_id INT PRIMARY KEY,
name VARCHAR(100),
specialization VARCHAR(100)
);
CREATE TABLE Inspections (
inspection_id INT PRIMARY KEY,
pet_id INT,
vet_id INT,
date DATE,
findings TEXT,
FOREIGN KEY (pet_id) REFERENCES Pets(pet_id),
FOREIGN KEY (vet_id) REFERENCES Vets(vet_id)
);
CREATE TABLE Treatments (
treatment_id INT PRIMARY KEY,
pet_id INT,
vet_id INT,
date DATE,
description TEXT,
FOREIGN KEY (pet_id) REFERENCES Pets(pet_id),
FOREIGN KEY (vet_id) REFERENCES Vets(vet_id)
);
CREATE TABLE Staff (
staff_id INT PRIMARY KEY,
name VARCHAR(100),
role VARCHAR(50)
);
CREATE TABLE PetSupplies (
supply_id INT PRIMARY KEY,
name VARCHAR(100),
description TEXT,
price DECIMAL(10,2)
);
CREATE TABLE SalesRecords (
sale_id INT PRIMARY KEY,
customer_id INT,
supply_id INT,
date DATE,
quantity INT,
FOREIGN KEY (customer_id) REFERENCES Customers(customer_id),
FOREIGN KEY (supply_id) REFERENCES PetSupplies(supply_id)
);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions