Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request for different transactions in Vet-Clinic database #5

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

chuaindia
Copy link

In this branch following activities are tested through SQL queries :

  • A column species of type string is added in the "animals" Table. The "schema.sql" file is modified.
  • A new set of data is inserted in the Table. These insertions are added in the "data.sql" file.
  • Inside a transaction, the "animals" Table is updated by setting the species column to unspecified. The change is rolled back.
  • Inside a transaction, the "animals" Table is updated by setting the species column to "digimon" for all animals that have a
    a name ending on mon and the species column to "pokemon" for all animals that don't have species already set.
  • Then all data are deleted and rolled back again.
  • Inside a transaction all animals born after Jan 1st, 2022 are deleted.
  • Savepoints are created. All animal's weight is updated, rolled back, negative weights are made positive,
  • Transaction is committed. All these transactions are added to the "queries.sql" file.
  • SQL queries are written for the following questions:
    How many animals are there?
    How many animals have never tried to escape?
    What is the average weight of animals?
    Who escapes the most, neutered or not neutered animals?
    What is the minimum and maximum weight of each type of animal?
    What is the average number of escape attempts per animal type of those born between 1990 and 2000?
  • All these queries are added to the "queries.sql" file.

All the screenshots are attached below:

https://user-images.githubusercontent.com/106825373/207290119-b500b838-32ec-4262-bf3c-fd4c2cbe07d6.jpg
https://user-images.githubusercontent.com/106825373/207290134-a0800814-84dd-4a0e-8cbc-7f01121c851e.jpg
https://user-images.githubusercontent.com/106825373/207290137-7f72164f-c5fe-4a13-a340-c6eea1d577a7.jpg
https://user-images.githubusercontent.com/106825373/207290142-4584293e-5a5c-45d0-a0c7-04d148b5f283.jpg
https://user-images.githubusercontent.com/106825373/207290144-613cb2ff-dd2e-4a21-9fa7-75fec03fffd6.jpg
https://user-images.githubusercontent.com/106825373/207290148-6dad83e9-47d4-4f5b-afe6-40f3727781ce.jpg
https://user-images.githubusercontent.com/106825373/207290153-22cd0e51-8811-4f8b-ac0e-fd51edc98197.jpg
https://user-images.githubusercontent.com/106825373/207290159-7c409a2c-301d-40a7-8f74-97692f5d917e.jpg
https://user-images.githubusercontent.com/106825373/207290162-2916134c-5c4d-4610-9e49-df8387b8f66e.jpg
https://user-images.githubusercontent.com/106825373/207290165-58602666-d8e2-46a6-b6c0-bccd0eadf536.jpg
https://user-images.githubusercontent.com/106825373/207290170-115e696e-efd2-4885-b753-b2e460bd32db.jpg
https://user-images.githubusercontent.com/106825373/207290173-e0a09cfb-328a-45b1-99dd-0c01a9fc3739.jpg
https://user-images.githubusercontent.com/106825373/207290176-da857154-881a-4961-8365-b946447d9c94.jpg
https://user-images.githubusercontent.com/106825373/207290181-49a4eac1-6de5-4943-be5e-f40878768b8b.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant