Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please draw ER diagram CREATE DATABASE company; USE company; CREATE TABLE patients ( patient_id number(20) PRIMARY KEY, name VARCHAR2(50) NOT NULL, address VARCHAR2(100) NOT NULL,

Please draw ER diagram

CREATE DATABASE company;

USE company;

CREATE TABLE patients ( patient_id number(20) PRIMARY KEY, name VARCHAR2(50) NOT NULL, address VARCHAR2(100) NOT NULL, phone_number VARCHAR2(15) NOT NULL );

CREATE TABLE doctors ( doctor_id number(20) PRIMARY KEY, name VARCHAR(50) NOT NULL, specialty VARCHAR(50) NOT NULL, years_of_experience INT NOT NULL );

CREATE TABLE clinics ( clinic_id number(20) PRIMARY KEY, name VARCHAR(50) NOT NULL, address VARCHAR(100) NOT NULL, phone_number VARCHAR(15) NOT NULL );

CREATE TABLE appointments ( appointment_id number(20) PRIMARY KEY, patient_id number(20) NOT NULL, doctor_id number(20) NOT NULL, clinic_id number(20) NOT NULL, appointment_date DATE NOT NULL, FOREIGN KEY (patient_id) REFERENCES patients(patient_id), FOREIGN KEY (doctor_id) REFERENCES doctors(doctor_id), FOREIGN KEY (clinic_id) REFERENCES clinics(clinic_id) );

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions