content_image/798293.jpg
WHERE c2 > 100; SELECT mytable.c1 FROM mytable WHERE mytable.c2 > 100; SELECT mydb.mytable.c1 FROM mydb.mytable WHERE mydb.mytable.c2 > 100; 

You need not specify a qualifier for an object reference in a statement unless the unqualified reference is ambiguous. Suppose that column c1  occurs only in table t1 , c2  only in t2 , and c  in both t1  and t2 . Any unqualified reference to c  is ambiguous in a statement that refers to both tables and must be qualified as t1.c  or t2.c  to indicate which table you mean: 

SELECT c1, c2, t1.c FROM t1 INNER JOIN t2 WHERE t2.c > 100; 

Similarly, to retrieve from a table t  in database db1  and from a table t  in database db2  in the same statement, you must qualify the table references: For references to columns in those tables, qualifiers are required only for column names that appear in both tables. Suppose that column c1  occurs only in table db1.t , c2  only in db2.t , and c  in both db1.t  and db2.t . In this case, c  is ambiguous and must be qualified but c1  and c2  need not be: 

## 9.2.3 Identifier Case Sensitivity 

SELECT c1, c2, db1.t.c FROM db1.t INNER JOIN db2.t WHERE db2.t.c > 100; 

Table aliases enable qualified column references to be written more simply: 

SELECT c1, c2, t1.c FROM db1.t AS t1 INNER JOIN db2.t AS t2 WHERE t2.c > 100; 

In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine). Triggers also correspond to files. Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database, table, and trigger names. This means such names are not case-sensitive in Windows, but are case-sensitive in most varieties of Unix. One notable exception is macOS, which is Unix-based but uses a default file system type (HFS+) that is not case-sensitive. However, macOS also supports UFS volumes, which are case-sensitive just as on any Unix. See Section 1.7.1, “MySQL Extensions to Standard SQL” . The lower_case_table_names  system variable also affects how the server handles identifier case sensitivity, as described later in this section. 

<img src='content_image/798293.jpg'>

## Note 

Although database, table, and trigger names are not case-sensitive on some platforms, you should not refer to one of these using different cases within the same statement. The following statement would not work because it refers to a table both as my_table  and as MY_TABLE : 

mysql> SELECT * FROM my_table WHERE MY_TABLE.col=1; 

Partition, subpartition, column, index, stored routine, event, and resource group names are not case- sensitive on any platform, nor are column aliases. 

However, names of logfile groups are case-sensitive. This differs from standard SQL. 

By default, table aliases are case-sensitive on Unix, but not so on Windows or macOS. The following statement would not work on Unix, because it refers to the alias both as a  and as A : 

