• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/79

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

79 Cards in this Set

  • Front
  • Back

The Oracle server stores information about all tables in a special set of relational tables called the _____.

data dictionary

T/F The definition of a table includes information like table name, table owner, details about the columns that comprise it, and its physical storage size on disk. This information is also referred to as metadata.

True

How is the structural metadata of a table obtained?

by querying the database for the list of columns that comprise it using the DESCRIBE command.

What is the syntax for DESCRIBE?

DESC[RIBE].tablename




The DESCRIBE keyword can be shortened to DESC.




If you are describing a table that belongs to the schema to which you have connected, the portion of the command may be omitted.

T/F The DESCRIBE keyword can be shortened to DESC.

True

All tables belong to a ________ or _______.

schema, owner

DUAL belongs to what schema?

the SYS schema

Numeric columns are often specified as NUMBER(p,s). What does (p,s) stand for?

P= precision


S= scale

If a column has a data type of: NUMBER(8,2) what does that mean?

This means that the values stored in this column can have at most 8 digits. Of these 8 digits, 2 must be to the right of the decimal point.

What do VARCHAR2(length) data type columns store?

They store variable length alphanumeric character data, where length determines the maximum number of characters a column can contain.

What does it mean when a column has a data type of VARCHAR2(20)?

It means that words can be store up to 20 characters. If this column contains no data or its content is less than 20 characters, if will not necessarily use the same space as it would use to store a name that is 20 characters long.

What does the CHAR(size) column data type specify?

The CHAR(size) column data type specifies fixed length columns where row space is preallocated to contain a fixed number of characters regardless of its contents.

T/F CHAR(size) column data type is used more commonly than VARCHAR2.

False. CHAR is much less commonly used than VARCHAR2.

What does the DATE data type store?

DATE stores a moment in time with precision including day, month, year, hours, minutes, and seconds.

What does the TIMESTAMP data type store?

TIMESTAMP stores the same information as DATE but is also capable of storing fractional seconds.

What are Binary Large Objects (BLOBS) used for?

BLOBs are used for storing binary data like music or video data.

_____ refers to an absence of data.

NULL

T/F Blank spaces do not count as NULL since they are present in the row and have some length even though they are not visible.

True.

T/F Any column of data which is restricted by the NOT NULL constraint when the table is created must contain some data.

True.

In relational theory, relations, or tables, are operated on by a formal language called ______.

relational algebra

What three concepts from relational theory encompass the capability of the SELECT statement?

1. projection


2. selection


3. joining

What is projection?

Projection refers to the restriction of attributes (columns) selected from a relation or table.

What is selection?

Selection refers to the restriction of the tuples or rows selected from a relation (table). It is often not desirable to retrieve every row from a table.

What is joining?

Joining, as a relational concept, refers to the interaction of tables with each other in a query.

T/F In its most primitive form, the SELECT statement supports the projection of columns and the creation of arithmetic, character, and date expressions.

True

What is the basic SELECT statement syntax?

SELECT* |{[DISTINCT] column|expression [alias],..}


FROM table

T/F When using the commands, the case of the reserved words in your query statement does not matter.

True

T/F The reserved words (or special keywords) can be used as column names or other database object names.

False

A SELECT statement always comprises _____ or more clauses.

two



What are the two mandatory clauses in the SELECT statement?

SELECT and FROM

SELECT * means what?

Select all possible columns

What does the FROM clause specify?

Which table to query to fetch the columns requested in the SELECT clause.

What is an alias?

An alias is an alternative name for referencing a column or expression.

What are alias typically used for?

Displaying output in a user-friendly manner. They also serve as shorthand when referring to columns or expressions to reduce typing.

What does DISTINCT do?

DISTINCT eliminates all duplicate rows from the results set.




An important feature of the DISTINCT keyword is the elimination of duplicate values from combinations of columns.

T/F It is a matter of personal taste about the case in which SQL statements are submitted to the database.

True. You can write your SQL statements in upper or lower case.

T/F SQL reserved words must be specified in uppercase.

FALSE. This is a common misconception.

What is the one caveat regarding case sensitivity?

When interacting with literal values, case does matter.

Metadata about different database objects is stored by default in ______case in the data dictionary.

Upper

_________are generally used as SQL statement terminators.

Semicolons

Individual statements in SQL scripts are commonly terminated by a ____ _____ (or carriage return) and a forward slash on the next line, instead of a semicolon.

line break

_______ always requires a statement terminator, and usually a semicolon is used.

SQL*Plus

________ does not require a statement terminator if only a single statement is present, but it will not object if one is used.

SQL Developer

T/F It is entirely acceptable for a SQL statement to either be written on one line or to span multiple lines as long as no words in the statement span multiple lines.

True.

You want to construct and execute queries against tables stored in an Oracle database. Are you confined to using SQL*Plus or SQL Developer?

No. Oracle provides SQL*Plus and SQL Developer as free tools to create and execute queries. There are numerous tools available from Oracle and other third-party vendors that provide an interface to the tables stored in an Oracle database.

To explore your database environment further, you would like a list of tables, owned by your current schema, available for you to query. How do you interrogate the database dictionary to provide this metadata?

The data dictionary is a set of tables and views of other tables that can be queried via SQL. The statement SELECT TABLE_NAME from USER_TABLES; queries the database dictionary for a list of table names that belong to the current user.

When querying the jobs table for every row containing just the JOB_ID and MAX_SALARY columns, is a projection, selection, or join being performed?

A projection is performed since the columns in the JOBS table have been restricted to the JOB_ID and MAX_SALARY columns.

An __________ is usually made up of an operation being performed on one or more column values.

expression.

The operators that can act upon column values to form an expression depend on what?

The data type of the column.

What are the operators that can act upon column values to form an expression?

1. The 4 cardinal arithmetic operators (addition, subtraction, multiplication, and division) for numeric columns.


2. The concatenation operator for character or string columns.


3. The addition and subtraction operators for date and timestamp columns.

What is the operator precedence when more than one operator occurs in an expression?

- Round brackets have the highest precedence.


- Division and multiplication operations are nest in the hierarchy


- Addition and subtraction have the lowest precedence.

Operations with the same level of precedence are evaluated from ____ to ____.

Left to right

_________ is an alternate name for a column or an expression.

An alias

The double pipe symbols || represent the _____. q

Character concatenation operator.

What does the character concatenation operator do?

It is used to join character expressions or columns together to create a larger character expression. Columns of a table may be linked to each other or to strings of literal characters to create one resultant character expression.

What are literal values?

These values refer to numeric, character, or date and time values found in SELECT clauses that do not originate from any database object.

The ____ ____ allows literal expressions to be selected from it for processing and returns the expression results in its single row.

dual table

Regarding literals, How are words that contain single quotation marks dealt with?

Two ways:


1. The most popular way is to add an additional single quotation mark next to each naturally occurring single quotation mark in the character string.


2. The alternative quote (q) operator

What is the alternative quote (q) operator?

- It enables you to choose from a set of possible pairs of wrapping symbols for character literals as alternatives to the single quote symbols.

What are the options for the alternative quote operator?

The options are any single-byte or multibyte character or the four brackets: (round brackets), {curly brackets}, [square brackets], or <angle brackets>.

How is the number zero and a blank space different from null?

Both the number zero and a blank space are different from null since they occupy space.

______ is formally defined as a value that is unavailable, unassigned, unknown, or inapplicable.

NULL

_________ is a term sometimes used to describe a column that is allowed to store null values.

Nullable

Any arithmetic calculation with a NULL value will always return ______.

NULL

T/F The character concatenation operators ignore null, whilst the arithmetic operations involving null values always result in null.

True.

T/F Oracle insists that any column that is a primary key is implicitly constrained to be mandatory (cannot contain nulls).

True

An alias provides a mechanism to rename a column or an expression. Under what conditions should you enclose an alias in double quotes?

If an alias contains more than one word or if the case of an alias must be preserved, then it should be enclosed in double quotation marks. Failure to double quote a multiworded alias will raise an Oracle error. Failure to double quote a single-word alias will result in the alias being returned in uppercase.

When working with character literal values that include single quotation marks, how should you specify these literals in the SELECT clause without raising an error?

There are two mechanisms available. The more common approach is to replace each naturally occurring single quote with two single quotes. The other approach is to make use of the alternate quote operator to specify an alternate pair of characters with which to enclose character literals.

__________ expose a vista of data manipulation possibilities through the interaction or arithmetic and character operators with column or literal data, or a combination of the two.

Expressions

An unlimited combination of ____, _____, and _____ provides the language to extract the relational data required.

projections, selections, and joins

A structural definition of a table can be obtained using the _________ command.

DESCRIBE

Columns in tables store different types of data using various data types, the most common of which are _____, _____, ______, and ______.

NUMBER, VARCHAR2, DATE, and TIMESTAMP

What does the data type NUMBER(x,y) imply?

It implies that numeric information store in this column can have at most x digits, but at least y of these digits must appear on the right hand side of the decimal point.

The DESCRIBE command lists:

the names, data types, and nullable status of all columns in a table.

Mandatory columns are also referred to as what?

NOT NULL columns

The FROM clause specifies what?

The source table or tables from which items are selected.

T/F If an alias contains multiple words or the case of the alias is important, it must be enclosed in double quotation marks.

True.

The ______ _______ is a single column and single row table that is often used to evaluate expressions that do not refer to specific columns or tables.

DUAL table

T/F Columns which are not governed by a NOT NULL constraint have the potential to store null values and are sometimes referred to as nullable columns.

True