Está en la página 1de 1

create database bdbanco on primary( name='bdbanco', filename='C:\Cristiam\Base de datos I\Trabajo de 11-05-12\bdbanco.

mdf', size=5mb, filegrowth=1024kb) log on( name='bdbanco_log', filename='C:\Cristiam\Base de datos I\Trabajo de 11-0512\bdbanco_log.ldf', size=4mb, maxsize=5mb, filegrowth=10%) create table dBanco (codban varchar (4) not null primary key, nomban varchar (30) not null) create table dCuenta( nrocta int not null primary key, nomcl varchar (70) not null, dircli varchar (40) not null, fecaper datetime not null, saldoaper numeric(8,2) not null, tipocta varchar (1) not null, codban varchar (4) not null) create table dMovimiento( nromov int identity(100001,1) primary key, tipomov varchar not null, fechamov datetime not null, monto numeric(8,2) not null) alter table dMovimiento add nrocta int not null alter table dMovimiento add constraint fk_dMovimiento foreign key (nrocta) references dCuenta alter table dMovimiento add constraint ck_monto check(monto>0) alter table dMovimiento add constraint ck_moto check (monto<1000) backup database bdbanco to disk='C:\Cristiam\Base de datos I\Trabajo de 11-05-12\BaseDatos_Banco.bk'

También podría gustarte