COMP 266 Lecture Notes - Lecture 1: Foreign Key, Unique Key, Oracle Database

43 views2 pages
Question: Consider the following relations:
Patients (pid, ...
Bookmark
Show transcribed image text
Expert Answer
ď‚·
praveenkumar answered this
Was this answer helpful?
0
0
802 answers
According to the above relations I just giving the table creation quesries by putting only
one connection i.e. foreign key relation between patients and Nurses relations as those are
the only common column names across all the relations.
1. create table patients(pid number(3),name varchar2(10),address varchar2(20),telephone
number(11),care_centre_id number(5) primary key);
2.create table care_centres(cid number(3), name varchar2(10), location
varchar2(10),nurse_charge_id number(3));
3.create table treatments(tid number(3), patient_id number(3),physician_id
number(3),treatment_name varchar2(10), tdate date);
4.create table nurses(nid number(3),name varchar2(10),care_centre_id number(5),
certificate_type varchar2(10),telephone number(11), salary number(7), FOREIGN
KEY(care_centre_id) REFERENCES patients(care_centre_id));
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents