0% found this document useful (0 votes)
377 views2 pages

Hospital Database: Create The Table Patient

The document describes creating a hospital database with 4 tables: patient, doctor, attend, and admitted. It includes the code to create each table with the appropriate fields, as well as code examples to insert values into each table and retrieve data from each table.

Uploaded by

Purnendu Sahoo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
377 views2 pages

Hospital Database: Create The Table Patient

The document describes creating a hospital database with 4 tables: patient, doctor, attend, and admitted. It includes the code to create each table with the appropriate fields, as well as code examples to insert values into each table and retrieve data from each table.

Uploaded by

Purnendu Sahoo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

HOSPITAL DATABASE

There are four tables in the database as follows


1) patient (p_id, p_name, age, p_add)
2) doctor(d_id , d_name , d_add)
3) attend (d_id, p_id)
4) admitted(p-id, d_o_a)
Create the table Patient
SQL> create table patient
(p_id varchar2(20),
p_name varchar2(20),
age number(3),
p_add varchar2(20));
Create the table Doctor
SQL> create table doctor
(d_id varchar2(20),
d_name varchar2(20),
d_add varchar2(20));
Create the table Attend
SQL> create table attend
(d_id varchar2(20),
p_id varchar2(20));

Create the table Admitted


SQL> create table admitted
(p_id varchar2(20),
d_o_a date);
Insert The Values Into Patient Table
SQL> insert into patient values
(‘&p_id’,’&p_name’,&age,’&p_add’);
Insert The Values Into Doctor Table

SQL> insert into doctor values


(‘&d_id’,’&d_name’,’&d_add’);

Insert The Values Into Attend Table


SQL> insert into attend values
(‘&d_id’,’&p_id’);
Insert The Values Into Admitted Table
SQL> insert into attend values
(’&p_id’,&d_o_a);
Show The details Of Patient Table
SQL> select * from patient;
Show The details Of Doctor Table
SQL> select * from patient;
Show The details Of Attend Table
SQL> select * from attend;
Show The details Of Admitted Table
SQL> select * from admitted;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy