Tambor
Profesora: Guadalupe Guerrero
Alumna: Brenda Barrios Tablas
Grado: 2 Grupos: C
Comandos y ejemplos de comandos
• show databases; -Listar todas las bases de datos.
mysql> SHOW TABLES FROM INFORMATION_SCHEMA;
• +---------------------------------------+
• | Tables_in_information_schema |
•+---------------------------------------+
• | SCHEMATA |
• | TABLES |
• | COLUMNS |
• | CHARACTER_SETS|
• | COLLATIONS |
• | COLLATION_CHARACTER_SET_APPLICABILITY |
• | ROUTINES |
• | STATISTICS|
• | VIEWS |
• | TRIGGERS |
• | USER_PRIVILEGES |
• | SCHEMA_PRIVILEGES|
• | TABLE_PRIVILEGES |
• | COLUMN_PRIVILEGES |
• | TABLE_CONSTRAINTS |
• | KEY_COLUMN_USAGE|
• +---------------------------------------+
El comando show tables; muestra las tablas de la base de datos actual. Ejemplo:
• mysql> use mysql
• Database changed• mysql> show tables;
• +-----------------+
• | Tables_in_mysql |
• +-----------------+
• | columns_priv|
• | db|
• | func|
• | host|
• | tables_priv|
•| user|
• +-----------------+
• 6 rows in set (0.00 sec)
• Se
Para agregar foreign:
alter table nomtabla add foreign key (atributo) references nomtable(atributo);
ejemplos:
altertable casas add foreign key (calle) references nomtable(calle);
alter table nombres add foreign key (apellidos) references nomtable(apellidos);
Para borrar un campo es:
alter table nomtabla...
Regístrate para leer el documento completo.