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

Related fields in a database are grouped in which form, Related fields in a...

Related fields in a database are grouped in which form? Related data fields in a database are grouped to form a data record. (A record is a collection of related fields)

What are the failures of controlling events between objects, What are the f...

What are the failures of Controlling Events Between Objects  Failure Unintentional termination of system. Several possible causes: failure of system hardware, o

Selective replication-data replication, Selective replication: This is a c...

Selective replication: This is a combination of generating small fragments of relation and replicating them rather than a entire relation. The data should be fragmented on require

Define the term multimedia database, Question : (a) Explain with the h...

Question : (a) Explain with the help of appropriate examples the difference between ‘Data' and ‘Information'. (b) A digital image is an array of pixels, where each pixel h

Remove partial dependancy, , write the relational schema, and draw the new ...

, write the relational schema, and draw the new dependency diagrams. Identify the normal forms for each table structure you created

Horizontal Fragmentation, I want to fragment existing table using java code...

I want to fragment existing table using java code... help me..!!

Designing the database schema , The domain that you will model in this assi...

The domain that you will model in this assignment is that of courses and students at a university. So as not to make the task too large and unspecified, you will here get a descrip

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