SlideShare une entreprise Scribd logo
1  sur  20
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

Contenu connexe

Tendances (20)

Introduction to ms access
Introduction to ms accessIntroduction to ms access
Introduction to ms access
 
Sql query [select, sub] 4
Sql query [select, sub] 4Sql query [select, sub] 4
Sql query [select, sub] 4
 
Sql DML
Sql DMLSql DML
Sql DML
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Database Objects
Database ObjectsDatabase Objects
Database Objects
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
Database Connection
Database ConnectionDatabase Connection
Database Connection
 
Sql commands
Sql commandsSql commands
Sql commands
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
Manipulating data
Manipulating dataManipulating data
Manipulating data
 
Ms access
Ms access Ms access
Ms access
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
SQL
SQLSQL
SQL
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
MySQL - Intro to Database
MySQL - Intro to DatabaseMySQL - Intro to Database
MySQL - Intro to Database
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
SQL
SQLSQL
SQL
 

En vedette

Agentes inteligentes
Agentes inteligentesAgentes inteligentes
Agentes inteligentesmenamigue
 
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 productoHacer 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 productoLeobardo Montalvo
 
Planificacion De Procesos y Procesadores
Planificacion De Procesos y ProcesadoresPlanificacion De Procesos y Procesadores
Planificacion De Procesos y ProcesadoresPkacho
 
Unidad No. 5 - Agentes Inteligentes
Unidad No. 5 - Agentes InteligentesUnidad No. 5 - Agentes Inteligentes
Unidad No. 5 - Agentes InteligentesMilton Klapp
 
La interfaz del servidor de directorios
La interfaz del servidor de directoriosLa interfaz del servidor de directorios
La interfaz del servidor de directoriospaola2545
 
Interfaz del Sistema de Archivos
Interfaz del Sistema de ArchivosInterfaz del Sistema de Archivos
Interfaz del Sistema de ArchivosAcristyM
 
Apuntes 1 parcial
Apuntes 1 parcialApuntes 1 parcial
Apuntes 1 parcialeleazar dj
 
Maquinas de turing
Maquinas de turingMaquinas de turing
Maquinas de turingJesus David
 
Sequencing, Alignment and Assembly
Sequencing, Alignment and AssemblySequencing, Alignment and Assembly
Sequencing, Alignment and AssemblyShaun Jackman
 
Planificacion del procesador
Planificacion del procesadorPlanificacion del procesador
Planificacion del procesadorManuel Ceron
 
Preguntas seguridad informática
Preguntas seguridad informáticaPreguntas seguridad informática
Preguntas seguridad informáticamorfouz
 
Estructuras de datos y tipos de datos abstractos
Estructuras de datos y tipos de datos abstractosEstructuras de datos y tipos de datos abstractos
Estructuras de datos y tipos de datos abstractosLuis Lastra Cid
 
Tipos abstractos de datos
Tipos abstractos de datosTipos abstractos de datos
Tipos abstractos de datosJose Armando
 
Entorno de desarrollo integrado de Visual Basic .NET
Entorno de desarrollo integrado de Visual Basic .NETEntorno de desarrollo integrado de Visual Basic .NET
Entorno de desarrollo integrado de Visual Basic .NETNilian Cabral
 
Taller modelo entidad relacion
Taller modelo entidad relacionTaller modelo entidad relacion
Taller modelo entidad relacionBrayan Vega Diaz
 
Redes De Fibra Optica
Redes De Fibra OpticaRedes De Fibra Optica
Redes De Fibra OpticaInma Olías
 
Online real estate management system
Online real estate management systemOnline real estate management system
Online real estate management systemYasmeen Od
 

En vedette (20)

Agentes inteligentes
Agentes inteligentesAgentes inteligentes
Agentes inteligentes
 
Lenguajes
LenguajesLenguajes
Lenguajes
 
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 productoHacer 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
 
Planificacion De Procesos y Procesadores
Planificacion De Procesos y ProcesadoresPlanificacion De Procesos y Procesadores
Planificacion De Procesos y Procesadores
 
Unidad No. 5 - Agentes Inteligentes
Unidad No. 5 - Agentes InteligentesUnidad No. 5 - Agentes Inteligentes
Unidad No. 5 - Agentes Inteligentes
 
La interfaz del servidor de directorios
La interfaz del servidor de directoriosLa interfaz del servidor de directorios
La interfaz del servidor de directorios
 
Interfaz del Sistema de Archivos
Interfaz del Sistema de ArchivosInterfaz del Sistema de Archivos
Interfaz del Sistema de Archivos
 
Apuntes 1 parcial
Apuntes 1 parcialApuntes 1 parcial
Apuntes 1 parcial
 
Maquinas de turing
Maquinas de turingMaquinas de turing
Maquinas de turing
 
Sequencing, Alignment and Assembly
Sequencing, Alignment and AssemblySequencing, Alignment and Assembly
Sequencing, Alignment and Assembly
 
Planificacion del procesador
Planificacion del procesadorPlanificacion del procesador
Planificacion del procesador
 
Archivos Distribuidos
Archivos DistribuidosArchivos Distribuidos
Archivos Distribuidos
 
Preguntas seguridad informática
Preguntas seguridad informáticaPreguntas seguridad informática
Preguntas seguridad informática
 
Tipos de Datos Abstractos.
Tipos de Datos Abstractos.Tipos de Datos Abstractos.
Tipos de Datos Abstractos.
 
Estructuras de datos y tipos de datos abstractos
Estructuras de datos y tipos de datos abstractosEstructuras de datos y tipos de datos abstractos
Estructuras de datos y tipos de datos abstractos
 
Tipos abstractos de datos
Tipos abstractos de datosTipos abstractos de datos
Tipos abstractos de datos
 
Entorno de desarrollo integrado de Visual Basic .NET
Entorno de desarrollo integrado de Visual Basic .NETEntorno de desarrollo integrado de Visual Basic .NET
Entorno de desarrollo integrado de Visual Basic .NET
 
Taller modelo entidad relacion
Taller modelo entidad relacionTaller modelo entidad relacion
Taller modelo entidad relacion
 
Redes De Fibra Optica
Redes De Fibra OpticaRedes De Fibra Optica
Redes De Fibra Optica
 
Online real estate management system
Online real estate management systemOnline real estate management system
Online real estate management system
 

Similaire à Tutorial for using SQL in Microsoft Access

Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statementsSteve Xu
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Amanda Lam
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docxLab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docxVinaOconner450
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAConcentrated Technology
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docxLab 2 Work with Dictionary and Create Relational Database (60 pts.docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docxDIPESH30
 
It203 class slides-unit5
It203 class slides-unit5It203 class slides-unit5
It203 class slides-unit5Matthew Moldvan
 
Automation Of Reporting And Alerting
Automation Of Reporting And AlertingAutomation Of Reporting And Alerting
Automation Of Reporting And AlertingSean Durocher
 
Access tips access and sql part 1 setting the sql scene
Access tips  access and sql part 1  setting the sql sceneAccess tips  access and sql part 1  setting the sql scene
Access tips access and sql part 1 setting the sql scenequest2900
 
Using microsoftaccess1 gettingstarted
Using microsoftaccess1 gettingstartedUsing microsoftaccess1 gettingstarted
Using microsoftaccess1 gettingstartedjcjo05
 
4) databases
4) databases4) databases
4) databasestechbed
 
Introduction4 SQLite
Introduction4 SQLiteIntroduction4 SQLite
Introduction4 SQLiteStanley Huang
 
Introduction to Oracle Database.pptx
Introduction to Oracle Database.pptxIntroduction to Oracle Database.pptx
Introduction to Oracle Database.pptxSiddhantBhardwaj26
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developerAhsan Kabir
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#Michael Heron
 

Similaire à Tutorial for using SQL in Microsoft Access (20)

Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statements
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docxLab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sq lite manager
Sq lite managerSq lite manager
Sq lite manager
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
 
Mule data bases
Mule data basesMule data bases
Mule data bases
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docxLab 2 Work with Dictionary and Create Relational Database (60 pts.docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
 
It203 class slides-unit5
It203 class slides-unit5It203 class slides-unit5
It203 class slides-unit5
 
Sqlite
SqliteSqlite
Sqlite
 
Automation Of Reporting And Alerting
Automation Of Reporting And AlertingAutomation Of Reporting And Alerting
Automation Of Reporting And Alerting
 
Access tips access and sql part 1 setting the sql scene
Access tips  access and sql part 1  setting the sql sceneAccess tips  access and sql part 1  setting the sql scene
Access tips access and sql part 1 setting the sql scene
 
Using microsoftaccess1 gettingstarted
Using microsoftaccess1 gettingstartedUsing microsoftaccess1 gettingstarted
Using microsoftaccess1 gettingstarted
 
4) databases
4) databases4) databases
4) databases
 
Sql2008 (1)
Sql2008 (1)Sql2008 (1)
Sql2008 (1)
 
Introduction4 SQLite
Introduction4 SQLiteIntroduction4 SQLite
Introduction4 SQLite
 
Introduction to Oracle Database.pptx
Introduction to Oracle Database.pptxIntroduction to Oracle Database.pptx
Introduction to Oracle Database.pptx
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#
 

Dernier

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

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