Database Systems Chapter 7 - Introduction to Structured Query Language (SQL)

Database Systems Chapter 7 - Introduction to Structured Query Language (SQL)

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

True

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (66)

Section 1

(50 cards)

True

Front

Some RDBMSs, such as Microsoft Access, automatically make the necessary conversions to eliminate case sensitivity.

Back

SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE >= '20-JAN-2016';

Front

Which of the following queries will list all the rows in which the inventory stock dates occur on or after January 20, 2016?

Back

SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344;

Front

Which of the following queries will output the table contents when the value of V_CODE is equal to 21344?

Back

Boolean

Front

A specialty field in mathematics, known as _____ algebra, is dedicated to the use of logical operators.

Back

Readable

Front

To make SQL code more____ , most SQL programmers use one line per column (attribute) definition.

Back

DELETE FROM PRODUCT WHERE P_CODE = 'BRT-345';

Front

The _____ command would be used to delete the table row where the P_CODE is 'BRT-345'.

Back

SELECT c COMMIT

Front

The SQL command that allows a user to list the contents of a table is _____.

Back

EXISTS

Front

The special operator used to check whether a subquery returns any rows is _____.

Back

DEFAULT

Front

The _____ constraint assigns a value to an attribute when a new row is added to a table.

Back

FORMAT

Front

In Oracle, the _____ command is used to change the display for a column, for example, to place a $ in front of a numeric value.

Back

SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;

Front

The query to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE and V_CONTACT fields from the VENDOR table, where the values of V_CODE match and the output is ordered by the price is _____.

Back

False

Front

The ANSI prescribes a standard SQL-the current fully approved version is known as SQL-07.

Back

restricts the selection of grouped rows based on a condition.

Front

The SQL data manipulation command HAVING:

Back

UPDATE PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';

Front

An example of a command a user would use when making changes to a PRODUCT table is _____.

Back

Query

Front

In the SQL environment, the word _____ covers both questions and actions.

Back

all rows will be deleted

Front

When a user issues the DELETE FROM tablename command without specifying a WHERE condition, _____.

Back

ALTER TABLE

Front

All changes in a table structure are made using the _____ command, followed by a keyword that produces the specific changes a user wants to make.

Back

subquery

Front

A(n) _____ is a query that is embedded (or nested) inside another query.

Back

between

Front

The special operator used to check whether an attribute value is within a range of values is _____.

Back

True

Front

Data type selection is usually dictated by the nature of the data and by the intended use.

Back

Drop index

Front

To delete an index, one must use the _____ command.

Back

% and _. '%' is used when replacing an unspecified number of characters; for instance, 'S%' could indicate either Smith or Sanchez. '-' is used to replace only one character; 'J_n' could represent either Jon or Jan.

Front

What are the wildcard characters that are used with the LIKE command? Provide one or more examples of each.

Back

COUNT

Front

The SQL aggregate function that gives the number of rows containing non-null values for a given column is _____.

Back

True

Front

The ANSI SQL standards are also accepted by the ISO.

Back

DROP TABLE

Front

A table can be deleted from the database bu using the ___ command.

Back

False

Front

Only numeric data types can be added and subtracted in SQL.

Back

SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE <'1558-QW1';

Front

Which of the following queries will output the table contents when the value of the character field P_CODE is alphabetically less than 1558-QW1?

Back

SELECT <column(s)> FROM <Table name> WHERE <Conditions>;

Front

Which of the following is used to select partial table contents?

Back

False

Front

All SQL commands must be issued on a single line.

Back

True

Front

String comparisons are made from left to right.

Back

Recursive

Front

An alias is especially useful when a table must be joined to itself in a(n) _____ query.

Back

False

Front

SQL requires the use of the ADD command to enter data into a table.

Back

True

Front

ANSI-standard SQL allows the use of special operators in conjunction with the WHERE clause.

Back

True

Front

Entity integrity is enforced automatically when the primary key is specified in the CREATE TABLE command sequence.

Back

True

Front

SQL allows the use of logical restrictions on its inquiries such as OR, AND, and NOT.

Back

A subquery is the query-within-a-query inside a nested query. It is used when the outer query depends on data processed by the inner query. Because of this, he RDBMS always processes the subquery first.

Front

What is a subquery? When is it used? Does the RDBMS deal with subqueries any differently from normal queries?

Back

True

Front

Although SQL commands can be grouped together on a single line, complex command sequences are best shown on separate lines, with space between the SQL command and the command's components.

Back

SELECT DISTINCT V_CODE FROM PRODUCT;

Front

Which of the following queries is used to list a unique value for V_CODE, where the list will produce only a list of those values that are different from one another?

Back

True

Front

The COUNT function is designed to tally the number of non-null ""values"" of an attribute, and is often used in conjunction with the DISTINCT clause.

Back

Commit

Front

The SQL command that allows a user to permanently save data changes is _____.

Back

False

Front

An alias cannot be used when a table is required to be joined to itself in a recursive query.

Back

One

Front

In a 1:M relationship, a user must always create the table for the _____ side first.

Back

True

Front

The conditional LIKE must be used in conjunction with wildcard characters.

Back

alias

Front

A(n) _____ is an alternate name given to a column or table in any SQL statement.

Back

LIKE

Front

The special operator used to check whether an attribute value matches a given string pattern is _____.

Back

Drop table, for example: DROP TABLE AUTHORS; (This command will not be executed if the Authors table is on the one side of any relationship.)

Front

How can a table be deleted from the database? Provide an example.

Back

SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE = 24288;

Front

Which of the following queries uses the correct SQL syntax to list the table contents for either V_CODE = 21344 or V_CODE = 24288?

Back

Wildcard

Front

A(n) _____ character is a symbol that can be used as a general substitute for other characters or commands.

Back

ROLLBACK;

Front

The _____ command is used to restore the database to its previous condition.

Back

SET columnname=expression

Front

UPDATE tablename*** [WHERE conditionlist]; The _____ command replaces the *** in the syntax of the UPDATE command, shown above.

Back

Section 2

(16 cards)

Attribute names

Front

In an INSERT command, a user can indicate just the attributes that have required values by listing the _____ inside parentheses after the table name.

Back

--1. SQL is a data definition language (DDL). It includes commands to create database objects such as tables, indexes, and views, as well as commands to define access rights to those databases objects. --2. SQL is a data manipulation language (DML). It includes commands to insert, update, delete, and retrieve data within the database tables.

Front

Explain the two SQL functions.

Back

Performing operations within parentheses

Front

According to the rules of precedence, which of the following computations should be completed first?

Back

Reserved

Front

_____ words are words used by SQL to perform specific functions.

Back

Index

Front

A common practice is to create a(n) _____ on any field that is used as a search key, in comparison operations in a conditional expression, or when a user wants to list rows in a specific order.

Back

False

Front

Any changes made to the contents of a table are not physically saved on disk until you use the SAVE <table name> command.

Back

SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE;

Front

The query to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE, and V_CONTACT fields from the VENDOR table where the values of V_CODE match is _____.

Back

True

Front

If you have not yet used the COMMIT command to store the changes permanently in the database, you can restore the database to its previous condition with the ROLLBACK command.

Back

False

Front

The COMMIT command does not permanently save all changes. In order to do that, you must use SAVE.

Back

SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE FROM PRODUCT;

Front

Which of the following queries will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand?

Back

Select

Front

The _____ command, coupled with appropriate search conditions, is an incredibly powerful tool that enables a user to transform data into information.

Back

False

Front

Oracle users can use the Access QBE (query by example) query generator.

Back

True

Front

A database language enables the user to perform complex queries designed to transform the raw data into useful information.

Back

False

Front

SQL is considered difficult to learn; its command set has a vocabulary of more than 300 words.

Back

SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE ORDER BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;

Front

The SQL query to output the contents of the EMPLOYEE table sorted by last name, first name, and initial is _____.

Back

SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344;

Front

Which of the following queries will output the table contents when the value of V_CODE is not equal to 21344?

Back