Exercicio msql
Enter password: admin
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database empresa;
Query OK, 1 row affected (0.02 sec)
mysql> use empresa;
Database changed mysql> create table funcionario ( -> nome varchar(40) not null, -> RG int not null primary key, -> CPF int not null, -> Depto varchar(20), -> RG_super int not null, -> Salario numeric(7,2);
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 '' at line 7 mysql> create table funcionario ( -> nome varchar(40) not null, -> RG int not null primary key, -> CPF int not null, -> Depto varchar(20), -> RG_super int not null, -> Salario numeric(7,2) );
Query OK, 0 rows affected (0.17 sec)
mysql> insert into funcionario value("Victor",11111111, 22222, Patrimonio, 12345
678, 1000.00);
ERROR 1054 (42S22): Unknown column 'Patrimonio' in 'field list' mysql> insert into funcionario value("Victor",11111111, 22222, "Patrimonio", 123
45678, 1000.00);
Query OK, 1 row affected (0.03 sec)
mysql> insert into funcionario value("Alex",11111131, 22212, "Prefeitura", 12345
108, 2000.00);
Query OK, 1 row affected (0.03 sec)
mysql> insert into funcionario value("Felipe",51111131, 22212, "Desempregado", 1
2345108, 2000.00);
Query OK, 1 row affected (0.03 sec)
mysql> insert into funcionario value("Ary",51111531, 22210, "Secretaria", 123456
78, 2000.00);
Query OK, 1 row affected (0.03 sec)
mysql>