coursework-banner

HIM-650 SQL Queries Using Database Schema Assignment

HIM-650 SQL Queries Using Database Schema Assignment

HIM-650 SQL Queries Using Database Schema Assignment

SQL Queries Using Database Schema

CREATE TABLE `doctors` (

`DoctorID` varchar(8) NOT NULL,

`Name` varchar(6) DEFAULT NULL,

`MedLicenseNumber` varchar(16) DEFAULT NULL,

`Phone` varchar(10) DEFAULT NULL,

`Deleted_Date` varchar(12) DEFAULT NULL, PRIMARY KEY (DoctorID)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

— Dumping data for table `doctors`

 

INSERT INTO `doctors` (`DoctorID`, `Name`, `MedLicenseNumber`, `Phone`, `Deleted_Date`) VALUES

(‘3510’, ‘Ed’, ‘998877’, ‘1245787845’, ”),

(‘4512’, ‘Vic’, ‘885566’, ‘1245786154’, ”),

(‘5513’, ‘Skyler’, ‘558844’, ‘2154847211’, ”),

(‘6514’, ‘Elizabeth’, ‘657789’, ‘3215487811’, ”),

(‘DoctorID’, ‘Name’, ‘MedLicenseNumber’, ‘Phone’, ‘Deleted_Date’);

 

 

CREATE TABLE `medications` (

`MedicationID` int(5) DEFAULT NULL,

`BrandName` varchar(5) DEFAULT NULL,

`GenericName` varchar(8) DEFAULT NULL,

PRIMARY KEY (MedicationID)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

— adding data for table `medications`

Click here to ORDER an A++ paper from our MASTERS and DOCTORATE WRITERS: HIM-650 SQL Queries Using Database Schema Assignment

 

INSERT INTO `medications` (`MedicationID`, `BrandName`, `GenericName`) VALUES

(65487, ‘Fplus’, ‘Platinum’),

(65782, ‘Gplus’, ‘Bronze’),

(65789, ‘ePlus’, ‘Golden’),

(65987, ‘Dplus’, ‘Gear’);

 

 

CREATE TABLE `patients` (

`PatientID` int(4) DEFAULT NULL,

`Name` varchar(5) DEFAULT NULL,

`DoB` varchar(9) DEFAULT NULL,

PRIMARY KEY (PatientID)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

— add sample data for table `patients`

 

INSERT INTO `patients` (`PatientID`, `Name`, `DoB`) VALUES

(1234, ‘Ed’, ’01-Jan-94′),

(1235, ‘Mike’, ’23-Mar-89′),

(1236, ‘Dave’, ’06-Feb-88′),

(1237, ‘Winnie’, ’06-Jun-92′);

 

 

CREATE TABLE `prescriptions` (

`PrescriptionID` varchar(14) DEFAULT NULL,

`Date` varchar(9) DEFAULT NULL,

`PatientID` varchar(9) DEFAULT NULL,

`PrescriberID` varchar(12) DEFAULT NULL,

`MedicationID` varchar(12) DEFAULT NULL,

PRIMARY KEY (PrescriptionID)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

— adding sample data for table `prescriptions`

 

INSERT INTO `prescriptions` (`PrescriptionID`, `Date`, `PatientID`, `PrescriberID`, `MedicationID`) VALUES

(‘2154′, ’13-July-18’, ‘1269’, ‘136897’, ‘14875’),

(‘2580′, ’26-Oct-19’, ‘1234’, ‘123456’, ‘65782’),

(‘2595′, ’18-Nov-18’, ‘1235’, ‘124578’, ‘65789’),

(‘2659′, ’20-June-19’, ‘1236’, ‘102454’, ‘15789’);