Question: 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 Install phpMyAdmin by following the steps at the video XAMPP-phpMyAdmin-MySQL-MarinaDB. Now run

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!