Database Concepts - Module 6 Quiz, Final - Database Concepts, Module 8 Quiz - Database Concepts, Module 7 Quiz - Database Concepts, Database Concepts - Module 6 Quiz, computer, SQL Chapter 2, Database Concepts - Module 6 Quiz

¡Supera tus tareas y exámenes ahora con Quizwiz!

In SQL for Oracle and for SQL Server, the ____ symbol is used as a wildcard to represent any collection of characters.​

%

SQL was developed in the mid-____.​

1970's

Variable names in PL/SQL must start with a letter and can contain letters, dollar signs, underscores, and number signs, but cannot exceed _____.

30 characters

How many tables make up the KimTay database?

5

nonkey

A ____ column is a column that is not part of the primary key.

False

A determinant is any column (or collection of columns) that determines another table.

column

A field is another term for a(n) ____.

False

A programmer interviews users, examines existing and proposed documents, and examines organizational policies to determine exactly the type of data needs the database must support

tuple

A record is another term for a(n) ____.

False

A relation is essentially a three-dimensional table.

first normal form

A relation is in ____ if it does not contain any repeating groups.

relations

A relational database is a collection of ________.

Entities

A relationship is an association between _______.

False

A table is in third normal form if it is in second normal form and no nonkey column is dependent on only a portion of the primary key.

REPEATING

A table's design should be as simple as possible; you should restrict each position in a table to a single entry by not allowing multiple entries (called a(n) _____ group) in an individual location in the table.

False

A tabular database is a collection of tables.

Which statement about views is correct?

A view can join two or more tables and/or involve statistics.

All of the above (attribute, field, column)

A(n) ____ is a characteristic or property of an entity.

tuple

A(n) ____ is another name for a record or a row.

relationship

A(n) ____ is the association between entities.

NONKEY

A(n) _____ column is a column that is not part of the primary key.

ENTITY

A(n) ______ is a person, place, object, event, or idea for which you want to store and process data.

RELATIONSHIP

A(n) ________ is the association between entities.

In Oracle, to add a specific number of months to a date, use the _____.

ADD_MONTHS function

If you precede the subquery by the ____ operator, the condition is true only if it satisfies all values produced by the subquery.​

ALL

Which privilege should be granted to users who are authorized to change a table's structure?

ALTER

If you precede the subquery by the ____ operator, the condition is true only if it satisfies any value (one or more) produced by the subquery.​

ANY

A condition is true if it satisfies any value (one or more) produced by a subquery that is preceded by the _____.

ANY operator

The CREATE VIEW command includes the words CREATE VIEW, followed by the name of the view, the word ____, and then a query.

AS

Why have Social Security numbers traditionally been used as primary keys for database tables that store personal data on individual people?

All other columns in such a table are functionally dependent on the Social Security number column.

What happens if you run a DELETE command that does not contain a WHERE clause?

All rows will be deleted from the table.

True

An unnormalized relation is a relation that contains repeating groups.

dependency

Any column (or collection of columns) that determines another column is called a(n) ____.

To display all the rows and columns in a table, type the word SELECT, followed by a(n) ____, followed by the word FROM and then the name of the table containing the data you want to view.​

Asterick

one-to-many

At Premiere Products, there is a ____ relationship between sales reps and customers.

The default transaction mode in Oracle, which commits each action query as soon as the user executes the query, is _____.

Autocommit

The ____ operator is inclusive, meaning that a value equal to either end would be selected.​

BETWEEN

The ____ operator specifies a range of values in a condition.​

BETWEEN

True

Because there is a one-to-many relationship between sales reps and customers n the Premiere Products database, One sales rep can be associated with zero, one, or more customers.

Use the ____ data type for columns that contain letters and special characters and for columns containing numbers that will not be used in calculations.​

CHAR

Once you have verified that the update you made is correct, you can make the update permanent by using the _____.

COMMIT command

When you use the ____ function, you can use the asterisk (*) to represent any column.​

COUNT

The ____ command defines a table's structure by listing its columns, data types, and column lengths.​

CREATE TABLE

Which command can you use to create a new table using data in an existing table?

CREATE TABLE

Which command do you use to write a procedure that should be executed automatically when a certain database operation is performed?

CREATE TRIGGER

To ensure the uniqueness of values in a nonprimary key column, you can create an index using the _____.

CREATE UNIQUE INDEX command

What function can you use to obtain today's date in MySQL?

CURDATE()

The product of two tables is formally called the _____.

Cartesian product

​A field is another term for a(n) ____.

Column

False

Columns are sometimes called tuples.

If Mack wants to display the number of days between two dates, such as the current date and an invoice date from a table, which function can he use in his MySQL query to accomplish this?

DATEDIFF()

In Oracle, which table contains information about the columns within tables?

DBA_TAB_COLUMNS

In Oracle, dates have the format ____.​

DD-MON-YY

Which of the following statements can you add to a stored procedure to provide meaningful feedback to a user who attempts to execute the procedure with an argument that is invalid because it is missing from the table column being queried?

DECLARE EXIT HANDLER FOR NOT FOUND

What command is used to delete rows from the database?

DELETE

Which SQL command do you use to remove an entire row from a table?

DELETE

Which is the correct sequence of elements in a command to remove rows from a MySQL table?

DELETE FROM, table name, WHERE clause with a condition

When you execute a stored procedure to retrieve a single row with embedded SQL, you need MySQL to treat several statements ending in a semicolon as if they were a single statement. What keyword do you use to tell MySQL to use a different character to signal the end of a statement in this situation?

DELIMITER

In Oracle, use the ____________________ command to list all columns in a table and their properties.​

DESCRIBE

Which command is used to display the structure of a table in MySQL?

DESCRIBE

Which of the following commands deletes an index?

DROP INDEX

To delete an entire table, use the ____ command and then re-create the table.​

DROP TABLE

Which command(s) can you use to delete an entire table and its data?

DROP TABLE

Which of the following is a valid SQL command?

DROP TABLE LEVEL1_CUSTOMER;

​The process of determining the particular tables and columns that will comprise a database is known as ____.

Database design

​Any column (or collection of columns) that determines another column is called a(n) ____.

Determinant

For any column whose data type is CHAR, values must be enclosed in ____.​

Double Quotation Marks

Which command is used to call a procedure in SQL Server?

EXEC

True

Each column in a table of a relational database should have a distinct name.

​A(n) ____________________ is a person, place, thing, or event for which you want to store and process data.

Entity

When you use a cursor in a procedure, what command advances the cursor to the next row in the set of rows retrieved by the query and places the contents of the row in the indicated variables?

FETCH

Which function can you use in Oracle, MySQL, and SQL Server to truncate everything to the right of the decimal point?

FLOOR

All SELECT statements require a WHERE clause.​

False

Applying the function ROUND(PRICE,0) to the price 24.95 results in 24.

False

In Oracle, the data type STRING(n) stores a character string n characters long.​

False

In SQL Server, you use the & symbol to concatenate columns.

False

In SQL, you cannot enter an apostrophe into a column whose type is character (CHAR).

False

In a SELECT statement, the FROM clause and the WHERE clause (when used) must appear on separate lines.​

False

Instead of including every column in the SELECT clause, you can use an ampersand (&) to indicate that you want to include all columns.​

False

The COUNT function only applies to columns with numeric values.​

False

The DATE_ADD function has one argument.

False

The DROP TABLE command creates an empty table.

False

The issues involved in updating data within base tables through a view are the same regardless of the type of view.

False

To permanently remove both a table and its data, you must execute both a DROP TABLE command and a DELETE command.

False

Using SQL, you can increase the length of an existing table column but you cannot decrease the length of a column.

False

You can create and maintain an index on any row in any table.

False

You can use the APPEND command to add additional rows to tables.

False

You cannot assign names to computed columns.​

False

You cannot use functions in WHERE clauses.

False

​A primary key always comprises a single column.

False

​You can join three tables together but not four tables.

False

​A(n) ____ is a property of an entity.

Field, Attribute, Common

​A relation is in ____________________ normal form if it does not contain any repeating groups.

First

​A relation is in ____ if it does not contain any repeating groups.

First Normal Form

​In a relational database, column B is ____________________ on another column A, if at any point in time a value for A determines a single value for B.

Functionally Dependent

In SQL Server, you can obtain today's date using the _____.

GETDATE() function

Which command will allow user Thompson to remove rows from the CUSTOMER table?

GRANT DELETE ON CUSTOMER TO THOMPSON;

The ____ clause lets you group data on a particular column.​

GROUP BY

Which clause lets you group data on a particular column?

GROUP BY

The ____ clause is used to restrict the groups that will be included in a query result.​

HAVING

You can use the ____ operator followed by a collection of values to provide a concise way of phrasing certain conditions.​

IN

To retrieve data from multiple tables in a query, you can use a subquery containing the _____.

IN operator

The ____________________ command adds rows to a table.​

INSERT

Which command should Josephine use if she would like to add a new row to the BMI table in MySQL?

INSERT INTO BMI VALUES ('Emily', 'Cross', 66, 115);

James has created a new MySQL table called FAVORITES and would like to populate it with data from the existing CANDY table. Which command can he use to add data for rows with a rating of seven or more?

INSERT INTO FAVORITES (SELECT ID, NAME, PRICE, RATING FROM CANDY WHERE (RATING > 7));

To add data from an existing table to a new table, use a SELECT command in a(n) _____.

INSERT command

The ____ data type is used to store integers.​

INT

The ____ operator finds rows that do not contain a null value in the specified column.​

IS NOT NULL

Which operator finds rows that do not contain a null value in the specified column?

IS NOT NULL

What happens if Samantha, whose view of the database contains only a portion of the rows and columns of the base table, attempts to add a row to the table through her view?

If Samantha's INSERT command succeeds, the new row will contain several null values.

second

If the primary key of a table contains only a single column, the table is automatically in _____ normal form.

Which statement about triggers is correct?

In SQL Server, you create triggers using T-SQL.

True

In a relation, all values in a column are values of the same attribute.

immaterial

In a relation, the order of the rows and columns is ____________________

row, record, tuple

In a relational database each ____ should be unique.

functionally dependent

In a relational database, column B is ______ on another column A, it at any point in time a value for A determines a single value for B.

True

In a relational database, relationships are implemented by having common columns in two or more tables.

False

In a relational database, two columns can be identical

rectangles

In an entity-relationship (E-R) diagram, ____ are used to represent an entity.

lines

In an entity-relationship (E-R) diagram, one-to-many relationships between entities are drawn as ____ .

RELATIONSHIPS

In one style of entity-relationship (E-R) diagrams, diamonds are used to describe _____.

third normal form

In this text, Boyce-Codd normal form is the same as ____.

Which general guideline for naming identifiers should you follow when creating a database and adding objects to it?

Include letters, numbers, and/or underscores.

​____ is one of the categories of update anomalies.

Inconsistent data

Which of the following joins compares the tables in the FROM clause and lists only those rows that satisfy the condition in the WHERE clause?​

Inner

The ____ operator uses one or more wildcard characters to test for a pattern match.​

LIKE

In MySQL, Oracle, and SQL server, you can display a value in lowercase letters using the _____.

LOWER function

​In an entity-relationship (E-R) diagram, one-to-many relationships between entities are drawn as ____.

Lines

Which clause can you use with the ALTER TABLE command to change a column that currently rejects null values so that it will accept null values?

MODIFY

Martine's database administrator has set up a view for her so that she can access the information she needs from the database. What will happen when new columns Martine does not need to see are added to the base tables used for Martine's view?

Martine can continue to use her view as usual.

To indicate columns that cannot contain null values, use the ____________________ clause in a CREATE TABLE statement.​

NOT NULL

Changing a value in a table column to null is prohibited if, when you created the table, you specified _____.

NOT NULL for the column

​A ____ column is a column that is not part of the primary key.

Nonkey

​A(n) ____________________ column is a column that is not part of the primary key.

Nonkey

False

Normalization is done before creating the database design

You use the ____ clause to list data in a specific order.​

ORDER BY

Which MySQL clause used with the query SELECT* FROM PACKAGE would be the most likely to yield the following results?

ORDER BY PRICE DESC, PACKAGE_NAME

​Which of the following is the primary key of the ORDER_LINE (ORDER_NUM, ITEM_NUM, NUM_ORDERED, QUOTED_PRICE) table?

ORDER_NUM and ITEM_NUM

​In a relation, the ____________________ of the rows and columns is immaterial.

Order

StayWell stores information about the facilities where student residents live in the _____ table.

PROPERTY

​There is a commonly accepted shorthand representation to show the structure of a relational database: After the name of the table, all the columns in the table are listed within a set of ____.

Paranthasis

To qualify a column name, precede the name of the column with the name of the table, followed by a(n) ____.​

Period(.)

​Which of the following symbols is used to qualify column names?

Period(.)

How do you use data from certain columns of an existing table to populate a new table with a matching structure?

Place a SELECT command within an INSERT command.

​The ____________________ key of a table (relation) is the column or collection of columns that uniquely identifies a given row in that table.

Primary

SQL is Structured ____________________ Language.​

QUERY

​When you write a column in the format CUSTOMER.REP_NUM, you say that you ____________________ the column name.

Qualify

The general form for assigning a foreign key is ADD FOREIGN KEY, the column name(s) of the foreign key, the ____ clause, and then the table name and column that the foreign key must match.

REFERENCES

Percy is promoted and is no longer responsible for making updates to several database tables. Which command should Percy's database administrator use to prevent Percy from making future updates?

REVOKE

If you have not run the COMMIT command, you can reverse all updates made during the current work session by executing the _____.

ROLLBACK command

Which of the following commands executes a rollback?

ROLLBACK;

In Oracle, SQL Server, and MySQL, you can round a numeric value to a desired number of decimal places using the _____.

ROUND function

To remove extra spaces to the right of a value after concatenating two or more columns, use the _____.

RTRIM function

​In a relational database each ____ should be unique.

Record, Row, Tuple

​In an entity-relationship (E-R) diagram, ____ are used to represent an entity.

Rectangles

​____ is the duplication of data.

Redundamcy

​A relational database is a collection of ____________________.

Relations

​A(n) ____ is the association between entities.

Relationship

​A(n) ____________________ is the association between entities.

Relationship

​A record is another term for a(n) ____.

Row

A(n) ____ clause can include statistics calculated for only the groups or columns whose values are identical for each row in a group.​

SELECT

To view the data in a table, you use the ____________________ command.​

SELECT

Which privilege can be granted to allow a user to retrieve data?

SELECT

Which MySQL command displays all tables associated with the database ELPATRON?

SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'ELPATRON');

The basic form of the SQL SELECT command is ____.​

SELECT-FROM-WHERE

Information about the services requested by StayWell residents is stored in the _____ table.

SERVICE_REQUEST

The ____ function calculates a total of the values in a column.​

SUM

A ____ file is a text file with a .sql extension that contains SQL commands.​

Script

When a script file contains more than one command, each command must end with a(n) ____.​

Semicolon

You indicate the end of a command by typing a ____.​

Semicolon

What is the original name of SQL?​

Sequel

Which statement regarding primary keys is true?

Some tables include more than one column that can be used as a primary key.

You create an alias by typing the name of the table, pressing the ____, and then typing the name of the alias.​

Spacebar

Which of the following is a valid name for a table?

TBL_1

Which of the following is a valid name for a table?​

TBL_1

What happens once the following command is executed? ALTER TABLE ORDERS ADD FOREIGN KEY (CLIENT_ID) REFERENCES CLIENT (CLIENT_ID);

The DBMS will reject updates to the ORDERS table with CLIENT_ID values missing from the CLIENT table.

PRIMARY

The _______ key of a table (relation) is the column or collection of columns that uniquely identifies a given row in that table.

True

The definition for a primary key really defines a candidate key as well

Which statement describing relations is false?

The entries in a relation may be single- or double-valued.

updates

The four categories of update anomalies are additions, deletions, inconsistent data, and ______.

database design

The process of determining the particular tables and columns that will comprise a database is known as ____.

True

The statement "A sales rep's pay class functionally determines his or her pay rate" means that if you know the pay class, you also know the pay rate.

parentheses

There is a commonly accepted shorthand representation to show the structure of a relational database: After the name of the table, all the columns in the table are listed within a set of ____.

How does the procedure for adding rows to an existing MySQL table compare to that for populating a new table that has just been created?

They are identical.

​In this text, Boyce-Codd normal form is the same as ____.

Third Normal Form

Dropping a table also deletes any data that you entered into the table.​

True

In Oracle, the date, November 12, 2015 would be stored as '12-NOV-2015'.​

True

In general, SQL is case-sensitive.​

True

It is possible to place one query inside another.​

True

It is possible to use both a WHERE clause and a HAVING clause in a SELECT statement.​

True

Preceding a condition by the NOT operator reverses the truth of the original condition.​

True

Table names cannot contain spaces.​

True

The DISTINCT operator is useful when used in conjunction with the COUNT function.​

True

The Oracle Database 11 g Express edition allows you to save a command so you can use it again without retyping it.​

True

The WHERE clause is used to retrieve rows that satisfy some condition.​

True

The data type DECIMAL(5,2) represents a number with three places to the left and two places to the right of the decimal.​

True

The data type indicates the type of data that a column can contain.​

True

To create a table, type the command DESCRIBE TABLE followed by the name of the table to be created and then by the names and data types of the columns that will comprise the table.​

True

Views furnish a certain amount of security; if users are accessing the database through a view, they cannot access any data that is not included in the view.

True

When adding rows to character columns, make sure you enclose the values in single quotation marks.​

True

When the OR operator connects simple conditions, the compound condition will be true whenever any one of the simple conditions is true.​

True

When users create, alter, or drop tables or create or drop indexes, the DBMS updates the system catalog automatically.

True

When you connect two or more simple conditions with the AND operator, each condition must be listed on a separate line.​

True

When you need to complete tasks that are beyond the capabilities of SQL, you need to use a procedural language.

True

You can use the existing value in a column and a calculation to update a value.

True

​Each column in a table of a relational database should have a distinct name.

True

​In a relational database, relationships are implemented by having common columns in two or more tables.

True

​It is permissible to qualify all column names in a query.

True

​One reason for using an alias is simplicity.

True

​One reason for using an alias is when you are joining a table to itself.

True

​To ensure that query results are listed in a desired order, use the ORDER BY clause.

True

​You can indicate a table's primary key by underlining the column or collection of columns that comprises the primary key for each table in the database.

True

​You can join tables by using a condition in the WHERE clause.

True

​You must join tables by finding rows in the two tables that have identical values in matching columns.

True

​A(n) ____________________ is another name for a record or a row.

Tuple

Which command can you use to change rows for which a specific condition is true?

UPDATE

Barney learns that the phone number for his friend Lacey in his ADDRESS_BOOK table has been disconnected; thus, her number is now unknown to him. Which SQL statement should Barney use to update the table so as to reflect this unknown value?

UPDATE ADDRESS_BOOK SET PHONE_NO = NULL WHERE (NAME = 'Lacey');

Which is the correct sequence of elements for a SQL command that will change a value in an existing table row?

UPDATE, table name, SET, column name, equal sign, new value

Which function displays a value in uppercase letters in Oracle and SQL Server?

UPPER

​____ can occur when there is a column in a table that is dependent on only a portion of the primary key.

Update Anomolies

The ____ data type stores only the actual character string.​

VARCHAR

You can join tables by using a condition in the ____ clause.​

WHERE

Which WHERE clause can you use with a SELECT statement to perform a case-insensitive search for rows containing the first name Marco?

WHERE UPPER(FIRST_NAME) = 'MARCO'

qualify

When you write a column in the format CUSTOMER.REP_NUM, you say that you _____ the column name

Order_num and Part_num

Which of the following is the primary key of the ORDER_LINE (ORDER_NUM, PART_NUM, NUM_ORDERED, QUOTED_PRICE) table?

(.)

Which of the following symbols is used to qualify column names?

The ____ wildcard symbol represents any individual character.​

_

update anomalies

____ can occur when there is a column in a table that is dependent on only a portion of the primary key.

inconsistent data

____ is one of the categories of update anomalies.

redundancy

____ is the duplication of data.

concatenation

____ is the formal term for combining two or more columns to form a primary key.

BOYCE-CODD NORMAL FORM (BCNF)

________ is another name given to third normal form in this text.

The purpose of creating databases indexes is to _____.

avoid searching through every row in a table with every query

When creating a stored procedure to retrieve a single row with embedded SQL, you must place the procedural code _____.

between the BEGIN and END commands

An index _____.

can be essential to the retrieval performance of very large database

Displaying a full name in query results when the first and last names are stored in separate columns in the database table is a typical use case for _____.

concatenation

When a subquery involves a table listed in the outer query, the subquery is called a(n) _____.

correlated subquery

The system catalog is also called the _____.

data dictionary

In a business organization, the person or entire group of people charged with managing the database is known as the _____.

database administrator

The ____ of two tables is the set of all rows that are in the first table but that are not in the second table.

difference

Adding a ORDER BY UNIT_PRICE clause to a SQL query will _____.

display the results in ascending order by UNIT_PRICE

What does this SQL command accomplish? ALTER TABLE PRODUCTS ADD CHECK (SIZE IN ('S', 'M', 'L', 'XL', 'XXL'));

establishes legal values for the SIZE column

Patty begins entering an order into her DBMS using SQL, but soon discovers she cannot complete the order entry process owing to missing data. What should she do to follow best practices related to transactions?

execute the ROLLBACK command

The invoice line in a KimTay invoice contains a total, which is usually called a(n) _____.

extension

A trigger is executed _____.

in response to a command such as INSERT, UPDATE, or DELETE

A MySQL command to change a value within a table to null _____.

incorporates the UPDATE and SET commands and a WHERE clause

In a ____, all rows from the table on the left (the table listed first in the query) will be included regardless of whether they match rows from the table on the right (the table listed second in the query).​

left inner join

What does the following SQL query do? SELECT INVOICE_NUM FROM INVOICE_LINE WHERE PROD_CODE IN (SELECT PROD_CODE FROM PRODUCTS WHERE (PROD_TYPE = 'Cupcake'));

lists the invoice numbers for invoices containing line items with a "Cupcake" product type

When you specify a foreign key, the table referenced by the foreign key is the _____.

parent

When renaming columns for a view, you include the new column names in _____ following the name of the view.

parentheses

A database can be readily updated through a view when that view is derived from joining two base tables on a shared _____.

primary key

The types of constraints supported in SQL are ____.

primary keys, foreign keys, and legal values

The duplication of data is formally called _____.

redundancy

MySQL procedures without error handling _____.

return unclear results when used with invalid arguments

In a ____, all rows from the table on the right will be included regardless of whether they match rows from the table on the left.​

right outter join

A text file with a .sql extension that contains SQL commands is a _____.

script file

When a script file contains more than one command, each command must end with a(n) _____.

semicolon

Views can contain only the columns required by a given user. What two advantages are conferred by this aspect of views?

simplicity and security

Adding rows to a view is most troublesome for the view user when that view contains _____.

statistics calculated from base tables

What do you need to know to complete the FIRST step in the process of creating a new table using data from an existing table, called CANDY, in MySQL?

the columns from CANDY that you want to include and their characteristics

What does the error code 1172 stand for?

too many rows

A logical unit of work, often conceptualized as a sequence of steps that accomplish a single task, is called a _____.

transaction

A procedure that is executed automatically in response to an associated database operation is called a _____.

trigger

A query is a question represented in a way that the DBMS can understand.

true

The HAVING clause is used to restrict groups that are included in a query result.​

true

When joining tables, it is always necessary to qualify a column name.

true

An owner number in the OWNER table in the StayWell database consists of _____ uppercase letters followed by a three-digit number.

two

Suppose you have a table with a primary key composed of two columns. When another column in this table is dependent on only one of the two columns in the primary key, this poses a risk for _____.

update anomalies

A stored procedure that includes an UPDATE command between the BEGIN and END commands is known as a(n) _____.

update procedure

How do you add a specific number of days to a date in MySQL?

use an expression with a plus (+) operator such as "+ 14"

A program's or an individual user's picture of the database is called a(n) _____.

view


Conjuntos de estudio relacionados