English

Write the output of SQL queries (a) and (b) based on the following two tables DOCTOR and PATIENT belonging to the same database: Table: DOCTOR DNO D1 D2 D3 D4 DNAME AMITABH ANIKET NIKHIL ANJANA

Advertisements
Advertisements

Question

Write the output of SQL queries (a) and (b) based on the following two tables DOCTOR and PATIENT belonging to the same database:

        Table: DOCTOR

DNO DNAME FEES
D1 AMITABH 1500
D2 ANIKET 1000
D3 NIKHIL 1500
D4 ANJANA 1500

                 Table: PATIENT

PNO PNAME ADMDATE DNO
P1 NOOR 2021-12-25 D1
P2 ANNIE 2021-11-20 D2
P3 PRAKASH 2020-12-1 0 NULL
P4 HARMEET 2019-12-20 D1
  1. SELECT DNAME, PNAME FROM DOCTOR
    NATURAL JOIN PATIENT;
  2. SELECT PNAME, ADMDATE, FEES
    FROM PATIENT P, DOCTOR D
    WHERE D.DNO = P.DNO AND FEES > 1000;
Short Answer
Advertisements

Solution

(a) 

DNAME PNAME
AMITABH NOOR
ANIKET ANNIE
AMITABH HARMEET

(b) 

PNAME ADMDATE FEES
NOOR 2021-12-25 1500
HARMEET 2019-12-20 1500
shaalaa.com
  Is there an error in this question or solution?
2021-2022 (March) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×