Вы находитесь на странице: 1из 5

mysql> create database servicio_militar;

Query OK, 1 row affected (0.01 sec)


mysql> use servicio_militar;
Database changed
mysql> create table soldados(codigoSol int primary key, nombreSol varchar(20), apellidoSol
varchar(20), graduacion date);
Query OK, 0 rows affected (0.15 sec)

mysql> describe soldados;


+-------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+-------------+-------------+------+-----+---------+-------+
| codigoSol | int(11)

| NO | PRI | NULL |

| nombreSol | varchar(20) | YES |


| apellidoSol | varchar(20) | YES |
| graduacion | date

| YES |

| NULL |

| NULL |
| NULL |

|
|

+-------------+-------------+------+-----+---------+-------+
4 rows in set (0.01 sec)

mysql> create table cuartel(codigoCuar int primary key, nombreCuar varchar(20), ubicacion
varchar(25));
Query OK, 0 rows affected (0.08 sec)

mysql> describe cuartel;


+------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+------------+-------------+------+-----+---------+-------+
| codigoCuar | int(11)

| NO | PRI | NULL |

| nombreCuar | varchar(20) | YES |


| ubicacion | varchar(25) | YES |

| NULL |
| NULL |

|
|

+------------+-------------+------+-----+---------+-------+
3 rows in set (0.01 sec)

mysql> create table cuerpos(codigoCuerpo int primary key, denominacion varchar(25));


Query OK, 0 rows affected (0.09 sec)

mysql> describe cuerpos;


+--------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+--------------+-------------+------+-----+---------+-------+
| codigoCuerpo | int(11)

| NO | PRI | NULL |

| denominacion | varchar(25) | YES |

| NULL |

|
|

+--------------+-------------+------+-----+---------+-------+
2 rows in set (0.01 sec)

mysql> create table compaia(numComp int primary key, actividad varchar(25));


Query OK, 0 rows affected (0.14 sec)

mysql> describe compaia;


+-----------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+-----------+-------------+------+-----+---------+-------+

| numComp | int(11)

| NO | PRI | NULL |

| actividad | varchar(25) | YES |

| NULL |

|
|

+-----------+-------------+------+-----+---------+-------+
2 rows in set (0.01 sec)

mysql> create table servicios(codigoSer int primary key, descripcion varchar(25));


Query OK, 0 rows affected (0.10 sec)

mysql> describe servicios;


+-------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+-------------+-------------+------+-----+---------+-------+
| codigoSer | int(11)

| NO | PRI | NULL |

| descripcion | varchar(25) | YES |

| NULL |

+-------------+-------------+------+-----+---------+-------+
2 rows in set (0.01 sec)

|
|