Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Install phpMyAdmin by following the steps at the video XAMPP-phpMyAdmin-MySQL-MarinaDB. Now run the following SQL statements to create two tables and to insert few entries

Install phpMyAdmin by following the steps at the video

XAMPP-phpMyAdmin-MySQL-MarinaDB.

Now run the following SQL statements to create two tables and to insert few entries

Now add one more patient to the table patient with name 'Ellen Hamid' with birth date of '2000-01-01' Now

1- Write a query to list, for every patient, their corresponding visits ( note: for all patients, including the ones who never visited the clinic )

The resulting table must have the following columns:

Name, VisitDate

2- Write a query to list all patients who have visited the clinic more than once

The resulting table must have the following columns:

Name, noOfVisits

3- Write a query to list all patients who visited the clinic at least once before year 2019

The resulting table must have the following columns:

Name, visitDate

Deliverable

All in a pdf file named team#_Patinet_visit.pdf

At top of the pdf file, your names and IDs, then list each question. Underneath each question post the query answer in text then followed by the screenshot of the resulting table.

Rubrics :

Total of 6 points, each question 2 points; 1 for the query in text ( so that it could be copied and pasted to test), one for the screenshot of the result.

-1 deduction for any SQL statement missing or incorrect

-1 deduction for any screenshot missing, or incorrect or with too tiny font

Note: you can use other DB administrative tools such as MySQL WorkBench etc image text in transcribed

CREATE TABLE `patient ( patientid' int(11) NOT NULL, `name` varchar(100) DEFAULT NULL, dateOfBirth datetime NOT NULL, PRIMARY KEY(patientid) ); CREATE TABLE `visit ( visitid' int(11) NOT NULL, patientid' int(11) NOT NULL, visitDate' datetime NOT NULL, PRIMARY KEY(visitid), CONSTRAINT fk_has_patient FOREIGN KEY(patientid) REFERENCES patient(patientid) ); INSERT INTO patient VALUES (1, 'Sara Brown', '1901-01-01'), (2, 'John Smith', '1941-01-01'), (3, 'Jack Ma', '1961-01-30'); INSERT INTO visit VALUES (1, 1, '2002-01-01'), (2, 2, '2018-01-01'), (3, 2, '2019-01-01'), (4, 2, '2020-01-01')

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago