Home >Database >Mysql Tutorial >What Makes a Valid Table Name in SQLite?
Valid table names in SQLite
In SQLite, table names follow specific conventions to be considered valid. Although not all combinations of alphanumeric characters (A-Z, a-z, and 0-9) are valid, certain characters and patterns are allowed.
Alphanumeric name Names consisting only of letters and numbers are valid table names, as long as they do not begin with a number. For example, "abc123" is a valid name, but "123abc" is not.
Names containing dashes and periods Combining alphanumeric characters with a dash "-" or a period "." is not valid for table names. These characters can appear in the name, but not at the beginning or end. For example, "123abc.txt" and "123abc-ABC.txt" are invalid table names.
Name with quotes Special characters and spaces are allowed when the table name is enclosed in double quotes ("") or square brackets ([]). This provides greater flexibility in naming tables. For example, "This should-be a_valid.table name!?" is a valid quoted table name.
Other notes SQLite also supports using SQL Server and MySQL style table name references:
It is important to note that while these conventions help ensure the validity of table names in SQLite, they should still be used in a manner that is consistent with the intended purpose and use of the database.
The above is the detailed content of What Makes a Valid Table Name in SQLite?. For more information, please follow other related articles on the PHP Chinese website!