Create a table with Navicat visualization, but you can't find it! later found that the ② statement can be queried to
①select * from user;
But if we add double quotes to the user, we can find it!
②select * from "user";
is Oracle different from MySQL, you must add double quotes when querying? That's not so much trouble! So after finding the data to draw the following conclusions:
1. Oracle tables and fields are case-sensitive. Oracle defaults to uppercase, and if we enclose them in double quotes it is case-insensitive, and if not, the system will automatically turn into uppercase.
2. When we use Navicat to create a database using visualizations, Navicat automatically adds "" to us. So the actual code when we create the database is this: (through the files of the SQL statements everywhere, it's not hard to understand why we can't find the table.) )
12345 |
DROP TABLE "ROOT" . "user" ; CREATE TABLE "ROOT" . "user" ( "userid" NUMBER(2) NOT NULL ) -------到这里,我想那些总是用可视化来创建表和字段的人该吐槽navicat了。 |
3. Do I create tables and fields with SQL statements?
① do not add double quotes to create a change:
12345678910111213141516 |
CREATE TABLE "ROOT"
.personal_user_table (
personal_id NUMBER(10)
NOT NULL ,
login_name VARCHAR2(20 BYTE)
NOT NULL ,
login_password VARCHAR2(20 BYTE)
NOT NULL ,
register_time
DATE NOT NULL ,
fullname VARCHAR2(20 BYTE)
NOT NULL ,
sex
CHAR
(1 BYTE)
NULL ,
id_card
CHAR
(18 BYTE)
NULL ,
email VARCHAR2(30 BYTE)
NULL ,
tel
CHAR
(11 BYTE)
NULL ,
address VARCHAR2(64 BYTE)
NULL ,
work_units VARCHAR2(64 BYTE)
NULL ,
monthly_income NUMBER(8,2)
NULL ,
bank_account
CHAR
(20 BYTE)
NULL ,
credit_rating NUMBER(1)
NULL
)
|
The result is a normal query:
② with double quotes, as we do with the Navicat visualization:
12345678910111213141516 |
CREATE TABLE "ROOT"
.
"personal_user_table" (
"personal_id" NUMBER(10)
NOT NULL ,
"login_name" VARCHAR2(20 BYTE)
NOT NULL ,
"login_password" VARCHAR2(20 BYTE)
NOT NULL ,
"register_time" DATE NOT NULL ,
"fullname" VARCHAR2(20 BYTE)
NOT NULL ,
"sex" CHAR
(1 BYTE)
NULL ,
"id_card" CHAR
(18 BYTE)
NULL ,
"email" VARCHAR2(30 BYTE)
NULL ,
"tel" CHAR
(11 BYTE)
NULL ,
"address" VARCHAR2(64 BYTE)
NULL ,
"work_units" VARCHAR2(64 BYTE)
NULL ,
"monthly_income" NUMBER(8,2)
NULL ,
"bank_account" CHAR
(20 BYTE)
NULL ,
"credit_rating" NUMBER(1)
NULL
)
|
The results are as follows:
It is therefore recommended that:
1. It is recommended that our visual operators develop the habit of writing handwritten SQL statements, and we do not use double quotes when creating them! So that we can get to the same size as MySQL, etc. is not case-sensitive.
3, the more stupid method is the data table name capitalization, this can also avoid this problem