-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject_VB.sql
More file actions
36 lines (29 loc) · 826 Bytes
/
Project_VB.sql
File metadata and controls
36 lines (29 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
select * from Doctors;
CREATE TABLE Appointments (
AppointmentID NUMBER PRIMARY KEY,
AppointmentDate DATE DEFAULT SYSDATE,
DependentName VARCHAR2(100),
Specialty VARCHAR2(50),
Doctor VARCHAR2(100),
SlotNo NUMBER
);
GRANT CREATE TABLE, CREATE SEQUENCE TO SYS;
CREATE SEQUENCE appointment_seq
START WITH 1
INCREMENT BY 1
NOCACHE
NOCYCLE;
set serveroutput ON
CREATE OR REPLACE TRIGGER trg_appointments_before_insert
BEFORE INSERT ON Appointments
FOR EACH ROW
BEGIN
SELECT appointment_seq.NEXTVAL
INTO :NEW.AppointmentID
FROM dual;
END;
select * from Schedule;
drop table Appointments;
select * from Appointments;
select * from Users;
insert into Appointments values('9011','26-06-2024','Aniket Sahu','Neurology','Dr. Amit Bhunia',1);