MySQL 2nd Edition Chapter 05

MySQL 2nd Edition Chapter 05

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

INTO

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 (21)

Section 1

(21 cards)

INTO

Front

In the INSERT clause, you specify the name of the table that you want to add a row to, along with an optional column list. The _______ keyword is also optional.

Back

SELECT

Front

You can use the CREATE TABLE AS statement to create a new table based on the result set defined by a ____________________ statement.

Back

VALUES

Front

To insert rows selected from one or more tables into another table, you can code a subquery in place of the _______ clause. Then, MySQL inserts the rows returned by the subquery into the target table. For this to work, the target table must already exist.

Back

subquery

Front

To insert rows selected from one or more tables into another table with an INSERT statement, you can code a/an ___________________________ in place of the VALUES clause.

Back

B

Front

Assuming that all of the table and column names are spelled correctly, what's wrong with the INSERT statement that follows? INSERT INTO invoices (vendor_id, invoice_number, invoice_total, payment_total, credit_total, terms_id, invoice_date, invoice_due_date) VALUES (97, '456789', 8344.50, 0, 0, 1, '2012-08-31') -------------------------------------------------------- A) The column names in the column list are in the wrong sequence. B) The number of items in the column list doesn't match the number in the VALUES list. C) There are too few items in the COLUMNS list.

Back

CREATE TABLE AS

Front

When you use the _______ _______ ___ statement to create a table, only the column definitions and data are copied. Definitions of primary keys, foreign keys, indexes, and so on are not included in the new table.

Back

SET

Front

In the _______ clause, you name each column and its new value. You can specify the value for a column as a literal or an expression.

Back

column list

Front

The rules for working with a _______ _______ are the same as they are for any INSERT statement.

Back

foreign-key

Front

A _______-___ constraint may prevent you from deleting a row. In that case, you can only delete the row if you delete all child rows for that row first.

Back

WHERE

Front

When you code a DELETE statement for one or more rows, the _________________ clause specifies which row or rows are to be deleted.

Back

UPDATE

Front

To modify the data in one or more rows of a table, you use the _______ statement. Although most of the _______ statements you code will perform simple updates, you can also code more complex _______ statements that include subqueries if necessary.

Back

INSERT

Front

You use the _______ statement to add one or more rows to a table.

Back

DELETE

Front

To delete one or more rows from a table, you use the _______ statement. If necessary, you can use subqueries in a _______ statement to help identify the rows to be deleted.

Back

DELETE FROM invoices_copy;

Front

Write the code for a DELETE statement that deletes every row in the Invoices_Copy table: _______________________________________________________________.

Back

NULL

Front

When you code a column list in an INSERT statement, you can omit columns that have default values, accept ____________________________ values, or are automatically generated.

Back

WHERE clause

Front

You can code a subquery in the _______ _______ of an UPDATE statement to provide one or more values used in the search condition.

Back

WHERE

Front

When you code an UPDATE statement for one or more rows, the SET clause names the columns to be updated and the values to be assigned to those columns, and the ______________________ clause specifies the conditions a row must meet to be updated.

Back

SQL statement

Front

A subquery is a SELECT statement that's coded within another ___ _______.

Back

auto increment column

Front

If a column is defined as an _______ _______ _______, you can use the DEFAULT keyword in the list of values to have MySQL generate the value for the column.

Back

C

Front

Which of the following statements best describes what this INSERT statement does? INSERT INTO invoices_copy SELECT * FROM invoices WHERE terms_id = 1 -------------------------------------------------------- A) Updates all of the rows in the Invoices_Copy table that have 1 in the TermsID column to the rows in the Invoices table. B) Adds one row from the Invoices table to the Invoices_Copy table. C) Adds all of the rows in the Invoices table that have 1 in the terms_id column to the Invoices_Copy table. D) Adds all of the rows in the Invoices table to the Invoices_Copy table and sets the terms_id column to 1 in each row.

Back

DEFAULT

Front

If you code a column list in an INSERT statement that includes a column that's defined with a default value, you can insert the default value for that column by coding the ____________________ keyword in the VALUES clause of the INSERT statement.

Back