SQL Questions
SQL Questions
Registration
Name Registration
no.
s no. Name
s
Buys
From
11
Sex Quantit
yl Med_Nam
Price e
Patient or Buys Pharmacy
Customer From
P_Name P_Registratio
Name n No.
Pa_id P_Ema P_addres
il s
Here we have all the entities have many to many relationships. The reason behind
it is, patient never goes to a single pharmacy for his/her required drugs in life span.
Again pharmacy never depends on a single pharmaceutical company for its supply
of drugs. Same thing happens for pharmaceutical company and raw material
supplier.
4 Email varchar2(20),
Table created.
4 Sex char(5));
Table created.
5 Email varchar2(20),
6 P_email varchar2(20),
Table created.
STRUCTURE OF TABLES
TABLE: CUSTOMER
TABLE: PHARMACY
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
SQL> insert into pharma_co
values('pc1026','rm1016','cdcompny','[email protected]','cd-4,jnagar,delhi');
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
Q1. Display the names of all the raw material suppliers who lives in rohini
NAME
--------------------
rameshsuppliers
seemasuppliers
Q2. Display the names of customers who havnt mentioned their sex
NAME
--------------------
geeta
NAME
--------------------
geeta
Q4. Display the address of the raw material supplier with registration no. rm 1016
ADDRESS
--------------------
Ru-19,rohini,delhi
P_NAME P_REGISTRA
-------------------- ----------
ghpharmacy ph1008
1 row updated.
1 row deleted.
PA_ID
----------
cu1032
Table altered.
Table dropped