Search
 
SCRIPT & CODE EXAMPLE
 

SQL

doctors appointment

-- Table structure for table 'appointment_schedule'
CREATE TABLE IF NOT EXISTS 'appointment_schedule' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'doctors_id' int(11) NOT NULL,
  'working_days' varchar(50) NOT NULL,
  'morning_time_start' time DEFAULT NULL,
  'morning_time_end' time DEFAULT NULL,
  'morning_tokens' int(11) NOT NULL,
  'afternoon_time_start' time DEFAULT NULL,
  'afternoon_time_end' time DEFAULT NULL,
  'afternoon_tokens' int(11) NOT NULL,
  'evening_time_start' time DEFAULT NULL,
  'evening_time_end' time DEFAULT NULL,
  'evening_tokens' int(11) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
-- --------------------------------------------------------
-- Table structure for table 'bookings'
CREATE TABLE IF NOT EXISTS 'bookings' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'doctors_id' int(11) NOT NULL,
  'appointment_schedule_id' int(11) NOT NULL,
  'patients_id' int(11) NOT NULL,
  'diseases_description' text NOT NULL,
  'datetime_start' datetime NOT NULL,
  'datetime_end' datetime NOT NULL,
  'status_id' int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table 'booking_status'
CREATE TABLE IF NOT EXISTS 'booking_status' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'name' varchar(25) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

-- Dumping data for table 'booking_status'    
INSERT INTO 'booking_status' ('id', 'name') VALUES
(1, 'Pending for Approval'),
(2, 'Approved & Booked'),
(3, 'Cancelled by User'),
(4, 'Visited'),
(5, 'User failed to Visit');
-- --------------------------------------------------------
-- Table structure for table 'doctors'
CREATE TABLE IF NOT EXISTS 'doctors' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'name' varchar(50) NOT NULL,
  'specialization_id' int(11) NOT NULL,
  'clinic_name' varchar(50) NOT NULL,
  'address' varchar(1000) NOT NULL,
  'qualification' varchar(50) NOT NULL,
  'rating' int(11) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table 'patients'
CREATE TABLE IF NOT EXISTS 'patients' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'first_name' varchar(50) NOT NULL,
  'last_name' varchar(50) NOT NULL,
  'address' varchar(500) NOT NULL,
  'contact' varchar(100) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------
-- Table structure for table 'specialization'
CREATE TABLE IF NOT EXISTS 'specialization' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'name' varchar(100) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Comment

doctors appointment

-- Table structure for table 'appointment_schedule'
CREATE TABLE IF NOT EXISTS 'appointment_schedule' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'doctors_id' int(11) NOT NULL,
  'working_days' varchar(50) NOT NULL,
  'morning_time_start' time DEFAULT NULL,
  'morning_time_end' time DEFAULT NULL,
  'morning_tokens' int(11) NOT NULL,
  'afternoon_time_start' time DEFAULT NULL,
  'afternoon_time_end' time DEFAULT NULL,
  'afternoon_tokens' int(11) NOT NULL,
  'evening_time_start' time DEFAULT NULL,
  'evening_time_end' time DEFAULT NULL,
  'evening_tokens' int(11) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
-- --------------------------------------------------------
-- Table structure for table 'bookings'
CREATE TABLE IF NOT EXISTS 'bookings' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'doctors_id' int(11) NOT NULL,
  'appointment_schedule_id' int(11) NOT NULL,
  'patients_id' int(11) NOT NULL,
  'diseases_description' text NOT NULL,
  'datetime_start' datetime NOT NULL,
  'datetime_end' datetime NOT NULL,
  'status_id' int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table 'booking_status'
CREATE TABLE IF NOT EXISTS 'booking_status' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'name' varchar(25) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

-- Dumping data for table 'booking_status'    
INSERT INTO 'booking_status' ('id', 'name') VALUES
(1, 'Pending for Approval'),
(2, 'Approved & Booked'),
(3, 'Cancelled by User'),
(4, 'Visited'),
(5, 'User failed to Visit');
-- --------------------------------------------------------
-- Table structure for table 'doctors'
CREATE TABLE IF NOT EXISTS 'doctors' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'name' varchar(50) NOT NULL,
  'specialization_id' int(11) NOT NULL,
  'clinic_name' varchar(50) NOT NULL,
  'address' varchar(1000) NOT NULL,
  'qualification' varchar(50) NOT NULL,
  'rating' int(11) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table 'patients'
CREATE TABLE IF NOT EXISTS 'patients' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'first_name' varchar(50) NOT NULL,
  'last_name' varchar(50) NOT NULL,
  'address' varchar(500) NOT NULL,
  'contact' varchar(100) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------
-- Table structure for table 'specialization'
CREATE TABLE IF NOT EXISTS 'specialization' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'name' varchar(100) NOT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql error 1452 
Sql :: sql transaction 
Sql :: 3rd height salary sql 
Sql :: load a log file in that format into MySQL 
Sql :: sql insert all 
Sql :: stuff and replace in sql 
Sql :: sql selet 
Sql :: select sql 
Sql :: is firebase nosql 
Sql :: where keyword sql 
Sql :: sql from 
Sql :: select from table and insert into table in sql 
Sql :: sql query examples 
Sql :: delete from where sql 
Sql :: drop all tables db2 
Sql :: accessing varchar array from sql 
Sql :: delete from table and truncate table 
Sql :: how to order result of subquery in select 
Sql :: mysql remote connection macos 
Sql :: SQL ANY and ALL Operators 
Sql :: TSQL Find csv file in folder 
Sql :: parent: [Error: SQLITE_READONLY: attempt to write a readonly database] { 
Sql :: convert sql to linq online converter 
Sql :: postgresql check if role exists 
Sql :: oracle alter database open restricted session 
Sql :: postgresql copy backup table 
Sql :: PL SQL Adding elements to VARRAY from a cursor 
Sql :: mysql pv progres 
Sql :: vbscript create ADODB.Connection 
Sql :: group_concat only returns one row 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =