Ingeniero
mysql > create database RegistroNotas; mysql > use r RegistroNotas;
mysql > create table ALUMNOS - > (idAlumnos char(8) , -> nombres varchar(40), - > apellidos varchar(40), -> direccionvarchar(50), - > telefono char(15) ) -> Engine=InnoDB; Query OK, 0 rows affected mysql> alter table ALUMNOS add primary key(idAlumno); mysql> alter table ALUMNOS add index(idAlumno);
mysql > showtables; mysql >describe ALUMNOS;
mysql > use registroNotas;
mysql > create table PROFESORES - > (idprofesores varchar(8), -> nombres varchar(40), -> apellidos varchar(40)) -> Engine=InnoDB;Query OK, 0 rows affected mysql> alter table PROFESORES add index(idprofesores); Query OK, 0 rows affected (0.19 sec) Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table PROFESORES add primarykey(idprofesores); Query OK, 0 rows affected (0.19 sec) Records: 0 Duplicates: 0 Warnings: 0
mysql > show tables; mysql > describe PROFESORES;
mysql > use RegistroNotas;
mysql > create tableCURSOS - > (idcursos varchar(8),
-> nombre varchar(30), - > nivel varchar(20)) -> Engine=InnoDB; Query OK, 0 rows affected
mysql > show tables; mysql> alter table CURSOS add index(idCursos); QueryOK, 0 rows affected (0.18 sec) Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table CURSOS add primary key(idCursos); Query OK, 0 rows affected (0.19 sec) Records: 0 Duplicates: 0 Warnings: 0mysql > describe CURSOS;
mysql > use registroNotas;
mysql > create table ESPECIALIDAD - > (idespecialidad varchar(8), - > nivel varchar(20)) -> Engine=InnoDB; Query OK, 0 rows affected
mysql >show tables; mysql > describe ESPECIALIDAD;
mysql > use registroNotas;
mysql > create table DETALLES - > (nota1 decimal(5,2), - > nota2 decimal(5,2), - > nota3 decimal(5,2), - > observacionvarchar(60)) -> Engine=InnoDB; Query OK, 0 rows affected
mysql > show tables; mysql > describe DETALLES;
LLENANDO LAS TABLAS
mysql> select * from ALUMNOS;
mysql> select * from CURSOS;...
Regístrate para leer el documento completo.