linux_wiki:perform_simple_sql_queries_against_a_database

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:perform_simple_sql_queries_against_a_database [2018/04/20 12:31]
billdozor [Lab Setup]
linux_wiki:perform_simple_sql_queries_against_a_database [2018/05/20 23:09]
billdozor [Basics of SQL: Add,Remove,Modify]
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 Sections Completed** **Previous Sections Completed**
Line 53: Line 52:
  
 \\ \\
-Insert new row/entry into a table+Insert two new rows/entries into a table (two methods)
 <code bash> <code bash>
-MariaDB [emails]> INSERT INTO users (userID,userFirstName,userLastName,userEmailAddress) VALUES (001,"Robert","Jones","robertjones@example.com");+# Values method 
 +MariaDB [emails]> INSERT INTO users (userFirstName,userLastName,userEmailAddress) VALUES ("Robert","Jones","rjones@example.com")
 + 
 +# Set method 
 +MariaDB [emails]> INSERT INTO users set userFirstName="Jane", userLastName="Smith", userEmailAddress="jsmith@example.com";
 </code> </code>
  
Line 77: Line 80:
  
 \\ \\
-Update the entry of Jane Smith to change her last name and email address+Update the entry of Robert Jones to change the email address
 <code bash> <code bash>
-MariaDB [emails]> UPDATE users SET userLastName="Jones",userEmailAddress="janejones@example.com" WHERE userID=2;+MariaDB [emails]> UPDATE users SET userEmailAddress="robert.jones@example.com" WHERE userID=1;
 </code> </code>
  
 ---- ----
  
  • linux_wiki/perform_simple_sql_queries_against_a_database.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)