Introduction to database
Upcoming SlideShare
Loading in...5
×
 

Introduction to database

on

  • 4,050 views

For a session in #Exceedcamp7

For a session in #Exceedcamp7

Statistics

Views

Total Views
4,050
Views on SlideShare
4,038
Embed Views
12

Actions

Likes
0
Downloads
124
Comments
0

3 Embeds 12

http://www.slideshare.net 8
http://www.linkedin.com 3
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction to database Introduction to database Presentation Transcript

  • Introduction to Database
    With Microsoft Office Access 2007
  • Agenda
    Getting to Know Database
    Basic of Microsoft Office Access 2007
    Basic Operations of Database
    Structured Query Language (SQL)
    CRUD Operations
  • Getting to Know Database
  • Definition of Database
    Organized mechanism to store, manage and retrieve information
    Efficient
    Robust
    Stable
    Arranged in tabular fashion
    Apparent relationship between information
    The most important aspect
    Won’t be taught in this class :-(
  • Consists of a table, multiple fields and many columns
    A Really Simple Database
  • Organization of Database
    Tables
    Fields (Columns)
    Has many types
    Primary Key (Optional)
    Records (Rows, Entries)
  • When to Use Database? (1/3)
    Appropriate
    Appropriate
    Inappropriate
    Appropriate
    Inappropriate
    Appropriate
  • When to Use Database? (2/3)
    Transaction records
    Logging
    Blog/Forum
    Media Library
    Shopping list
    Music playlist
    Appropriate
    Inappropriate
  • When to Use Database? (3/3)
    Managing mass amount of information
    Sharing Information between many users
    Manipulating complicatedly related information
    Need security
    Desire organization
  • Under the Hood
    Infrastructure of Database
    Implementations in which we are going to learn
  • Basic of Access 2007
  • Don’t panic! You’ll soon be familiar with it.
    Microsoft Office Access 2007
  • Field Types (1/2)
  • Field Types (2/2)
  • Basic Operations of Database
  • Structured Query Language (SQL)
    Defines methods to manipulate database
    Attempt to request something from Database is called Query
    Each formed SQL statement refer as SQL Query
    Resembles natural language
    Has many standards
    However, the basic part is still the same
  • CRUD
    Create new tables and records
    Retrieve records from tables
    Update tables’ definition and record’s data
    Delete existing tables and records
  • CRUD : Create
    INSERT INTO <table_name> (<field_list>)
    VALUES (<value_list>);
    AutoNumber field must not be included
    Examples
    INSERT INTO students (nisit_id, name, surname) VALUES (51052744, “Pongsakorn”, “U-chupala”);
  • CRUD : Create - Example
    INSERT INTO students(nisit_id, name, surname)
    VALUES (51052744, “Pongsakorn”, “U-chupala”);
  • CRUD : Create - Example
    INSERT INTO students(nisit_id, name, surname)
    VALUES (51052744, “Pongsakorn”, “U-chupala”);
  • CRUD : Create - Practice
    Insert a record with every field specified
  • CRUD : Retrieve
    SELECT <select_list> FROM <table_name>
    [ WHERE <search_condition> ]
    [ ORDER BY <order_expression> [ ASC | DESC ] ];
    Select which fields to retrieve
    Examples
    SELECT field_1, field_2 FROM table_name …
    SELECT * FROM table_name …
  • CRUD : Retrieve
    SELECT <select_list> FROM <table_name>
    [ WHERE <search_condition> ]
    [ ORDER BY <order_expression> [ ASC | DESC ] ];
    Available operators: =, <, >, <=, >=, <>
    Modifiers: AND, OR, NOT, ()
    Examples
    … WHERE student_id=1 …
    … WHEHE (<cond1>) AND (<cond2>) …
  • CRUD : Retrieve
    SELECT <select_list> FROM <table_name>
    [ WHERE <search_condition> ]
    [ ORDER BY <order_expression> [ ASC | DESC ] ];
    Sort results by order expression ascending (default) or descending
    Expression can be chained together
    Examples
    … ORDER BY date DESC …
    … ORDER BY name ASC, surname ASC …
  • CRUD : Retrieve - Example
    SELECT name, height FROM students
    WHERE height>160
    ORDER BY height DESC;
  • CRUD : Retrieve - Example
    SELECT name, height FROM students
    WHERE height>160
    ORDER BY height DESC;
  • CRUD : Retrieve - Practice
    Select every record, sort by STU_ID, ascending
    Select name, surname and height of everyone shorter than 170
    Select everyone heavier than 70, sort by height, descending
  • CRUD : Update
    UPDATE <table_name> SET <field_value_list>
    [ WHERE <search_condition> ];
    Update every record that match the search condition
    We usually use primary key for this
    Examples
    UPDATE students SET name=“Knight”, surname=“Baron” WHERE nisit_id=1;
  • CRUD : Update - Example
    UPDATE students SET name=“Knight”, surname=“Baron”
    WHERE nisit_id=51052744;
  • CRUD : Update - Example
    UPDATE students SET name=“Knight”, surname=“Baron”
    WHERE nisit_id=51052744;
  • CRUD : Update - Practice
    Update the record that you’ve added earlier with different data
  • CRUD : Delete
    DELETE FROM <table_name>
    WHERE <search_condition> ;
    Delete every record that match the search condition
    Examples
    DELETE FROM students WHERE id=1
    DELETE FROM students WHERE (name=“Knight”) AND (surname=“Baron”);
  • CRUD : Delete - Example
    DELETE FROM students
    WHERE (nisit_id=51052345) OR (nisit_id=51052744);
  • CRUD : Delete - Example
    DELETE FROM students
    WHERE (nisit_id=51052345) OR (nisit_id=51052744);
  • CRUD : Delete - Example
    DELETE FROM students
    WHERE (nisit_id=51052345) OR (nisit_id=51052744);
  • CRUD : Delete - Practice
    Delete the record you’ve modified earlier
  • Conclusion
  • Review
    Getting to know Database
    Definition
    Organization
    Practicing with Access 2007
    Database operations
    SQL Syntax
    CRUD Operations
  • Please do not hesitate to ask
    Any Questions?
  • Author: @KnightBaron
    Blog: http://aosekai.net/
    Email: knightbaron@gmail.com
    Thank You!
  • References
    http://databases.about.com/od/specificproducts/a/whatisadatabase.htm
    http://databases.about.com/od/sql/a/sqlfundamentals.htm
    Old database slide from Exceed Camp #6