We read your photo as:
Write a SQL query to find the names and surnames of all doctors who prescribed the medication with CodeSS: MEBENDAZOL224.
Computer Science
ScanSolve AI Answer
Step-by-step solution
4 stepsIdentify the tables needed.
To find doctors who prescribed a specific medication, we need information from the
DOCTOR,CONSULTATION, andPRESCRIPTIONtables. ThePRESCRIPTIONtable linksCONSULTATION(and thusDOCTOR) toMEDICATIONviaCodeSS.Join the tables.
We will join
DOCTORwithCONSULTATIONusingMatricle, andCONSULTATIONwithPRESCRIPTIONusingConsulNo.Filter by medication
CodeSS.We will filter the results where
CodeSSin thePRESCRIPTIONtable matches 'MEBENDAZOL224'.Select distinct doctor names.
To avoid listing the same doctor multiple times if they prescribed the medication more than once, we use
DISTINCT.- The SQL query to list all the doctors who prescribed the medication with
codeSS: MEBENDAZOL224 is:
SELECT DISTINCT D.Name, D.Surname FROM DOCTOR D JOIN CONSULTATION C ON D.Matricle = C.Matricle JOIN PRESCRIPTION P ON C.ConsulNo = P.ConsulNo WHERE P.CodeSS = 'MEBENDAZOL224';- The SQL query to list all the doctors who prescribed the medication with
Was this helpful?
Still stuck on this one?
Ask a follow-up, and the answer starts from this question.
Got a different question?Ask your own question
More Computer Science Questions
QList different prescriptions of drugsQWrite SQL queries for the following: display all employees in the IT department, total salary in HR…QWrite a SQL query to increase the salaries of employees in the 'Engineering' department by 5000.QCalculate the correct dosage in tablets or capsules for the given medication orders.QCalculate the overall dispensing adherence rate based on the provided data and the number of…
Browse by topic:SQL