SlideShare a Scribd company logo
3
Most read
7
Most read
20
Most read
SQL and Access
A Guide to Understanding SQL and its application in
Microsoft Access by Maggie McClelland
Why should I learn SQL?
 SQL is a common programming language used
  in many relational databases to manage data
  and records by performing tasks that would be
  time consuming to do by searching the records
  individually.

 Such relational databases are commonly used in
  the field of library and information science, which
  means that in addition to being useful in
  managing data….

 Means employers may want you to know it!
What Is SQL?
 SQL (Structured Query Language) is a
  programming language used for manipulating
  and managing data in relational databases such
  as Microsoft Access, MySQL, or Oracle.

What does SQL do?
  SQL interacts with data in tables by:
      inserting data
      querying data
      updating data
      deleting data
      creating schemas
      controlling access
What do I need to learn it?
You:

 In using it, its helpful to understand how data may
  already interact within databases, but not
  necessary to learning the fundamentals.

Your Computer:

 Relational database software such as Microsoft
  Access, mySQL, or Oracle.
A breakdown of SQL(anguage)
  Two major features
   Statements: affects data and structure (what data is
    in)
   Queries: retrieve data based on programming

  Clauses are the parts of these
   Within clauses may be:
     Expressions: produce the fields of a table
     Predicates: specifies under what conditions action
      is to occur




                                        Image retrieved from Wikipedia.org
TWO TYPES OF
STATEMENTS

 Data Definition Language       Data Manipulation Language

   Manages structure of data      Manages the data in
    tables and indices (where       structures
    data goes)                      ………………………..

   Some Basic Elements:           Some Basic Elements:
    Drop/Create,                    Select, Select…Into, Update,
    Grant/Revoke, Add, and          Delete, Insert…Into
    Alter
TWO TYPES OF
STATEMENTS
Data Definition Language
 Syntax is similar to computer programming
 Basic Statements are Composed of a Element
  part, Object part, and Name part,
  Ex: To create a Table Named „tblBooks‟ it would look
   like this:
   CREATE TABLE Books

 To include an expression to the CREATE TABLE to
 add Book ID and Title fields, insert them in
 brackets and separate out by a comma, all
 within parentheses. This is a common syntax.
  Ex: To add the fields BookID and Title:
   CREATE TABLE tblBooks ([BookID], [Title])
TWO TYPES OF
STATEMENTS
Data Manipulation Language
 Composed of dependent clauses

 Common features of syntax:
  “ “ to contain the data specified
  = to define the data to field relationship
 It is defined by a change to the data, in the
  below case, deletion from tblBooks all records
  which have 1999 in their Year field
  ex. DELETE FROM tblBooks
       WHERE Year = “1999”
Queries
 Queries themselves do not make any changes to
  the data or to the structure.
 Allows user to retrieve data from one or many
 tables.
 Performed with SELECT statement. Returning to our
 example to display all books published in 1999:
  Ex: Select From tblBooks
       Where Year = “1999”
                                      Note: SELECT is nominally
   said to be a statement but it does not ‘affect data
   and/or structure’. It just retrieves.

HOWEVER Queries are what make statements
happen. When combined in access with statements,
they make the changes to data that we desire.
What about Microsoft
Access?
All of these SQL aspects manage and manipulate
your data in be performed in Microsoft Access.

Microsoft Access is usually available with your
basic Microsoft Office package, as such it is widely
used.

 It is mostly suitable for any database under 2 GB.



In the next half, I will show you how to execute in
Microsoft Access common SQL commands.
Proceeding…
 Here is an access database to download if you
 wish to follow along with the tutorial:
  Upon opening it up, look on the left side of your
   screen. Double click on the first table selected,
   Books. This is where we will start from.

 What follows will be a slide of explanations and
 then a video. You can pause or stop the videos
 at any time and may jump around using the
 progress bar at the bottom of the video.

 These videos have no sound.
                                    Continuing on…
Queries
Simple SELECT query, designed to
  What follows is a simple „select‟
   filter records from a table.
 From the menu, next to Home, select Create.
 Go to the last section of selections, marked other.
   Select Query Design.
 Once you reach the Query Design screen you will be
   prompted by a window. Cancel this out. In the
   upper left corner under the round Windows
   Button, is a button that says SQL view. Select this.
 For a simple search calling all records from the Books
   table, enter:
           Select *
           FROM Books
 Going back to the upper left corner next to SQL view
   is another button that is an exclamation mark and
   says Run. Select this.         Play video here.
Queries
More complex SELECT
  To execute a query that pulls out specific
   information, we‟ll have to add a WHERE clause.

  Lets look for all books published in the year 1982.
   To do this we will be looking at all records in the
   Books table that have 1982 in the Year field.
  To go back to the screen where you can edit your SQL query, simply
     go to the button under your round windows button. There should be
     a down arrow to select other options.
  Click this and select your SQL view.
  Now that you are in SQL view, add to what you have so it reads:
                              Select *
                              FROM Books
                              Where Year = 1982
  Again, select Run when done.
                                                  Play video here.
Queries
Even More complex
SELECT
  Lets say that we want to combine two tables.
   Maybe we want to find all books published in
   1982 that were sent away for rebinding.

  Table named Actions this. In this table, Object
   specified in each record is linked to the BookID in
   the Books table. To draw these two together in
   our search we will use an INNER JOIN, specifying
   with ON which two of those records are linked.

  Because we have two tables now, we have to
   refer to the fields we are interested in as
   table.field
Queries
Even More complex
SELECT cont…
  To do this, return to your SQL query edit screen
   and enter:
    SELECT *
    FROM Books INNER JOIN Actions
    ON Actions.Object=Books.BookID
    WHERE Year = 1982


  Run this.


                               Play video here.
Changing Data
 Now we may want to change the data. In
  Microsoft Access, this is still done through the
  same Screen where we were entering SQL
  before.

 The most useful may be the UPDATE and the
  DELETE statements, which do exactly what they
  say. These are what we will execute.
Update Statements
 Say that you want to update the Authors field in the Books
  table with (LOC) following the names to show that they
  follow LOC name authority.

 We will use the UPDATE statement and following SET
  establish an expression to update the field.

 To do this return to your SQL query edit screen and enter:
    UPDATE Books
    SET Author=Author + " (LOC)“

                                                     Note: the + , this
      means add the following onto what is existing; we use “ “
      because what is inside these is text entered into the table‟s field.
                                          Play video here.
Delete Statements
 Lets say that our collection deacessioned all
  books made before 1970 and we want to delete
  these from our files.
 To do this return to your SQL query edit screen
  and enter:
       DELETE *
       FROM Books
       WHERE Year <1970

 Notice how we used < instead of = to find entries
  with values smaller than the number 1970.
                              Play video here.
Congratulations!
By now, you should have an understanding of SQL
  and a basic knowledge of how to use SQL in
  Microsoft Access

The best way to learn a new technology is to play
  with it, I encourage you to do so. Before you
  know it, you will be a pro!
Helpful Sites
 http://msdn.microsoft.com/en-
  us/library/bb177893%28v=office.12%29.aspx

 http://download.oracle.com/docs/cd/B28359_0
  1/appdev.111/b28370/static.htm

 http://w3schools.com/sql/sql_syntax.asp
Ad

Recommended

Word 2016
Word 2016
Bibhuti Behera
 
Visual Basic Controls ppt
Visual Basic Controls ppt
Ranjuma Shubhangi
 
Scratch Animation
Scratch Animation
Anjan Mahanta
 
Swing and AWT in java
Swing and AWT in java
Adil Mehmoood
 
Visual basic
Visual basic
umesh patil
 
SQLITE Android
SQLITE Android
Sourabh Sahu
 
Advanced Excel ppt
Advanced Excel ppt
Sudipta Mazumder
 
Sql Basics | Edureka
Sql Basics | Edureka
Edureka!
 
Object Oriented Programming using C++(UNIT 1)
Object Oriented Programming using C++(UNIT 1)
Dr. SURBHI SAROHA
 
SQL Joins With Examples | Edureka
SQL Joins With Examples | Edureka
Edureka!
 
All ms word 2013
All ms word 2013
Ashan Dissanayake
 
Ms access
Ms access
Pooja Vaidhya
 
Ms excel basic about Data, graph and pivot table
Ms excel basic about Data, graph and pivot table
Alomgir Hossain
 
Learn C# Programming - Variables & Constants
Learn C# Programming - Variables & Constants
Eng Teong Cheah
 
Ms office 2003
Ms office 2003
Hepsijeba
 
Introduction To Dotnet
Introduction To Dotnet
SAMIR BHOGAYTA
 
Ms access 2010
Ms access 2010
Alsufaacademy
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Charts
dnbakhan
 
Ms Word 2010 Training In Ambala ! Batra Computer Centre
Ms Word 2010 Training In Ambala ! Batra Computer Centre
jatin batra
 
Chapter 1 introduction to computers
Chapter 1 introduction to computers
haider ali
 
Introduction to Visual Basic
Introduction to Visual Basic
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
Input output statement
Input output statement
sunilchute1
 
Presentation on Ms-office 2010
Presentation on Ms-office 2010
Sapna7412
 
Basic Computer Programming
Basic Computer Programming
Allen de Castro
 
03 Excel formulas and functions
03 Excel formulas and functions
Buffalo Seminary
 
Microsoft Excel Tutorial
Microsoft Excel Tutorial
Kristine Tiongco-Rimpa
 
Microsoft word for beginners
Microsoft word for beginners
FritzOsongco1
 
Declaration of variables
Declaration of variables
Maria Stella Solon
 
Agentes inteligentes
Agentes inteligentes
menamigue
 
Lenguajes
Lenguajes
TERE FERNÁNDEZ
 

More Related Content

What's hot (20)

Object Oriented Programming using C++(UNIT 1)
Object Oriented Programming using C++(UNIT 1)
Dr. SURBHI SAROHA
 
SQL Joins With Examples | Edureka
SQL Joins With Examples | Edureka
Edureka!
 
All ms word 2013
All ms word 2013
Ashan Dissanayake
 
Ms access
Ms access
Pooja Vaidhya
 
Ms excel basic about Data, graph and pivot table
Ms excel basic about Data, graph and pivot table
Alomgir Hossain
 
Learn C# Programming - Variables & Constants
Learn C# Programming - Variables & Constants
Eng Teong Cheah
 
Ms office 2003
Ms office 2003
Hepsijeba
 
Introduction To Dotnet
Introduction To Dotnet
SAMIR BHOGAYTA
 
Ms access 2010
Ms access 2010
Alsufaacademy
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Charts
dnbakhan
 
Ms Word 2010 Training In Ambala ! Batra Computer Centre
Ms Word 2010 Training In Ambala ! Batra Computer Centre
jatin batra
 
Chapter 1 introduction to computers
Chapter 1 introduction to computers
haider ali
 
Introduction to Visual Basic
Introduction to Visual Basic
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
Input output statement
Input output statement
sunilchute1
 
Presentation on Ms-office 2010
Presentation on Ms-office 2010
Sapna7412
 
Basic Computer Programming
Basic Computer Programming
Allen de Castro
 
03 Excel formulas and functions
03 Excel formulas and functions
Buffalo Seminary
 
Microsoft Excel Tutorial
Microsoft Excel Tutorial
Kristine Tiongco-Rimpa
 
Microsoft word for beginners
Microsoft word for beginners
FritzOsongco1
 
Declaration of variables
Declaration of variables
Maria Stella Solon
 
Object Oriented Programming using C++(UNIT 1)
Object Oriented Programming using C++(UNIT 1)
Dr. SURBHI SAROHA
 
SQL Joins With Examples | Edureka
SQL Joins With Examples | Edureka
Edureka!
 
Ms excel basic about Data, graph and pivot table
Ms excel basic about Data, graph and pivot table
Alomgir Hossain
 
Learn C# Programming - Variables & Constants
Learn C# Programming - Variables & Constants
Eng Teong Cheah
 
Ms office 2003
Ms office 2003
Hepsijeba
 
Introduction To Dotnet
Introduction To Dotnet
SAMIR BHOGAYTA
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Charts
dnbakhan
 
Ms Word 2010 Training In Ambala ! Batra Computer Centre
Ms Word 2010 Training In Ambala ! Batra Computer Centre
jatin batra
 
Chapter 1 introduction to computers
Chapter 1 introduction to computers
haider ali
 
Input output statement
Input output statement
sunilchute1
 
Presentation on Ms-office 2010
Presentation on Ms-office 2010
Sapna7412
 
Basic Computer Programming
Basic Computer Programming
Allen de Castro
 
03 Excel formulas and functions
03 Excel formulas and functions
Buffalo Seminary
 
Microsoft word for beginners
Microsoft word for beginners
FritzOsongco1
 

Viewers also liked (20)

Agentes inteligentes
Agentes inteligentes
menamigue
 
Lenguajes
Lenguajes
TERE FERNÁNDEZ
 
Hacer un programa que calcule la suma de dos números y su producto
Hacer un programa que calcule la suma de dos números y su producto
Leobardo Montalvo
 
Planificacion De Procesos y Procesadores
Planificacion De Procesos y Procesadores
Pkacho
 
Unidad No. 5 - Agentes Inteligentes
Unidad No. 5 - Agentes Inteligentes
Milton Klapp
 
La interfaz del servidor de directorios
La interfaz del servidor de directorios
paola2545
 
Interfaz del Sistema de Archivos
Interfaz del Sistema de Archivos
AcristyM
 
Apuntes 1 parcial
Apuntes 1 parcial
eleazar dj
 
Maquinas de turing
Maquinas de turing
Jesus David
 
Sequencing, Alignment and Assembly
Sequencing, Alignment and Assembly
Shaun Jackman
 
Planificacion del procesador
Planificacion del procesador
Manuel Ceron
 
Archivos Distribuidos
Archivos Distribuidos
Proyecto Bonnzai
 
Preguntas seguridad informática
Preguntas seguridad informática
morfouz
 
Tipos de Datos Abstractos.
Tipos de Datos Abstractos.
Alvaro Andrade Enriquez
 
Estructuras de datos y tipos de datos abstractos
Estructuras de datos y tipos de datos abstractos
Luis Lastra Cid
 
Tipos abstractos de datos
Tipos abstractos de datos
Jose Armando
 
Entorno de desarrollo integrado de Visual Basic .NET
Entorno de desarrollo integrado de Visual Basic .NET
Nilian Cabral
 
Taller modelo entidad relacion
Taller modelo entidad relacion
Brayan Vega Diaz
 
Redes De Fibra Optica
Redes De Fibra Optica
Inma Olías
 
Online real estate management system
Online real estate management system
Yasmeen Od
 
Agentes inteligentes
Agentes inteligentes
menamigue
 
Hacer un programa que calcule la suma de dos números y su producto
Hacer un programa que calcule la suma de dos números y su producto
Leobardo Montalvo
 
Planificacion De Procesos y Procesadores
Planificacion De Procesos y Procesadores
Pkacho
 
Unidad No. 5 - Agentes Inteligentes
Unidad No. 5 - Agentes Inteligentes
Milton Klapp
 
La interfaz del servidor de directorios
La interfaz del servidor de directorios
paola2545
 
Interfaz del Sistema de Archivos
Interfaz del Sistema de Archivos
AcristyM
 
Apuntes 1 parcial
Apuntes 1 parcial
eleazar dj
 
Maquinas de turing
Maquinas de turing
Jesus David
 
Sequencing, Alignment and Assembly
Sequencing, Alignment and Assembly
Shaun Jackman
 
Planificacion del procesador
Planificacion del procesador
Manuel Ceron
 
Preguntas seguridad informática
Preguntas seguridad informática
morfouz
 
Estructuras de datos y tipos de datos abstractos
Estructuras de datos y tipos de datos abstractos
Luis Lastra Cid
 
Tipos abstractos de datos
Tipos abstractos de datos
Jose Armando
 
Entorno de desarrollo integrado de Visual Basic .NET
Entorno de desarrollo integrado de Visual Basic .NET
Nilian Cabral
 
Taller modelo entidad relacion
Taller modelo entidad relacion
Brayan Vega Diaz
 
Redes De Fibra Optica
Redes De Fibra Optica
Inma Olías
 
Online real estate management system
Online real estate management system
Yasmeen Od
 
Ad

Similar to Tutorial for using SQL in Microsoft Access (20)

SQL report
SQL report
Ahmad Zahid
 
8.) ms-access_ppt-CA-course-itt-programme.pptx
8.) ms-access_ppt-CA-course-itt-programme.pptx
tiktok116
 
Structure query language, database course
Structure query language, database course
yunussufyan2024
 
SQl data base management and design
SQl data base management and design
franckelsania20
 
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
dgfs55437
 
Sql slid
Sql slid
pacatarpit
 
Sql a practical introduction
Sql a practical introduction
Hasan Kata
 
Sql a practical introduction
Sql a practical introduction
sanjaychauhan689
 
Database Architecture and Basic Concepts
Database Architecture and Basic Concepts
Tony Wong
 
SQL200.1 Module 1
SQL200.1 Module 1
Dan D'Urso
 
MY SQL
MY SQL
sundar
 
Db1 lecture4
Db1 lecture4
Sherif Gad
 
Relational Database Language.pptx
Relational Database Language.pptx
Sheethal Aji Mani
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
PavithSingh
 
Sql a practical_introduction
Sql a practical_introduction
investnow
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
Newyorksys.com
 
SQL200A Microsoft Access SQL Design
SQL200A Microsoft Access SQL Design
Dan D'Urso
 
SQL
SQL
Shyam Khant
 
SQL_Part1
SQL_Part1
Rick Perry
 
CE 279 - WRITING SQL QUERIES umat edition.ppt
CE 279 - WRITING SQL QUERIES umat edition.ppt
minusahsaaka
 
8.) ms-access_ppt-CA-course-itt-programme.pptx
8.) ms-access_ppt-CA-course-itt-programme.pptx
tiktok116
 
Structure query language, database course
Structure query language, database course
yunussufyan2024
 
SQl data base management and design
SQl data base management and design
franckelsania20
 
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
dgfs55437
 
Sql a practical introduction
Sql a practical introduction
Hasan Kata
 
Sql a practical introduction
Sql a practical introduction
sanjaychauhan689
 
Database Architecture and Basic Concepts
Database Architecture and Basic Concepts
Tony Wong
 
SQL200.1 Module 1
SQL200.1 Module 1
Dan D'Urso
 
Relational Database Language.pptx
Relational Database Language.pptx
Sheethal Aji Mani
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
PavithSingh
 
Sql a practical_introduction
Sql a practical_introduction
investnow
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
Newyorksys.com
 
SQL200A Microsoft Access SQL Design
SQL200A Microsoft Access SQL Design
Dan D'Urso
 
CE 279 - WRITING SQL QUERIES umat edition.ppt
CE 279 - WRITING SQL QUERIES umat edition.ppt
minusahsaaka
 
Ad

Recently uploaded (20)

Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 

Tutorial for using SQL in Microsoft Access

  • 1. SQL and Access A Guide to Understanding SQL and its application in Microsoft Access by Maggie McClelland
  • 2. Why should I learn SQL?  SQL is a common programming language used in many relational databases to manage data and records by performing tasks that would be time consuming to do by searching the records individually.  Such relational databases are commonly used in the field of library and information science, which means that in addition to being useful in managing data….  Means employers may want you to know it!
  • 3. What Is SQL?  SQL (Structured Query Language) is a programming language used for manipulating and managing data in relational databases such as Microsoft Access, MySQL, or Oracle. What does SQL do?  SQL interacts with data in tables by:  inserting data  querying data  updating data  deleting data  creating schemas  controlling access
  • 4. What do I need to learn it? You:  In using it, its helpful to understand how data may already interact within databases, but not necessary to learning the fundamentals. Your Computer:  Relational database software such as Microsoft Access, mySQL, or Oracle.
  • 5. A breakdown of SQL(anguage)  Two major features  Statements: affects data and structure (what data is in)  Queries: retrieve data based on programming  Clauses are the parts of these  Within clauses may be:  Expressions: produce the fields of a table  Predicates: specifies under what conditions action is to occur Image retrieved from Wikipedia.org
  • 6. TWO TYPES OF STATEMENTS  Data Definition Language  Data Manipulation Language  Manages structure of data  Manages the data in tables and indices (where structures data goes) ………………………..  Some Basic Elements:  Some Basic Elements: Drop/Create, Select, Select…Into, Update, Grant/Revoke, Add, and Delete, Insert…Into Alter
  • 7. TWO TYPES OF STATEMENTS Data Definition Language  Syntax is similar to computer programming  Basic Statements are Composed of a Element part, Object part, and Name part,  Ex: To create a Table Named „tblBooks‟ it would look like this: CREATE TABLE Books  To include an expression to the CREATE TABLE to add Book ID and Title fields, insert them in brackets and separate out by a comma, all within parentheses. This is a common syntax.  Ex: To add the fields BookID and Title: CREATE TABLE tblBooks ([BookID], [Title])
  • 8. TWO TYPES OF STATEMENTS Data Manipulation Language  Composed of dependent clauses  Common features of syntax:  “ “ to contain the data specified  = to define the data to field relationship  It is defined by a change to the data, in the below case, deletion from tblBooks all records which have 1999 in their Year field  ex. DELETE FROM tblBooks WHERE Year = “1999”
  • 9. Queries  Queries themselves do not make any changes to the data or to the structure.  Allows user to retrieve data from one or many tables.  Performed with SELECT statement. Returning to our example to display all books published in 1999:  Ex: Select From tblBooks Where Year = “1999” Note: SELECT is nominally said to be a statement but it does not ‘affect data and/or structure’. It just retrieves. HOWEVER Queries are what make statements happen. When combined in access with statements, they make the changes to data that we desire.
  • 10. What about Microsoft Access? All of these SQL aspects manage and manipulate your data in be performed in Microsoft Access. Microsoft Access is usually available with your basic Microsoft Office package, as such it is widely used.  It is mostly suitable for any database under 2 GB. In the next half, I will show you how to execute in Microsoft Access common SQL commands.
  • 11. Proceeding…  Here is an access database to download if you wish to follow along with the tutorial:  Upon opening it up, look on the left side of your screen. Double click on the first table selected, Books. This is where we will start from.  What follows will be a slide of explanations and then a video. You can pause or stop the videos at any time and may jump around using the progress bar at the bottom of the video.  These videos have no sound. Continuing on…
  • 12. Queries Simple SELECT query, designed to  What follows is a simple „select‟ filter records from a table. From the menu, next to Home, select Create. Go to the last section of selections, marked other. Select Query Design. Once you reach the Query Design screen you will be prompted by a window. Cancel this out. In the upper left corner under the round Windows Button, is a button that says SQL view. Select this. For a simple search calling all records from the Books table, enter: Select * FROM Books Going back to the upper left corner next to SQL view is another button that is an exclamation mark and says Run. Select this. Play video here.
  • 13. Queries More complex SELECT  To execute a query that pulls out specific information, we‟ll have to add a WHERE clause.  Lets look for all books published in the year 1982. To do this we will be looking at all records in the Books table that have 1982 in the Year field. To go back to the screen where you can edit your SQL query, simply go to the button under your round windows button. There should be a down arrow to select other options. Click this and select your SQL view. Now that you are in SQL view, add to what you have so it reads: Select * FROM Books Where Year = 1982 Again, select Run when done. Play video here.
  • 14. Queries Even More complex SELECT  Lets say that we want to combine two tables. Maybe we want to find all books published in 1982 that were sent away for rebinding.  Table named Actions this. In this table, Object specified in each record is linked to the BookID in the Books table. To draw these two together in our search we will use an INNER JOIN, specifying with ON which two of those records are linked.  Because we have two tables now, we have to refer to the fields we are interested in as table.field
  • 15. Queries Even More complex SELECT cont…  To do this, return to your SQL query edit screen and enter: SELECT * FROM Books INNER JOIN Actions ON Actions.Object=Books.BookID WHERE Year = 1982 Run this. Play video here.
  • 16. Changing Data  Now we may want to change the data. In Microsoft Access, this is still done through the same Screen where we were entering SQL before.  The most useful may be the UPDATE and the DELETE statements, which do exactly what they say. These are what we will execute.
  • 17. Update Statements  Say that you want to update the Authors field in the Books table with (LOC) following the names to show that they follow LOC name authority.  We will use the UPDATE statement and following SET establish an expression to update the field.  To do this return to your SQL query edit screen and enter: UPDATE Books SET Author=Author + " (LOC)“ Note: the + , this means add the following onto what is existing; we use “ “ because what is inside these is text entered into the table‟s field. Play video here.
  • 18. Delete Statements  Lets say that our collection deacessioned all books made before 1970 and we want to delete these from our files.  To do this return to your SQL query edit screen and enter: DELETE * FROM Books WHERE Year <1970  Notice how we used < instead of = to find entries with values smaller than the number 1970. Play video here.
  • 19. Congratulations! By now, you should have an understanding of SQL and a basic knowledge of how to use SQL in Microsoft Access The best way to learn a new technology is to play with it, I encourage you to do so. Before you know it, you will be a pro!
  • 20. Helpful Sites  http://msdn.microsoft.com/en- us/library/bb177893%28v=office.12%29.aspx  http://download.oracle.com/docs/cd/B28359_0 1/appdev.111/b28370/static.htm  http://w3schools.com/sql/sql_syntax.asp