diff --git a/MIT.md b/MIT.md
new file mode 100644
index 0000000..97f904b
--- /dev/null
+++ b/MIT.md
@@ -0,0 +1,10 @@
+## Copyright 2021, [YOUR NAME]
+
+###### Please delete this line and the next one
+###### APP TYPE can be a webpage/website, a web app, a software and so on
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this [APP TYPE] and associated documentation files, to deal in the [APP TYPE] without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the [APP TYPE], and to permit persons to whom the [APP TYPE] is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the [APP TYPE].
+
+THE [APP TYPE] IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE [APP TYPE] OR THE USE OR OTHER DEALINGS IN THE [APP TYPE].
diff --git a/README.md b/README.md
index 2fb2458..3545c3d 100644
--- a/README.md
+++ b/README.md
@@ -1,48 +1,298 @@
-# curriculum-databases-projects-template
+
-> This template should be used for database related projects at Microverse.
-> Generate your own repository, update this README and edit all files content while working on projects. You should not be adding any new files unless asked otherwise.
+
-- Use [schema.sql](./schema.sql) to create all tables.
-- Use [data.sql](./data.sql) to populate tables with sample data.
-- Check [queries.sql](./queries.sql) for examples of queries that can be run on a newly created database. **Important note: this file might include queries that make changes in the database (e.g., remove records). Use them responsibly!**
+
+
+

+
+
Microverse README Template
-## Authors
+
-👤 **Author1**
+
-- GitHub: [@githubhandle](https://github.com/githubhandle)
-- Twitter: [@twitterhandle](https://twitter.com/twitterhandle)
-- LinkedIn: [LinkedIn](https://linkedin.com/in/linkedinhandle)
+# 📗 Table of Contents
-👤 **Author2**
+- [📖 About the Project](#about-project)
+ - [🛠 Built With](#built-with)
+ - [Tech Stack](#tech-stack)
+ - [Key Features](#key-features)
+ - [🚀 Live Demo](#live-demo)
+- [💻 Getting Started](#getting-started)
+ - [Setup](#setup)
+ - [Prerequisites](#prerequisites)
+ - [Install](#install)
+ - [Usage](#usage)
+ - [Run tests](#run-tests)
+ - [Deployment](#triangular_flag_on_post-deployment)
+- [👥 Authors](#authors)
+- [🔭 Future Features](#future-features)
+- [🤝 Contributing](#contributing)
+- [⭐️ Show your support](#support)
+- [🙏 Acknowledgements](#acknowledgements)
+- [❓ FAQ](#faq)
+- [📝 License](#license)
-- GitHub: [@githubhandle](https://github.com/githubhandle)
-- Twitter: [@twitterhandle](https://twitter.com/twitterhandle)
-- LinkedIn: [LinkedIn](https://linkedin.com/in/linkedinhandle)
+
-## 🤝 Contributing
+# 📖 [curriculum-databases-projects-template]
+
+> Curriculum-databases-projects-template is a project showing data of animals in a vet-clinic. Different queries can be made using SQL commands. In this branch more new tables,data are added.Queries are made utilising JOIN. Many to many relationships are established. Different queries are made utilising different types of JOIN.
+Indexing is done in this branch.
+
+**[curriculum-databases-projects-template]** is a is a project showing data of animals in a vet-clinic. Different queries can be made using SQL commands.
+
+## 🛠 Built With
+
+### Tech Stack
+
+> Describe the tech stack and include only the relevant sections that apply to your project.
+
+
+ Client
+
+
+
+
+ Server
+
+
+
+
+Database
+
+
+
+
+
+### Key Features
+
+> Describe between 1-3 key features of the application.
+
+[Creation of Table with data]
+
+[Query made in the Table]
+
+[Indexing to upgrade the execution time]
+
+- **[Creation of Table with data]**
+- **[Query made in the Table]**
+- **[Indexing to upgrade the execution time]**
+
+(back to top)
+
+
+
+## 🚀 Live Demo
+
+> Add a link to your deployed project.
+
+- [Live Demo Link](https://yourdeployedapplicationlink.com)
+
+(back to top)
+
+
+
+## 💻 Getting Started
+
+> This repository includes 3 files with plain SQL that can be used to recreate a database:
+
+- schema.sql which creates all tables.
+- data.sql to populate tables with sample data.
+- queries.sql for examples of queries that can be run on a newly created
+ database using JOIN.
+
+### Prerequisites
+
+In order to run this project you need: PgAdmin4 GUI
+
+
+
+### Setup
+
+Clone this repository to your desired folder.
+
+
+
+### Install
+
+Install this project with: PgAdmin4
+
+
+
+### Usage
+
+To run the project, execute the
+Query made in PgAdmin4 Query window.
+
+
+
+### Run tests
+
+To run tests, run the following command:
+
+
+
+### Deployment
+
+You can deploy this project using: Netflix
+
+
+
+(back to top)
+
+
+
+## 👥 Authors
+
+> Mention all of the collaborators of this project.
+
+👤 **Tanusri Ghosh**
+
+
+- GitHub: https://github.com/chuaindia)
+- Twitter: https://twitter.com/chuaghosh@
+- LinkedIn:https://linkedin.com/in/tanusrighosh
+
+👤 **Abdulai Samuel Moiwa**
+
+- GitHub: [@githubhandle](https://github.com/samuelmoiwa)
+- Twitter: [@twitterhandle](https://twitter.com/samuelmoiwa)
+- LinkedIn: [LinkedIn](https://www.linkedin.com/in/ing-abdulai-samuel-moiwa-726340142/)
+
+
+(back to top)
+
+
+
+## 🔭 Future Features
+
+> Describe 1 - 3 features you will add to the project.
+
+- [ ] **[Addition of new column]**
+- [ ] **[Addition of More data]**
+- [ ] **[Indexing]**
+
+(back to top)
+
+
+
+## 🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](../../issues/).
-## Show your support
+(back to top)
+
+
+
+## ⭐️ Show your support
+
+> Write a message to encourage readers to support your project
+
+If you like this project...
+
+(back to top)
+
+
+
+## 🙏 Acknowledgments
+
+> Give credit to everyone who inspired your codebase.
+
+I would like to thank...
+
+(back to top)
+
+
+
+## ❓ FAQ
+
+> Add at least 2 questions new developers would ask when they decide to use your project.
+
+- **[How a table can be created ?]**
+
+ - [With CREATE TABLE TABLENAME command]
+
+- **[How all data canbe fetched from a table?]**
+
+ - [With SELECT * FROM TABLE TABLENAME command.]
+
+(back to top)
-Give a ⭐️ if you like this project!
+
-## Acknowledgments
+## 📝 License
-- Hat tip to anyone whose code was used
-- Inspiration
-- etc
+This project is [MIT](./LICENSE) licensed.
-## 📝 License
+_NOTE: we recommend using the [MIT license](https://choosealicense.com/licenses/mit/) - you can set it up quickly by [using templates available on GitHub](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-license-to-a-repository). You can also use [any other license](https://choosealicense.com/licenses/) if you wish._
-This project is [MIT](./MIT.md) licensed.
+(back to top)
diff --git a/app_screenshot.png b/app_screenshot.png
new file mode 100644
index 0000000..3b58bcb
Binary files /dev/null and b/app_screenshot.png differ
diff --git a/data.sql b/data.sql
index c31ec67..bced80b 100644
--- a/data.sql
+++ b/data.sql
@@ -1,5 +1,120 @@
/* Populate database with sample data. */
-INSERT INTO animals (name) VALUES ('Luna');
-INSERT INTO animals (name) VALUES ('Daisy');
-INSERT INTO animals (name) VALUES ('Charlie');
+INSERT INTO animals (name, date_of_birth, escape_attempts, neutered, weight_kg) VALUES
+ ('Agumon', '02-03-2020', 0, 'True', 10.23),
+ ('Gabumon', '11-15-2018', 2, 'True', 8),
+ ('Pikachu', '01-07-2021', 1, 'False', 15.04),
+ ('Devimon', '05-12-2017', 5, 'True', 11);
+
+/* Day2 */
+
+INSERT INTO animals (name, date_of_birth, escape_attempts, neutered, weight_kg) VALUES
+ ('Charmander', '02-08-2020', 0, 'False', -11),
+ ('Plantmon', '11-15-2021', 2, 'True', -5.7),
+ ('Squirtle', '04-02-1993', 3, 'False', -12.13),
+ ('Angemon', '06-12-2005', 1, 'True', -45),
+ ('Boarmon', '06-07-2005', 7, 'True', 20.4),
+ ('Blossom', '10-13-1998', 3, 'True', 17),
+ ('Ditto', '05-14-2022', 4, 'True', 22);
+
+/* Day3 */
+
+INSERT INTO owners (full_name, age)
+VALUES
+('Sam Smith', 34),
+('Jennifer Orwell', 19),
+('Bob', 45),
+('Melody Pond', 77),
+('Dean Winchester', 14),
+('Jodie Whittaker', 38);
+
+INSERT INTO species (name)
+VALUES
+('Pokemon'),
+('Digimon');
+
+UPDATE animals SET species_id = 1 WHERE name LIKE '%mon';
+UPDATE animals SET species_id = 2 WHERE name NOT LIKE '%mon';
+
+UPDATE animals SET owner_id = 1 WHERE name IN ('Agumon');
+UPDATE animals SET owner_id = 2 WHERE name IN ('Gabumon','Pikachu');
+UPDATE animals SET owner_id = 3 WHERE name IN ('Devimon','Plantmon');
+UPDATE animals SET owner_id = 4 WHERE name IN ('Charmander','Squirtle','Blossom');
+UPDATE animals SET owner_id = 5 WHERE name IN ('Angemon','Boarmon');
+
+/* Day 4 */
+
+INSERT INTO vets (name, age, date_of_graduation) VALUES
+('William Tatcher', 45, '04-23-2000'),
+('Maisy Smith', 26, '01-17-2019'),
+('Stephanie Mendez', 64, '05-04-1981'),
+('Jack Harkness', 38, '06-08-2008');
+
+INSERT INTO specializations (vets_id, species_id) VALUES
+(1, 1),
+(3, 2),
+(3, 1),
+(4, 2);
+
+INSERT INTO visits (animals_id, vets_id, date_of_visit) VALUES
+(1, 1, '05-24-2020'),
+(1, 3, '07-22-2020'),
+(2, 4, '02-02-2021'),
+(3, 2, '01-05-2020'),
+(3, 2, '03-08-2020'),
+(3, 2, '05-14-2020'),
+(4, 3, '05-04-2021'),
+(5, 4, '02-24-2021'),
+(6, 2, '12-21-2019'),
+(6, 1, '08-10-2020'),
+(6, 2, '04-07-2021'),
+(7, 3, '09-29-2019'),
+(8, 4, '10-03-2020'),
+(8, 4, '11-04-2020'),
+(9, 2, '01-24-2019'),
+(9, 2, '05-15-2019'),
+(9, 2, '02-27-2020'),
+(9, 2, '08-03-2020'),
+(10, 3, '05-24-2020'),
+(10, 1, '01-11-2021');
+
+
+/* day 5, 2nd week -- Pair Programming */
+
+
+-- This will add 3.594.280 visits considering you have 10 animals, 4 vets, and it will use around ~87.000 timestamps (~4min approx.)
+INSERT INTO visits (animal_id, vet_id, date_of_visit) SELECT * FROM (SELECT id FROM animals) animal_ids, (SELECT id FROM vets) vets_ids, generate_series('1980-01-01'::timestamp, '2021-01-01', '4 hours') visit_timestamp;
+
+-- This will add 2.500.000 owners with full_name = 'Owner ' and email = 'owner_@email.com' (~2min approx.)
+insert into owners (full_name, email) select 'Owner ' || generate_series(1,2500000), 'owner_' || generate_series(1,2500000) || '@mail.com';
+
+/* Execution Time 216.905 ms */
+
+
+-- This will add 3.594.280 visits considering you have 10 animals, 4 vets, and it will use around ~87.000 timestamps (~4min approx.)
+INSERT INTO visits (animal_id, vet_id, date_of_visit) SELECT * FROM (SELECT id FROM animals) animal_ids, (SELECT id FROM vets) vets_ids, generate_series('1980-01-01'::timestamp, '2021-01-01', '4 hours') visit_timestamp;
+
+-- This will add 2.500.000 owners with full_name = 'Owner ' and email = 'owner_@email.com' (~2min approx.)
+insert into owners (full_name, email) select 'Owner ' || generate_series(1,2500000), 'owner_' || generate_series(1,2500000) || '@mail.com';
+
+/* Execution Time 435.957 ms */
+
+
+-- This will add 3.594.280 visits considering you have 10 animals, 4 vets, and it will use around ~87.000 timestamps (~4min approx.)
+INSERT INTO visits (animal_id, vet_id, date_of_visit) SELECT * FROM (SELECT id FROM animals) animal_ids, (SELECT id FROM vets) vets_ids, generate_series('1980-01-01'::timestamp, '2021-01-01', '4 hours') visit_timestamp;
+
+-- This will add 2.500.000 owners with full_name = 'Owner ' and email = 'owner_@email.com' (~2min approx.)
+insert into owners (full_name, email) select 'Owner ' || generate_series(1,2500000), 'owner_' || generate_series(1,2500000) || '@mail.com';
+
+
+/* Execution Time 654.253 ms */
+
+-- This will add 3.594.280 visits considering you have 10 animals, 4 vets, and it will use around ~87.000 timestamps (~4min approx.)
+INSERT INTO visits (animal_id, vet_id, date_of_visit) SELECT * FROM (SELECT id FROM animals) animal_ids, (SELECT id FROM vets) vets_ids, generate_series('1980-01-01'::timestamp, '2021-01-01', '4 hours') visit_timestamp;
+
+-- This will add 2.500.000 owners with full_name = 'Owner ' and email = 'owner_@email.com' (~2min approx.)
+insert into owners (full_name, email) select 'Owner ' || generate_series(1,2500000), 'owner_' || generate_series(1,2500000) || '@mail.com';
+
+
+/* Execution Time 1009.139 ms */
+
diff --git a/murple_logo.png b/murple_logo.png
new file mode 100644
index 0000000..4bbcfb6
Binary files /dev/null and b/murple_logo.png differ
diff --git a/queries.sql b/queries.sql
index 9624b62..1a04142 100644
--- a/queries.sql
+++ b/queries.sql
@@ -1,3 +1,195 @@
/*Queries that provide answers to the questions from all projects.*/
-SELECT * from animals WHERE name = 'Luna';
+SELECT * from animals WHERE name = '%mon';
+SELECT * FROM animals WHERE date_of_birth BETWEEN '2016-01-01' AND '2019-12-31';
+SELECT * FROM animals WHERE neutered='True' AND escape_attempts<3;
+SELECT date_of_birth FROM animals WHERE name IN ('Agumon','Pikachu');
+SELECT name, escape_attempts FROM animals WHERE weight_kg>10.5;
+SELECT * FROM animals WHERE neutered='True';
+SELECT * FROM animals WHERE name NOT IN ('Gabumon');
+SELECT * FROM animals WHERE weight_kg BETWEEN 10.4 AND 17.3;
+
+/* Day 2 */
+
+/* Transaction 1 */
+
+BEGIN;
+
+UPDATE animals SET species='unspecified';
+
+SELECT species FROM animals;
+ROLLBACK;
+
+SELECT species FROM animals;
+
+UPDATE animals SET species='digimon' WHERE name LIKE '%mon';
+UPDATE animals SET species='pokemon' WHERE species NOT LIKE '%mon';
+
+COMMIT;
+
+SELECT * FROM animals;
+
+/* Transaction 2 */
+
+BEGIN;
+
+DELETE FROM animals;
+
+ROLLBACK;
+
+/* Transaction 3 */
+
+BEGIN;
+
+SAVEPOINT SP1;
+
+DELETE FROM animals WHERE date_of_birth > '2022-01-01';
+
+SAVEPOINT SP2;
+
+UPDATE animals SET weight_kg = weight_kg * -1;
+
+ROLLBACK TO SP2;
+
+UPDATE animals SET weight_kg = weight_kg * -1 WHERE weight_kg < 0;
+
+COMMIT;
+
+SELECT * FROM animals;
+
+/* Answer of the Questions */
+
+SELECT COUNT(*) FROM animals;
+SELECT COUNT(*) FROM animals WHERE escape_attempts = 0;
+SELECT AVG(weight_kg) FROM animals;
+SELECT neutered, MAX(escape_attempts) FROM animals GROUP BY neutered;
+SELECT species, MIN(weight_kg) as Minimum, MAX(weight_kg) as Maximum FROM animals GROUP BY species;
+SELECT AVG(escape_attempts) FROM animals WHERE date_of_birth BETWEEN '1990-01-01' AND '2000-12-31' GROUP BY species;
+
+
+/* Day3 */
+
+SELECT name FROM animals
+JOIN owners ON owners.id = animals.owner_id
+WHERE owners.full_name = 'Melody Pond';
+
+SELECT animals.name FROM animals
+JOIN species ON species.id = animals.species_id
+WHERE species.name = 'Pokemon';
+
+SELECT name AS name_of_animals, full_name AS name_of_owners FROM owners
+LEFT JOIN animals ON owners.id = animals.owner_id;
+
+SELECT species.name, COUNT(*) FROM animals
+LEFT JOIN species ON species.id = animals.species_id
+GROUP BY species.name;
+
+SELECT animals.name FROM animals
+JOIN species ON species.id = animals.species_id
+JOIN owners ON owners.id = animals.owner_id
+WHERE species.name = 'Digimon' AND owners.full_name = 'Jennifer Orwell' ;
+
+SELECT name FROM animals
+JOIN owners ON owners.id = animals.owner_id
+WHERE owners.full_name = 'Dean Winchester' AND animals.escape_attempts = 0;
+
+SELECT full_name, COUNT(full_name) AS maximum FROM animals
+JOIN owners ON owners.id = animals.owner_id
+GROUP BY owners.full_name
+ORDER BY maximum
+DESC LIMIT 1;
+
+
+/* Day 4 */
+
+SELECT animals.name FROM visits
+JOIN animals on animals.id = visits.animals_id
+JOIN vets on vets.id = visits.vets_id
+WHERE vets.name = 'William Tatcher'
+ORDER BY date_of_visit
+DESC LIMIT 1;
+
+SELECT vets.name, COUNT(*) FROM visits
+JOIN animals on animals.id = visits.animals_id
+JOIN vets on vets.id = visits.vets_id
+WHERE vets.name = 'Stephanie Mendez'
+GROUP BY vets.name;
+
+SELECT vets.name, species.name FROM vets
+LEFT JOIN specializations on vets.id = specializations.vets_id
+LEFT JOIN species on species.id = specializations.species_id;
+
+SELECT animals.name FROM visits
+JOIN vets on vets.id = visits.vets_id
+JOIN animals on animals.id = visits.animals_id
+WHERE vets.name = 'Stephanie Mendez'
+AND date_of_visit BETWEEN '04-01-2020' AND '08-30-2020';
+
+SELECT animals.name, COUNT(*) AS number_of_visits FROM visits
+JOIN vets on vets.id = visits.vets_id
+JOIN animals on animals.id = visits.animals_id
+GROUP BY animals.name
+ORDER BY number_of_visits
+DESC LIMIT 1;
+
+SELECT animals.name FROM visits
+JOIN vets on vets.id = visits.vets_id
+JOIN animals on animals.id = visits.animals_id
+WHERE vets.name = 'Maisy Smith'
+ORDER BY date_of_visit
+LIMIT 1;
+
+SELECT animals.name, vets.name, date_of_visit FROM visits
+JOIN vets on vets.id = visits.vets_id
+JOIN animals on animals.id = visits.animals_id
+ORDER BY date_of_visit
+DESC LIMIT 1;
+
+SELECT COUNT(*) FROM vets
+LEFT JOIN visits on vets.id = visits.vets_id
+LEFT JOIN specializations on vets.id = specializations.vets_id
+LEFT JOIN species on species.id = specializations.species_id
+WHERE species.name is NULL;
+
+SELECT species.name, COUNT(*) FROM visits
+JOIN vets on vets.id = visits.vets_id
+JOIN animals on animals.id = visits.animals_id
+JOIN species on species.id = animals.species_id
+WHERE vets.name = 'Maisy Smith'
+GROUP BY species.name
+LIMIT 1;
+
+
+/* day 5, 2nd week -- Pair Programming */
+
+explain analyze SELECT COUNT(*) FROM visits where animal_id = 4;
+
+/* Execution Time 216.905 ms */
+
+
+explain analyze SELECT COUNT(*) FROM visits where animal_id = 4;
+
+/* Execution Time 435.957 ms */
+
+explain analyze SELECT COUNT(*) FROM visits where animal_id = 4;
+
+/* Execution Time 654.253 ms */
+
+explain analyze SELECT COUNT(*) FROM visits where animal_id = 4;
+
+/* Execution Time 1009.139 ms */
+
+EXPLAIN ANALYZE SELECT * FROM visits where vet_id = 2;
+
+/* Execution Time 2085.938 ms */
+
+EXPLAIN ANALYZE SELECT * FROM owners where email = 'owner_18327@mail.com';
+
+/* Execution Time 814.106 ms */
+
+
+
+
+
+
+
diff --git a/schema.sql b/schema.sql
index bddf2cd..fc3ea7f 100644
--- a/schema.sql
+++ b/schema.sql
@@ -1,5 +1,70 @@
/* Database schema to keep the structure of entire database. */
-CREATE TABLE animals (
- name varchar(100)
+CREATE TABLE animals(
+ id integer NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(100), date_of_birth date, escape_attempts integer,
+ neutered boolean, weight_kg decimal);
+
+/* Day2 */
+
+ALTER TABLE animals
+ ADD species varchar(40);
+
+/* Day3 */
+
+CREATE TABLE owners (
+ id SERIAL PRIMARY KEY,
+ full_name varchar(255),
+ age integer
+);
+
+CREATE TABLE species (
+ id SERIAL PRIMARY KEY,
+ name varchar(255)
+);
+
+
+ALTER TABLE animals DROP COLUMN species;
+
+ALTER TABLE animals ADD species_id INTEGER REFERENCES species(id);
+ALTER TABLE animals ADD owner_id INTEGER REFERENCES owners(id);
+
+
+/* Day4 */
+
+CREATE TABLE vets (
+
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(100),
+ age INTEGER,
+ date_of_graduation DATE
);
+
+CREATE TABLE specializations (
+
+ id SERIAL PRIMARY KEY,
+ vets_id INTEGER REFERENCES vets(id) ON DELETE CASCADE,
+ species_id INTEGER REFERENCES species(id) ON DELETE CASCADE
+);
+
+CREATE TABLE visits (
+ vets_id INTEGER REFERENCES vets(id) ON DELETE CASCADE,
+ animals_id INTEGER REFERENCES animals(id) ON DELETE CASCADE,
+ date_of_visit DATE
+);
+
+
+/* day 5, 2nd week -- Pair Programming */
+
+ALTER TABLE owners ADD COLUMN email VARCHAR(120);
+
+/* change COLUMN NAMEs of VISITS Table ------ animals_id to animal_id and vets_id to vet_id */
+
+ALTER TABLE visits RENAME COLUMN animals_id TO animal_id;
+ALTER TABLE visits RENAME COLUMN vets_id TO vet_id;
+
+
+CREATE index ON visits(animal_id);
+
+CREATE index ON visits(vet_id);
+
+CREATE index ON owners(email);
\ No newline at end of file