wiki:RelationalDesign

Version 27 (modified by 201063, 19 months ago) ( diff )

--

Логички и физички дизајн

Релациска шема

Релациската шема ја направивме со мапирачка трансформација.

Ознаки Значење
bold not null
underline primary key
* foreign key

Ентитети

User (id_user, date_created_user, name_user, email_user, password_user, telephone_user)

  • user е резервиран збор во PostgreSQL па оваа табела ќе се вика user_table наместо user

Surendee (id_user*(user))

Admin (id_user*(user))

  • admin е резервиран збор во PostgreSQL па оваа табела ќе се вика admin_table наместо admin

Donor (id_user*(user), is_from_organisation)

Organisation (id_organisation, name_organisation, email_organisation, billing_information)

Shelter (id_shelter, address_shelter, telephone_shelter, id_organisation)

  • атрибутот id_organisation ја претставува 1-М релацијата shelter_is_from_organisation

Employee (id_user*(user), position_employee, id_shelter)

  • position е резервиран збор во PostgreSQL па оваа колона ќе се вика position_employee наместо position
  • атрибутот id_shelter ја претставува 1-М релацијата еmployee_works_at_shelter

Adopter (id_user*(user), free_time, funds, has_other_pets, has_kids, housing, physical_activity_adopters, will_foster, is_verified, verified_by_employee)

  • атрибутот verified_by_employee ја претставува 1-М релацијата employee_verifies_adopter

Adoption (id_adoption, start_date, end_date_foster, id_adopter)

  • атрибутот id_adopter ја претставува 1-М релацијата adopters_want_adoptions

Pet (id_pet, url_pet_image, age_group, size_pet, breed, name_pet, species, gender, can_be_fostered, id_adoption, id_shelter)

  • size е резервиран збор во PostgreSQL па оваа колона ќе се вика size_pet наместо size
  • атрибутот id_adoption ја претставува 1-М релацијата adoptions_for_pets
  • атрибутот id_shelter ја претставува 1-М релацијата pet_is_in_shelter

Post (id_post, date_post, url_thumbanail, id_surendee, id_employee)

  • ограничување: Post мора да биде во точно една од релациите surrendees_publishes_and_manages_posts или employee_publishes_and_manages_post, не смее да не биде во ниту една или пак во двете
  • атрибутот id_surendee ја претставува 1-М релацијата surrendees_publishes_and_manages_posts
  • атрибутот id_employee ја претставува 1-М релацијата employee_publishes_and_manages_post

Category (id_category, name_category)

Food (id_food, manufacturer, name_food, type_food)

Therapy (id_therapy, health_problem, start_date, end_date)

VetClinic (id_vet_clinic, telephone_vet_clinic, address_vet_clinic)

Слаби Ентитети

PersonalProfile (id_pet*(pet), friendly_to_kids, friendly_to_pets, attention, physical_activity, grooming_needed)

М-М Релации

donor_donates_to_organisation (id_user*(donor), id_organisation*(organisation))

pet_belongs_to_category (id_pet*(pet), id_category*(category))

pet_needs_therapy (id_pet*(pet), id_therapy*(therapy))

pet_preferably_eats_food (id_pet*(pet), id_food*(food), quantity_a_day)

pet_needs_intervention_in_vet_clinic (id_pet*(pet), id_vet_clinic*(vetClinic), date_of_interventing)

Релациски дијаграм

DML скрипти

  • скрипта за креирање на табелите

kreiranje.sql

  • скрипта за бришење на табелите

brishenje.sql

  • скрипта за полнење на табелите со податоци

polnenje.sql

Назад кон почетна

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.