Execute sql queries, Database Management System

Assignment Help:

Consider the relations described below:
PHYSICIAN (regno, name, telno, city)
PATIENT (pname, street, city)
VISIT (pname, regno, date_of_visit, fee)
Where the regno and pname identify the physician and the patient uniquely corresponding. Express queries (i) to (iii) in SQL.
(i) Get the name and regno of physicians who are in Delhi.
(ii) Find out the name and city of patient(s) who visited a physician on 31 August 2004.
(iii) Get the name of the physician and the total number of patients who have visited her.
(iv) What does the subsequent SQL query answer
SELECT DISTINCT name
FROM PHYSICIAN P
WHERE NOT EXISTS
( SELECT *
FROM VISIT
WHERE regno = p.regno )

(i) Select name, regno from PHYSICIAN where city = ‘Delhi';
(ii) Select pname, city from PATIENT,VISIT where PATIENT.pname=VISIT.pname and date_of_visit = '31-Aug-04';
(iii) select name, count(*) from PHYSICIAN, VISIT where PHYSICIAN.regno = VISIT.regno group by Physician . regno;
(iv) This will provide the name of physicians who have not visited any patient.


Related Discussions:- Execute sql queries

What are the reasons for having variable length records, What are the reaso...

What are the reasons for having variable length records? What are the various ways to store variable length records? Variable-length records arise in a database in various wa

Explain p command in the respect of qbe, Explain P command in the respect o...

Explain P command in the respect of QBE? P: It is the command in which is used to print (logically display) the value of the attribute in whose cell it is writ

Project, the of super market system done in database

the of super market system done in database

Functional dependencies and normalization for relational dat, Consider the ...

Consider the 1ollowin8 relation: CAR SALE (Car_id, Option_type, Option_listprice, Sale_date, Option_discountedprice) This relation refers to options installed in cars (e.g., crui

DW, #ques Define a job scheduling strategy that will meet business requirem...

#ques Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a p

Mysql database merge, MySQL Database Merge Project Description: I hav...

MySQL Database Merge Project Description: I have two databases, I need merge the data of one database into another Work to be done online right now. Payment can be done

Database project- inventory database for a hardware store, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Explain the dependency relationship of object oriented, Explain the depende...

Explain the dependency relationship of object oriented A dependency is a relationship which states that a change in specification of one thing can affect another thing, but n

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd