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

ER diagrams, explain exhaustively the problems associated with ER diagrams....

explain exhaustively the problems associated with ER diagrams. include illustrations in your answer

Textbook ordering system, Question: Consider the following database rel...

Question: Consider the following database relations for a textbook ordering system used by a college bookshop: Book (b-copy#, bname, ISBN#, author, price, subject) Order (s#

Information system fundamentals, A full discription of the new, a discripti...

A full discription of the new, a discription of its components, and the bebefit it will provide a company. A disscussion of the information usedin the system. A disscussion of any

Method of analyzing association traversal, Analyzing Association Traversal ...

Analyzing Association Traversal Till now, we have supposed that associations are bi-directional. But in the case of traversal, it is in only one direction in any application,

Define average latency time, Define average latency time. The average l...

Define average latency time. The average latency time of the disk is one-half the time for a full rotation of the disk.

Explain the functions and components of ddbms, Question 1 Explain the conc...

Question 1 Explain the concept of database recovery management. Explain the different levels of backup used for recovering data Question 2 What are the different types of par

Describe the major steps in the implementation process, Question: (a) ...

Question: (a) One of the steps in the five-step problem-solving model is implementation. Implementation is considered a key step in the problem-solving model. A problem may be

Define signal, Define Signal. It allows methods to respond to events tr...

Define Signal. It allows methods to respond to events triggered by themselves or by other processes. Each signal corresponds to an exacting event. A signal is represented in Sy

Illustrate the term- abstracting out common behaviour, Illustrate the term-...

Illustrate the term- Abstracting Out Common Behaviour Inheritance is not every time recognised during analysis phase of development, thus it is necessary to re-evaluate object

Define hash files organization, Define Hash files organization a. Hashi...

Define Hash files organization a. Hashing includes computing the address of a data item by calculating a function on the search key value.   b. A hash function h is a functi

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