Advertisement
Guest User

cash mysql

a guest
Jan 19th, 2022
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.60 KB | None | 0 0
  1. create database cajero_ifp_2022;
  2. use cajero_ifp_2022;
  3. create table cuentas
  4. (id_cuenta int not null primary key,
  5. saldo double not null,
  6. tipo_cuenta varchar(20) not null
  7. );
  8.  
  9. insert into cuentas values(1000, 3000, 'ahorro'),(2000, 5000, 'corriente');
  10.  
  11. create table movimientos
  12. (id_movimiento int not null primary key auto_increment,
  13. id_cuenta int not null,
  14. fecha  datetime not null,
  15. cantidad double not null,
  16. operacion varchar(45) not null,
  17. foreign key(id_cuenta) references cuentas(id_cuenta)
  18. );
  19. create user ucuentas identified by 'ucuentas';
  20. grant all privileges on cajero_ifp_2022.* to ucuentas;
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement