• Aucun résultat trouvé

Query in Microsoft Access

N/A
N/A
Protected

Academic year: 2022

Partager "Query in Microsoft Access"

Copied!
41
0
0

Texte intégral

(1)

Query in Microsoft

Access

(2)

Lesson plan

• Expression in Microsoft Access

• Create a query

(3)

Expression in Microsoft Access

• An expression is a combination of

data fields, operators, values, and/or functions

Data fields: column names/attribute names that are put inside[ ] such as [Price]

Values: number (Int, Double), date…

Functions: Math (e.g abs), String(len)

(4)

Expression in Microsoft Access

Algebraic/Arithmetic Expressions : Contains arithmetic operators:

+ add

- Subtract

* Multiplication

/ Division

Mod: modulo

^ raise to a power

\ divide one integer by another

(5)

Expression in Microsoft Access

Algebraic/Arithmetic Expressions : Example:

(6)

Expression in Microsoft Access

Boolean Expressions :

Contains comparison/relational and/or boolean operators:

Comparison operators:

< less than

<= less than or equal to

= equal to

<> Not equal to

> Greater

>= Greater than or equal to

(7)

Expression in Microsoft Access

Example:

(8)

Expression in Microsoft Access

Boolean Expressions : Boolean operators:

and logical AND

or logical OR

NOT Logical NOT

Xor Exclusive OR

(9)

Expression in Microsoft Access

Example

(10)

Expression in Microsoft Access

Other operators:

Is: Example: Is null

In: determine whether a string value is a member of a list of values

Like: determine whether a string value

begins with one or more characters, use with * or ?

E.g [firstname] like “Jon*”

Between:determine whether a numeric or date value lies within a specific

range of values

E.g between 1 and 7

(11)

Expression in Microsoft Access

Example

(12)

Expression in Microsoft Access

Functions:

Math

String (Text manipulation) Financial

Data & time

(13)

Expression in Microsoft Access

(14)

Query in Microsoft Access

Is used to select a group of records that meet the criteria a user specifies (VIEW)

Combine information from different tables and provide a unified view of related items

(15)

Query in Microsoft Access

Example: Create a query using Query design window

Query -> Query by Design View

(16)

Query in Microsoft Access

Select tables being included in a query Select fields being included in a query Specify the criteria

(17)

Query in Microsoft Access

Sorting the display

(18)

Query in Microsoft Access

Preventing updates to the query result set Why needed?: preventing users from

updating the results of the queries

(19)

Query in Microsoft Access

Types of queries

Select: as shown in previous slides

Action: such as create a table, delete, update

Parameter: repeatedly use a query and make only a simple changes to its criteria

Crosstab: summarize data from one or more tables in the form of spreadsheet

(20)

Action queries

Create Query by Design View -> Right click mouse

(21)

Action queries

(22)

Parameter queries

(23)

Parameter queries

(24)

Queries – Practice

• Please try the first 11 queries in project 1 part 3.

• If done, please try queries from 12-14

(25)

Crosstab queries

Join tables

Create Crosstable queries

(26)

Join tables

– How to join multiple tables

Identify relationships among tables

Four types of joins:

Equi-joins Outer joins Self-joins Theta joins

(27)

Equi-joins (inner joins)

Display all the records in one table that have corresponding records in another table

Example:

(28)

Equi-joins (inner joins)

(29)

Equi-joins (inner joins)

(30)

Equi-joins (inner joins)

….

(31)

Designing Nested Queries

Establish the relationship between a query and a table

(32)

Designing Nested Queries

Establish the relationship between a query and a table

(33)

Designing Nested Queries

(34)

Designing Nested Queries

(35)

Designing Nested Queries

(36)

Outer joins

Display records in one member of the join, regardless of whether corresponding

records exist on the other side of the join

(37)

Outer joins

(38)

Self joins

Display rows for which values of two columns in the same table are equal

(39)

Theta joins

Relate data by using NOT equal comparison rather than equal comparison

(40)

Theta joins

Relate data by using NOT equal comparison rather than equal comparison

(41)

Practice

Try queries 10-20 in the project part 3

Références

Documents relatifs

Since such atoms are not given as input, we address the problem of (e ffi ciently) computing such restricting atoms within an approximate query answering algorithm after showing

For combined complexity, the membership problem for universal UCQ- solutions is 2E XP T IME -complete for Horn-ALCHI and Horn-ALCI; E XP T IME -com- plete for Horn-ALCH,

We would then want to boost the weight of query words that are topically similar to “m´ edecine” but that occur in other documents (it would be no point in selecting words that occur

Different users may cooperate on the same query or set of queries, thus, the Optique solution aims at providing (at least) three kind of in- terfaces to formulate the query

Consequently, given the two corpora novel information identification problem is then reduced to the problem of de- tecting outstanding terms associations present in the sample corpus

At present we have several directions for our future research. The spatial view c'oncept has to be defined exhaustively and formally. In partieular, spatial view

Basi- cally, Von-QBE (stands for Virtualized Ontology Query By Example) addresses the problem: Given a natural language question Q N and an underlying ontology O, its goal is

The current paper presents an extension to the EMF-IncQuery model query tool that lets users point out, using familiar concrete syntax, an example of what the query results should