Академический Документы
Профессиональный Документы
Культура Документы
| codigo | nome
| sobrenome | datanacimento |
+--------+----------+-----------+---------------+
|
1 | amarildo | silva
| 1946-06-26
|
|
2 | jose
| machado
| 1946-06-26
|
+--------+----------+-----------+---------------+
2 rows in set (0.00 sec)
mysql> update pessoas set datanacimento ="2015/10/20" where codigo=2;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from pessoas;
+--------+----------+-----------+---------------+
| codigo | nome
| sobrenome | datanacimento |
+--------+----------+-----------+---------------+
|
1 | amarildo | silva
| 1946-06-26
|
|
2 | jose
| machado
| 2015-10-20
|
+--------+----------+-----------+---------------+
2 rows in set (0.00 sec)
mysql> delete from pessoas where codogo=2;
ERROR 1054 (42S22): Unknown column 'codogo' in 'where clause'
mysql> delete from pessoas where codigo=2;
Query OK, 1 row affected (0.06 sec)
mysql> select * from pessoas;
+--------+----------+-----------+---------------+
| codigo | nome
| sobrenome | datanacimento |
+--------+----------+-----------+---------------+
|
1 | amarildo | silva
| 1946-06-26
|
+--------+----------+-----------+---------------+
1 row in set (0.00 sec)
mysql> truncate table pessoas;
Query OK, 0 rows affected (0.20 sec)
mysql> select * from pessoas;
Empty set (0.00 sec)
mysql> create table fornecedor (
-> codicli int not null auto_increment primary key,
-> ragsocc varchar(30),
-> endereco varchar(30),
-> cidade varchar(30),
-> cep char(9),
-> estado char(2),
-> cnpj char(18));
Query OK, 0 rows affected (0.23 sec)
mysql> describe fornecedor;
+----------+-------------+------+-----+---------+----------------+
| Field
| Type
| Null | Key | Default | Extra
|
+----------+-------------+------+-----+---------+----------------+
| codicli | int(11)
| NO
| PRI | NULL
| auto_increment |
| ragsocc | varchar(30) | YES |
| NULL
|
|
| endereco | varchar(30) | YES |
| NULL
|
|
| cidade
| varchar(30) | YES |
| NULL
|
|
| cep
| char(9)
| YES |
| NULL
|
|
| estado
| char(2)
| YES |
| NULL
|
|
| cnpj
| char(18)
| YES |
| NULL
|
|
+----------+-------------+------+-----+---------+----------------+
7 rows in set (0.05 sec)
mysql> insert table fornecedor values (01, "pilot", " Alberto bins 30",
-> "porto alegre", "90420-147","rs", "00490244089");
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 'table fornecedor values (01, "pilot", " Alberto bins 30",
"porto alegre", "90420' at line 1
mysql> insert table fornecedor values (01, "pilot", " Alberto bins 30",
-> "porto alegre", "90420-147","rs", "00490244089");
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 'table fornecedor values (01, "pilot", " Alberto bins 30",
"porto alegre", "90420' at line 1
mysql> insert fornecedor values (01, "pilot", " Alberto bins 30",
-> "porto alegre", "90420-147","rs", "00490244089");
Query OK, 1 row affected (0.03 sec)
mysql> select * from fornecedor
-> ;
+---------+---------+------------------+--------------+-----------+-------+-------------+
| codicli | ragsocc | endereco
| cidade
| cep
|
estado | cnpj
|
+---------+---------+------------------+--------------+-----------+-------+-------------+
|
1 | pilot
| Alberto bins 30 | porto alegre | 90420-147 | rs
| 00490244089 |
+---------+---------+------------------+--------------+-----------+-------+-------------+
1 row in set (0.00 sec)
mysql> create database curso;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database
|
+--------------------+
| information_schema |
| bf4bd
|
| clinica
|
| curso
|
| escola
|
| meubd
|
| mysql
|
| performance_schema |
| produtos
|
| revisao
|
| sakila
|
| test
|
| turma
|
| world
|
+--------------------+
14 rows in set (0.00 sec)