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

Microsoft Windows [Versin 6.1.

7600]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.
C:\Users\Miguel>cd\wamp
C:\wamp>cd mysql
C:\wamp\mysql>cd bin
C:\wamp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.7-nt-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+------------+
| Database |
+------------+
| mysql
|
| phpmyadmin |
| test
|
+------------+
3 rows in set (0.00 sec)
mysql> use mysql
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql
|
+---------------------------+
| columns_priv
|
| db
|
| func
|
| help_category
|
| help_keyword
|
| help_relation
|
| help_topic
|
| host
|
| tables_priv
|
| time_zone
|
| time_zone_leap_second
|
| time_zone_name
|
| time_zone_transition
|
| time_zone_transition_type |
| user
|
+---------------------------+
15 rows in set (0.00 sec)
mysql> describe host;
+-----------------------+---------------+------+-----+---------+-------+
| Field
| Type
| Null | Key | Default | Extra |
+-----------------------+---------------+------+-----+---------+-------+
| Host
| char(60)
|
| PRI |
|
|
| Db
| char(64)
|
| PRI |
|
|
| Select_priv
| enum('N','Y') |
|
| N
|
|
| Insert_priv
| enum('N','Y') |
|
| N
|
|
| Update_priv
| enum('N','Y') |
|
| N
|
|
| Delete_priv
| enum('N','Y') |
|
| N
|
|

| Create_priv
| enum('N','Y') |
|
| N
|
|
| Drop_priv
| enum('N','Y') |
|
| N
|
|
| Grant_priv
| enum('N','Y') |
|
| N
|
|
| References_priv
| enum('N','Y') |
|
| N
|
|
| Index_priv
| enum('N','Y') |
|
| N
|
|
| Alter_priv
| enum('N','Y') |
|
| N
|
|
| Create_tmp_table_priv | enum('N','Y') |
|
| N
|
|
| Lock_tables_priv
| enum('N','Y') |
|
| N
|
|
+-----------------------+---------------+------+-----+---------+-------+
14 rows in set (0.01 sec)
mysql> create datbase agendaalum;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'datba
se agendaalum' at line 1
mysql> create database agendaalum;
Query OK, 1 row affected (0.04 sec)
mysql> show databases
-> show databases;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
databases' at line 2
mysql> show databases;
+------------+
| Database |
+------------+
| agendaalum |
| mysql
|
| phpmyadmin |
| test
|
+------------+
4 rows in set (0.00 sec)
mysql> use agenda;
ERROR 1049 (42000): Unknown database 'agenda'
mysql> use agendaalum;
Database changed
mysql> create table alumnos;
ERROR 1113 (42000): A table must have at least 1 column
mysql> create table alumnos;
ERROR 1113 (42000): A table must have at least 1 column
mysql> create table alumnos (
-> num_control varchar(10)
-> apellido_pat varchar(10)
-> apellido_mat varchar(10)
->
->
->
-> )
-> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'apell
ido_pat varchar(10)
apellido_mat varchar(10)
)
)' at line 3
mysql> create table alumnos(
-> num_control(10),
-> );

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(10),
)' at line 2
mysql> create table alumnos(
-> num_control varchar(10),
-> apellido_pat varchar(10),
-> apellido_mat varchar(10),
-> nombres varchar(30),
-> semestre int,
-> fecha_nacim date
-> );
Query OK, 0 rows affected (0.11 sec)
mysql> show database;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'datab
ase' at line 1
mysql> show tables;
+----------------------+
| Tables_in_agendaalum |
+----------------------+
| alumnos
|
+----------------------+
1 row in set (0.00 sec)
mysql> describe alumnos;
+--------------+-------------+------+-----+---------+-------+
| Field
| Type
| Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| num_control | varchar(10) | YES |
| NULL
|
|
| apellido_pat | varchar(10) | YES |
| NULL
|
|
| apellido_mat | varchar(10) | YES |
| NULL
|
|
| nombres
| varchar(30) | YES |
| NULL
|
|
| semestre
| int(11)
| YES |
| NULL
|
|
| fecha_nacim | date
| YES |
| NULL
|
|
+--------------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)
mysql> insert into alumnos(
-> num_control, apellido_pat, apellido_mat, nombres, semestre, fecha_nacim)
-> values(
-> '08470256','chi', 'escalante','roman antonio');
ERROR 1136 (21S01): Column count doesn't match value count at row 1
mysql> insert into alumnos(
-> num_control, apellido_pat)
-> values('08470256','lopez');
Query OK, 1 row affected (0.00 sec)
mysql> select *
-> from alumnos;
+-------------+--------------+--------------+---------+----------+-------------+
| num_control | apellido_pat | apellido_mat | nombres | semestre | fecha_nacim |
+-------------+--------------+--------------+---------+----------+-------------+
| 08470256

| lopez

| NULL

| NULL

NULL | NULL

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

1 row in set (0.00 sec)


mysql> insert into alumnos values('08470180','inurreta','avila','allan inurreta'
,6,1990-02-02);
Query OK, 1 row affected, 1 warning (0.01 sec)
mysql> describe alumnos;
+--------------+-------------+------+-----+---------+-------+
| Field
| Type
| Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| num_control | varchar(10) | YES |
| NULL
|
|
| apellido_pat | varchar(10) | YES |
| NULL
|
|
| apellido_mat | varchar(10) | YES |
| NULL
|
|
| nombres
| varchar(30) | YES |
| NULL
|
|
| semestre
| int(11)
| YES |
| NULL
|
|
| fecha_nacim | date
| YES |
| NULL
|
|
+--------------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)
mysql> select *
-> from alumnos;
+-------------+--------------+--------------+----------------+----------+------------+
| num_control | apellido_pat | apellido_mat | nombres
| semestre | fecha_
nacim |
+-------------+--------------+--------------+----------------+----------+------------+
| 08470256
| lopez
| NULL
| NULL
|
NULL | NULL
|
| 08470180
| inurreta
| avila
| allan inurreta |
6 | 0000-0
0-00 |
+-------------+--------------+--------------+----------------+----------+------------+
2 rows in set (0.00 sec)
mysql> insert into alumnos values('08470181','vazquez','farfan','ana laura',6,'1
988-03-12');
Query OK, 1 row affected (0.00 sec)
mysql> select *
-> from alumnos;
+-------------+--------------+--------------+----------------+----------+------------+
| num_control | apellido_pat | apellido_mat | nombres
| semestre | fecha_
nacim |
+-------------+--------------+--------------+----------------+----------+------------+
| 08470256
| lopez
| NULL
| NULL
|
NULL | NULL
|
| 08470180
| inurreta
| avila
| allan inurreta |
6 | 0000-0
0-00 |
| 08470181
| vazquez
| farfan
| ana laura
|
6 | 1988-0
3-12 |
+-------------+--------------+--------------+----------------+----------+------------+
3 rows in set (0.00 sec)
mysql>

Вам также может понравиться