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

Update operations, The Update Operations : Update operations are used fo...

The Update Operations : Update operations are used for altering database values. The constraint violations faced by this operation are logically the similar as the problem faced

Explain the term- event, Event Occurrence of a process is called event...

Event Occurrence of a process is called event. In other words, the object can receive many input instructions. The changes which occur due to these instructions are known as e

aggregate functions-data manipulation language, Aggregate functions ...

Aggregate functions Some of these functions are min, count, max, and avg. These functions help in getting consolidated information from a set of tuples. Example:

The maximum no of key fields that can be used in a header, The Maximum no o...

The Maximum no of key fields that can be used in a header is?? 50

Identify the candidate keys, Consider the following six relation schemes an...

Consider the following six relation schemes and their corresponding sets of functional dependencies. In each case identify a. All the candidate keys b. The highest normal for

Parallelism of transaction execution-data fragmentation, Parallelism of tra...

Parallelism of transaction execution: A transaction can be divided into various sub-queries that can operate on fragments in parallel. This enhances the degree of concurrency in t

What is average response time, What is average response time? The avera...

What is average response time? The average response time is that the average time for a transaction to be done after it has been submitted.

Define a property that is not a property of transactions, Define a property...

Define a property that is not a property of transactions? Ans: Concurrency is not a property of transactions

What is a database, What is a Database? To know what database is, we ha...

What is a Database? To know what database is, we have to start from data, which is the basic building block of any DBMS. Data: Facts, figures, statistics etc. having no pa

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