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

Next revision
Previous revision
linux_wiki:perform_simple_sql_queries_against_a_database [2016/09/11 14:39]
billdozor created
linux_wiki:perform_simple_sql_queries_against_a_database [2019/05/25 23:50] (current)
Line 3: Line 3:
 **General Information** **General Information**
  
-About this page/how-to/script.+Basic SQL commands. 
 + 
 +---- 
 + 
 +====== Lab Setup ====== 
 + 
 +The following virtual machines will be used: 
 +  * server2.example.com (192.168.1.151) -> Database here 
 + 
 +**Previous Sections Completed** 
 +  * [[linux_wiki:install_and_configure_mariadb|Install and Configure MariaDB]] 
 +  * [[linux_wiki:create_a_simple_database_schema|Create a Simple Database Schema]]
  
 ---- ----
Line 41: 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 65: 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.1473619165.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)