Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.45-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SHOW DATABASES;
DATABASE |
Informacion schema |
mysql |
Practica |
test |
4 rows in set (0.05 sec)
mysql> USE PRACTICA;
Database changed
mysql> CREATE TABLE EMPLE(emp_nom integer,apellido varchar(20),oficio varchar(20
),dir integer,fecha_alt date,salario integer,comision integer,dept_no integer,pr
imary key(emp_nom));
Query OK, 0 rows affected (3.68 sec)
mysql> describe emple;
Field | Type | Null | Key | Default | Extra |
Emp_nom | Int(11) | NO | PRI | 0 | |
apellido | Varchar(20) | YES | NULL | ||
oficio | Varchar(20) | YES | NULL | ||
dir | Int(11) | YES | NULL | ||
Fecha_alt | date | YES | NULL | ||
salario | Int(11) | YES | NULL | ||
comision | Int(11) | YES | NULL | ||
Dept_no | Int(11) | YES | NULL |
8 rows in set (0.08 sec)
mysql> create database empleados;
Query OK, 1 row affected (0.02 sec)
mysql> use empleados;
Database changed
mysql> create table emple(emp_no integer,apellido varchar(20),oficio varchar (20
),dir varchar(20),fecha_alt date,salario integer,comision integer,dept_no intege
r,primary key(emp_no));
Query OK, 0 rows affected (0.14 sec)
mysql> create table depart(dept_no integer,dnombre varchar(20),loc varchar(20),p
rimary key(dept_no));
Query OK, 0 rows affected (0.06 sec)
mysql> describe depart;
Field | Type | Null | Key | Default | Extra |
Dept_no | Int(11) | NO | PRI | 0 | |
dnombre | Varchar(20) | YES | NULL | ||
loc | Varchar(20) | YES | NULL |
3 rows in set (0.03 sec)
mysql> insert into emple values(7369,'Sanches','empleado',7902,17/12/1980,104000
,null,20);
Query OK, 1 row affected (0.06 sec)
mysql> insert into emple values(7499,'Arroyo','vendedor',7698,20/02/1980,208000,
39000,30);
Query OK, 1 row affected (0.02 sec)