Querying is the process of looking to see what information is already entered in the Banner database. Suppose you want to find all of the Fall 2000 semester’s charges for a student. You know that his last name is Smith, but you can’t remember his first name. You can query the database for all students with the last name of Smith. Banner will display all students with a last name of Smith.

In Banner, querying for records is as easy as these steps:

  1. Go to a form that holds the type of information you’re looking for.
  2. Prepare the form for a new query (usually, this means selecting Enter Query from the Query pull-down menu).
  3. Enter the criteria that you want Banner to match (for instance, the name Smith in the Last Name field of the form).
  4. Execute the query (usually, this means selecting Execute Query from the Query pull-down menu).

A query in Banner is a structured question written in SQL. To write a good query, you need to know what data you want and where it is. You also need to know the proper SQL syntax.

When you make a query, the data is NEVER changed. You cannot hurt the data by anything you put in a query.

A join is a query that combines data from two tables.

A query has five main clauses:

  • SELECT
  • FROM
  • WHERE
  • GROUP BY
  • ORDER

Use the SELECT clause to list the table columns that you want to see. List all the columns in one SELECT clause (even if the columns are from different tables), and use a comma to separate the column names. For example:

SELECT COLUMN, COLUMN, COLUMN

The SELECT clause is the one place you can specify the order in which columns will appear. When you use a SELECT clause, list columns in the sequence you want them to appear in your report.

Use the FROM clause for the table name. In a query on more than one table, list all the table names and separate them with commas. For example:

FROM TABLE, TABLE, TABLE

The WHERE clause is optional. If you don't use a WHERE clause, all the rows of the specified table or tables are selected. Use the WHERE clause to look at your data more closely. For example, suppose you want to look at application terms, but you want to eliminate the current term. You could accomplish this by this WHERE clause:

WHERE App_Term NOT IN (2000)

The GROUP BY clause is optional. The GROUP BY clause provides a way for you to summarize data. For example, if you want to look at all the female students in a specific term, you could use this method:

WHERE App_Term = 1999 GROUP BY Gender

The ORDER BY clause is optional. Use the ORDER BY clause to list columns used for sorting. If you don't use the ORDER BY clause, Banner will return the rows in no specific order.

Wait a minute! Are you querying on a date field? Remember that you have to enter all four digits of the year! If you enter just two digits, Banner will add zeroes to the century, so you might be querying on the year 0099 instead of 1999! There are some exceptions, however, so you should read the section on "Date Queries" in Chapter Two of your user manual for specific information.

Querying on a date field? Does the time stamp say "00:00:00?" If so, you’ll probably get a message that says no records match your query. If this happens, you can use a relational operator with an earlier and later date in your query. Instead of asking Banner for records that match 26-JUN-2000, you can ask for records that match the dates >25-JUN-2000 and <27-JUN-2000.

Psst...want some shortcuts for those query functions?
I can do that.

Do you know what a wildcard is? It’s a character that you can substitute for one or more unknown letters or number in a query. For example, let’s say that you want to find all students with last names that begin with the letter S. On the appropriate Banner form, you would perform a query on the Last Name field by entering S%.

Use the % wildcard character if you are querying for more than one unknown character. The _ wildcard character substitutes for a single unknown character.

And that's not the only shortcut -- how 'bout some keyboard shortcuts?

Function

Keyboard Shortcut

What It Does

Enter Query

F7

Prepares form for new query

Execute Query

F8

Tells Banner to retrieve the matching records

Count Hits

Shift-F2

Displays the number of records that match your query

Want to read some detailed instructions about how to use queries? Look at Chapter Two of your Banner product's user manual.

Do you want to learn more about how to use SQL to locate data in Banner? Take a look at the Banner General Technical Reference Manual.