Академический Документы
Профессиональный Документы
Культура Документы
*================================================
==============*/
/* DBMS name:
/* Created on:
*/
*/
/
*================================================
==============*/
if exists (select 1
from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type =
'F')
where r.fkeyid = object_id('SERVIS_AWAL') and o.name =
'FK_SERVIS_A_MELAKUKAN_ID_PELAN')
alter table SERVIS_AWAL
drop constraint FK_SERVIS_A_MELAKUKAN_ID_PELAN
go
if exists (select 1
from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type =
'F')
where r.fkeyid = object_id('SERVIS_SELESAI') and o.name =
'FK_SERVIS_S_DATA_TERS_ID_PELAN')
alter table SERVIS_SELESAI
drop constraint FK_SERVIS_S_DATA_TERS_ID_PELAN
go
if exists (select 1
from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type =
'F')
if exists (select 1
from sysobjects
where id = object_id('ID_PELANGGAN')
and type = 'U')
drop table ID_PELANGGAN
go
if exists (select 1
from sysindexes
where id
= object_id('SERVIS_AWAL')
if exists (select 1
from sysobjects
where id = object_id('SERVIS_AWAL')
and type = 'U')
drop table SERVIS_AWAL
go
if exists (select 1
from sysindexes
where id
= object_id('SERVIS_SELESAI')
if exists (select 1
from sysindexes
where id
= object_id('SERVIS_SELESAI')
if exists (select 1
from sysobjects
where id = object_id('SERVIS_SELESAI')
and type = 'U')
drop table SERVIS_SELESAI
go
/
*================================================
==============*/
/* Table: ID_PELANGGAN
*/
/
*================================================
==============*/
create table ID_PELANGGAN (
ID_PELANGGAN
varchar(20)
NAMA_PELANGGAN
varchar(55)
not null,
null,
/
*================================================
==============*/
/* Table: SERVIS_AWAL
*/
/
*================================================
==============*/
create table SERVIS_AWAL (
JENIS_SERVIS
ID_PELANGGAN
TANGGAL_MASUK
varchar(100)
varchar(20)
datetime
not null,
not null,
not null,
/
*================================================
==============*/
/* Index: MELAKUKAN_SERVIS_FK
*/
/
*================================================
==============*/
/
*================================================
==============*/
/* Table: SERVIS_SELESAI
*/
/
*================================================
==============*/
create table SERVIS_SELESAI (
ID_PELANGGAN
JENIS_SERVIS
TANGGAL_SELESAI
BIAYA_SERVIS
varchar(20)
varchar(100)
datetime
money
not null,
not null,
null,
null
)
go
/
*================================================
==============*/
/* Index: TERSELESAIKAN_FK
*/
/
*================================================
==============*/
create index TERSELESAIKAN_FK on SERVIS_SELESAI (
JENIS_SERVIS ASC
)
go
/
*================================================
==============*/
/* Index: DATA_TERSELESAIKAN_FK
*/
/
*================================================
==============*/
create index DATA_TERSELESAIKAN_FK on SERVIS_SELESAI (
ID_PELANGGAN ASC
)
go