RAFT 1 Script Start
-- thses statements will fail the first time you run this script becuase the tables do not yet exist
drop table appointment;
drop table room;
drop table client;
drop table counselor;
create table Counselor(
CounselorID int GENERATED ALWAYS as IDENTITY(START with 100) primary key ,
FirstName varchar(50),
LastName varchar(50),
Address varchar(50),
City varchar(50),
State char(2),
ZIP char(10),
Phone varchar(14),
Email varchar(100)
);
create table Client(
CounselorID int GENERATED ALWAYS as IDENTITY(START with 200) primary key ,
FirstName varchar(50),
LastName varchar(50),
Address varchar(50),
City varchar(50),
State char(2),
ZIP char(10),
Phone varchar(14),
Email varchar(100)
);
create table Room(
RoomNumber int primary key,
RoomName varchar(50)
);
create table Appointment(
AppointmentID int GENERATED ALWAYS as IDENTITY(START with 1000) primary key,
AppointmentTime date,
Duration int
);
/*data for Counselors*/
insert into Counselor(firstname, lastname, address, city, state, zip, phone, email)
values('Quinn','Fowler','5208 Walmsley Blvd','Richmond','VA','23224','(804) 286-4422','qfowler@raftcounseling.com');
insert into Counselor(firstname, lastname, address, city, state, zip, phone, email)
values('Elizabeth','Baker','3409 Irvington St','Richmond','VA','23234','(804) 539-9337','ebaker@raftcounseling.com');
insert into Counselor(firstname, lastname, address, city, state, zip, phone, email)
values('Darold','Cooper','4003 Corbin St','Richmond','VA','23222','(804) 286-4422','dbcooper@raftcounseling.com');
insert into Counselor(firstname, lastname, address, city, state, zip, phone, email)
values('Diana','Chandler','600 Idlewood Ave','Richmond','VA','23220','(804) 737-9704','dchandler@raftcounseling.com');
insert into Counselor(firstname, lastname, address, city, state, zip, phone, email)
values('Phoebe','Wright','707 Old Locke Lane','Richmond','VA','23226','(804) 592-0056','pwright@raftcounseling.com');
/*data for Clients*/
insert into Client(firstname, lastname, address, city, state, zip, phone, email)
values('Randall','Mason','3513 A Grove Ave','Richmond','VA','23221','(804) 612-2961','masonjar27@msn.com');
insert into Client(firstname, lastname, address, city, state, zip, phone, email)
values('Leola','White','1625 W Laburnum Ave','Richmond','VA','23227','(804) 786-0698','thewhitehouse@yahoo.com');
insert into Client(firstname, lastname, address, city, state, zip, phone, email)
values('Tyrone','McSweeney','5717 Campbell Ave','Richmond','VA','23231','(804) 518-7098','Janessa1820@gmail.com');
insert into Client(firstname, lastname, address, city, state, zip, phone, email)
values('Shannon','Fake','3019 E Marshall St','Richmond','VA','23223','(804) 223-8622','therealshannon@gmail.com');
insert into Client(firstname, lastname, address, city, state, zip, phone, email)
values('Yasini','Brothers','205 Wickham St','Richmond','VA','23222','(804) 966-8112','brothersk@me.com');
insert into Client(firstname, lastname, address, city, state, zip, phone, email)
values('Wendi','Overton','915 N 33rd St','Richmond','VA','23223','(804) 649-6464','wendycity99@gmail.com');
insert into Client(firstname, lastname, address, city, state, zip, phone, email)
values('Bessie','Murchison','2918 Edgewood Ave','Richmond','VA','23222','(804) 620-9185','bmurch77@yahoo.com');
/*data for Rooms*/
insert into room(roomnumber, roomName) values(1,'Clear sky');
insert into room(roomnumber, roomName) values(2,'Flowing waters');
insert into room(roomnumber, roomName) values(3,'Calm ocean');
insert into room(roomnumber, roomName) values(4,'Peaceful woods');
/*data for Appointments*/
insert into appointment(AppointmentTime,duration)
values(TO_DATE('2024-02-01 8:00', 'yyyy-MM-dd hh:mi'),90);
insert into appointment(AppointmentTime,duration)
values(TO_DATE('2024-02-01 10:00', 'yyyy-MM-dd hh:mi'),60);
insert into appointment(AppointmentTime,duration)
values(TO_DATE('2024-02-01 10:30', 'yyyy-MM-dd hh:mi'),60);
insert into appointment(AppointmentTime,duration)
values(TO_DATE('2024-02-01 11:00', 'yyyy-MM-dd hh:mi'),60);
insert into appointment(AppointmentTime,duration)
values(TO_DATE('2024-02-01 1:00 PM', 'yyyy-MM-dd hh:mi AM'),90);
/* show data */
select * from room;
select * from client;
select * from counselor;
select * from appointment;
Labels: hidden