CREATE TABLE `myDB`.`usersystem` (
`userid` INT NOT NULL AUTO_INCREMENT ,
`username` VARCHAR( 50 ) NOT NULL ,
`password` VARCHAR( 32 ) NOT NULL ,
`email` VARCHAR( 50 ) NOT NULL ,
PRIMARY KEY ( `userid` )
);
Sorry, I would search but I have no idea how to search for such a specific misunderstanding.
I’m starting to learn MySQL, and I’m getting comfortable, but I’m confused what the backticks do, and why when the table was created it has a period between them. What does usersystem denote?
All of the stuff you don’t understand could be removed without changing the meaning of this statement!
The backticks are just for quoting; they’re optional, but they distinguish between a keyword and the name of a table or column. If you wanted a table named
SELECT, putting the table name in quotes like this would let you create one.Backticks are used for quoting identifiers by default, but there’s a special ANSI_QUOTES mode that, if activated, lets you use double-quote characters for this instead. Single quotes are used for quoting character strings.
myDB.usersystemrefers to a table namedusersystemin the database namedmyDB. Naming the database is optional, as it defaults to the connected one. You can also set the implicit database by using theusecommand, as in “use myDB“.