Skip to content

Vet clinic database: query and update table#3

Open
Ridwanullahi-code wants to merge 6 commits intodevelopmentfrom
update_query_table
Open

Vet clinic database: query and update table#3
Ridwanullahi-code wants to merge 6 commits intodevelopmentfrom
update_query_table

Conversation

@Ridwanullahi-code
Copy link
Copy Markdown
Owner

@Ridwanullahi-code Ridwanullahi-code commented Mar 2, 2023

  • Add a column species of type string to your animal's table. Could you change your schema.sql file?
  • insert the data into the database
  • Inside a transaction update the animal's table by setting the species column to unspecified. Verify that the change was made. Then roll back the change and verify that the species columns returned to the state before the transaction.
    Update the animals table by setting the species column to digimon for all animals that have a name ending in mon.
  • Update the animals table by setting the species column to pokemon for all animals that don't have species already set.
  • Commit the transaction.
  • Verify that change was made and persists after commit.
  • Write queries to answer 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?
    Take a screenshot of the results of your queries.

query1
query2
query3
query4
query5
query6
query7
query8

Copy link
Copy Markdown

@mukhammadrizooff mukhammadrizooff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ridwanullahi-code,

While you made a great effort in this project, unfortunately, I cannot proceed to review your code.

Invalid Code Review Request

You have submitted a project, please add descriptive informations to all parts of your README 👍🏼

Your Code Review Request will be marked as invalid in your Dashboard, so please submit a new one once you are ready 🙏

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


Invalid Code Review Request does not count into the code reviews limit.

Copy link
Copy Markdown

@Gambit142 Gambit142 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ridwanullahi-code 👋 ,

Good job so far!

Highlights

  • Everything that creates or changes the structure of the tables is in the schema.sql file
  • Everything that populates tables with data is in the data.sql file
  • Everything that is a query that helps to analyze data is in the queries.sql file

There are some issues that you still need to work on to go to the next project but you are almost there!

Required Changes ♻️

Kindly check the comments under the review.

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you take them into account as they can make your code better.

You can also consider:

N/A

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.

Please, remember to tag me in your question so I can receive the notification. You can tag me by typing @Gambit142

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

Comment on lines 136 to 138

This project is [MIT](./LICENSE) licensed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The link to your LICENSE is broken and redirects to GitHub's error page. Kindly fix the LICENSE. You can add a valid LICENSE by following the instructions in this article. 👍 😎

queries.sql Outdated
Comment on lines +44 to +46
BEGIN;
DELETE FROM animals WHERE date_of_birth > '01/07/2022';
SAVEPOINT savepoint_1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This transaction should delete all animals born after Jan 1st, 2022 (01/01/2022) and not the 1st of July 2022(01/07/2022). Kindly correct the error so that the correct number of animals can be deleted. Please, don't forget to update the screenshot attached to your pull request summary 😎 💻

Comment on lines +53 to +55

SELECT COUNT(*) FROM animals;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The total number of animals should be 10 and not 11. By the time you update the transactions that should delete all animals born after 01/01/2022, you would have 10 as the total number of animals. Kindly update the screenshot for this query after the transaction. 👍 💻

Comment on lines +57 to +59

SELECT AVG(weight_kg) FROM animals

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The average weight of animals should be 15.55 and not 16.136363 . By the time you update the transactions that should delete all animals born after 01/01/2022, you would have 15.55 as the average weight of animals. Kindly update the screenshot for this query after the transaction. 👍 💻

queries.sql Outdated
Comment on lines +60 to +61
SELECT name FROM animals
ORDER BY escape_attempts DESC LIMIT 1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This query should return a result that shows who attempts to escape the most classified by the neutered character of the animals. Currently, you have the name of the animals who attempted to escape the most but it should be an analysis of animals based on the neutered character. In the end, your result should look familiar to this:

image

Please remember to update the screenshot when you are done. 👍

Comment on lines +62 to +64

SELECT MIN(weight_kg), MAX(weight_kg) FROM animals GROUP BY(species);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The maximum weight of pokemon animals should be 17 and not 22. By the time you update the transactions that should delete all animals born after 01/01/2022, you would have 17 as the maximum weight of pokemon animals. Kindly update the screenshot for this query after the transaction. 👍 💻

Copy link
Copy Markdown

@jasonfelice jasonfelice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ridwanullahi-code,

Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!

Required Changes ♻️

  • As I can see, you didn't update the queries as requested by the previous reviewer. Please update the queries as per requirement and update the screenshots in the PR description.

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

Copy link
Copy Markdown

@KayLemba KayLemba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[# STATUS: APPROVED 🟢 👏

Hello @Ridwanullahi-code ,
Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉 Keep up the good work 🥂

HIGHLIGHTS:

  • Your repo is professional 😎
  • Descriptive P.R 💯
  • linters are passing
  • Professional README 💯
  • Everything relating to the database is working.

Now you can merge this branch and move on 🥇
Happy Coding cheers 🥇 💯

well-1

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.]]

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.

5 participants