0
How do I insert a table into a abanco ? I am a beginner mysql user and beginner in the world of programming.
I made the following code:
INSERT INTO banco1(
CREATE TABLE Cliente (
id INT NOT NULL AUTO_INCREMENT
nome varchar(60)NOT NULL DEFAULT vazio,
sexo ENUM('M','F'),
data_de_nascimento date,
limite_de_credito decimal(9,2),
cidade varchar(50),
bairro varchar(50)
PRIMARY KEY(id),
INDEX(nome) ))
ENGINE=INNODB Charset= utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT;
I got the following error:
Error Static analysis: 2 errors were found during analysis.
Palavra-chave inesperada. (near "ENGINE" at position 311)
Unrecognized statement type. (near "ENGINE" at position 311)
Comando SQL:
INSERT INTO banco1( CREATE TABLE Cliente ( id INT NOT NULL AUTO_INCREMENT nome varchar(60)NOT NULL DEFAULT vazio, sexo ENUM('M','F'), data_de_nascimento date, limite_de_credito decimal(9,2), cidade varchar(50), bairro varchar(50) PRIMARY KEY(id), INDEX(nome) )) ENGINE=INNODB Charset= utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT
Mensagens do MySQL :
#1046 - Nenhum banco de dados foi selecionado
Click on the database and then yes execute the query.
– rray
I need to do this by the code. It is study activity. Then I need to know how you do for the case of any discursive evidence during the year.
– Gabriel Silva
Before the Insert puts one
use nome do banco;
– rray
Good guy ! Thank you!
– Gabriel Silva