linux_wiki:create_a_simple_database_schema

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:create_a_simple_database_schema [2018/04/20 12:30]
billdozor [Lab Setup]
linux_wiki:create_a_simple_database_schema [2019/05/25 23:50] (current)
Line 10: Line 10:
  
 The following virtual machines will be used: The following virtual machines will be used:
-  * server1.example.com (192.168.1.150) -> Perform any client testing here +  * server2.example.com (192.168.1.151) -> Database here
-  * server2.example.com (192.168.1.151) -> Install the database here+
  
 **Previous Section Completed** **Previous Section Completed**
Line 74: Line 73:
 Create a new table in the emails database Create a new table in the emails database
 <code bash> <code bash>
-MariaDB [emails]> CREATE TABLE users (userID INT, userFirstName char(25), userLastName char(30), userEmailAddress char(50))+MariaDB [emails]> CREATE TABLE users (userID INT AUTO_INCREMENT PRIMARY KEY, userFirstName CHAR(50), userLastName CHAR(50), userEmailAddress CHAR(50)) AUTO_INCREMENT = 100;
 </code> </code>
   * When you create a table, you must define the names of the columns and the type of data they should contain   * When you create a table, you must define the names of the columns and the type of data they should contain
-  * userID INT -> Named userID and of type integer +  * Column Definitions 
-  * userFirstName char(25) -> Named userFirstName and of type characters up to 25 long+    * userID INT -> Named userID and of type integer 
 +      * AUTO_INCREMENT -> Auto increment the entries in this column 
 +      * PRIMARY KEY -> The userid column is the primary sorting key 
 +    * userFirstName char(25) -> Named userFirstName and of type characters up to 25 long 
 +  * Table Options 
 +    * AUTO_INCREMENT = 100 -> Start userid at 100
  
 \\ \\
  • linux_wiki/create_a_simple_database_schema.1524241811.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)