Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Access with SQL

Similar presentations


Presentation on theme: "Database Access with SQL"— Presentation transcript:

1 Database Access with SQL
Relational Databases consist of tables SQL provides command based access to information in a table SQL commands are case-insensitive (case doesn’t matter) Some tables have a Primary key that will auto-increment when new items are added Products Categories in a Grocery Store Products in a Grocery Store More info at:

2 Basic SQL Queries Selecting column information from a table
SELECT column1, column2....columnN FROM table_name Selecting column information that meets a condition SELECT column1, column2....columnN FROM table_name WHERE Item1 = Value1 Selecting column information that meets multiple conditions SELECT column1, column2....columnN FROM table_name WHERE Item1 = Value1 {AND|OR} Item2 = Value2

3 More SQL Queries Select everything matching a condition
SELECT * FROM table_name WHERE Item1 = Value1 Select items using a wildcard SELECT * FROM table_name WHERE Title LIKE ‘%match%’ Will match anything containing the string “match”

4 Modifying the Database
Remove (delete) information from a table DELETE FROM table_name WHERE Item1 = Value1 Insert new items (a row) INSERT INTO table_name (Item1, Item2, …) VALUES (Value1, Value2, …) Modify stored data UPDATE table_name SET Item1=Value1, Item2=Value2 WHERE Item3=Value3…


Download ppt "Database Access with SQL"

Similar presentations


Ads by Google