I
I
Igor2018-12-12 20:13:08
MySQL
Igor, 2018-12-12 20:13:08

Creating a table in MySQL using IntelliJ IDEA - why is the wrong query being generated?

I watch a video lesson (link with timecode: https://youtu.be/DclLJt8zDWk?t=2285). A person makes a table in MySQL through IntelliJ IDEA, he generates an SQL script:
5c114718a9099532851276.png
I repeat after him thoroughly, add the same fields, but I generate a different script:
5c11473715e64271697481.png
1. What is the problem? Why is different code generated?
2. In addition, this SQL script does not want to be executed. Why does IntelliJ generate code that is not executable?
3. Why is everything in lowercase?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
3
3vi1_0n3, 2018-12-12
@3vi1_0n3

Why such a code is created I will not say, but I can say why it does not work. First, an index is created on the field, then it tries to create a primary key on the same field. Remove the index creation and try the script again.

S
sim3x, 2018-12-12
@sim3x

Finger to the sky
1. You already have a table and you are trying to re-create it
2. Because it is very difficult to make a full proof
3. Read the manuals for your DBMS - there is an answer why

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question