The StayWell accommodation database includes tables to store data about property owners and the properties themselves, which are rented out for the owners by StayWell. The columns that make up the OWNER database include ______.
A. LAST_NAME
A(n) ______ is the association between entities.
B. relationship
A relational database ________.
C. is a collection of tables
If the primary key for the SALES_REP table is REP_ID, then the LAST_NAME column in this table is considered a(n) ________.
B. nonkey column
In one style of entity-relationship (E-R) diagram, a crow's foot is used to represent ______.
C. the "many" side of a relationship
When MySQL Workbench is first installed, executing the SHOW DATABASES command returns _______.
A. MySQL internal databases
Which command represents the correct syntax for creating a database called CHAMPYS in MySQL?
B. CREATE DATABASE CHAMPYS;
Which data type is used to store integers?
C. INT
Janice is adding a new row to a table, but has incomplete data for this row. She can indicate that data in a column is unknown or unavailable by entering which value?
B. a null
You use the SQL command INSERT INTO followed by a table name to ______.
D. add rows to a table
In MySQL, to display all the rows and columns in a table, you use _____.
A. the SELECT command followed by an asterisk
A query is a question represented in a way that the DBMS can understand.
A. True
B. False
A. True
A key difference between simple and compound SQL queries is that, unlike simple queries, compound queries _______.
C. connect two or more conditions
Which SQL operator allows you specify a range of values in a condition?
A. BETWEEN
In SQL, the ORDER BY clause should be followed by a(n) _______.
A. sort key
Thomas wants to write an SQL query that determines the average monthly unit sales for each of his bakery's cupcake flavors and then returns a list of flavors that sell better than average, Which of the following should he use as a subquery in his query after the > operator?
A. SELECT AVG(UNIT_SALES) FROM CUPCAKES
When a GROUP BY clause is used in SQL, functions in the SELECT command ______.
B. are calculated for each group
When performing an SQL query, you can join two tables together when _____.
A. they contain rows with identical values in matching columns
Data from two tables can be combined in SQL by using which operator in a subquery?
B. IN or EXISTS
When creating a table alias in SQL, you must separate the table's proper name from its alternate name with a period.
A. True
B. False
B. False
Maria adds a subquery preceded by ALL to her SQL SELECT command. This subquery's condition is true _______.
D. only if it satisfies all values produced by the subquery
All rows from both tables are included regardless of whether they match rows from the other table in a(n) _______.
B. full outer join
Which SQL commands are used to create a new table from an existing table?
B. CREATE TABLE, then INSERT
Which SQL command to update an existing table is formatted correctly?
B. UPDATE CUPCAKES SET FLAVOR = 'Cheery Cherry' WHERE (CAKE_ID = '012');
Bobbie has a table called PIES in her database. She executes the following SQL command: INSERT INTO PIES VALUES ('106', 'Tart Cherry', 15.75);. What does this do?
B. adds a row to the PIES table
Which SQL command to remove any rows with a value of 1.99 for PRICE from the MENU_ITEMS table is correctly formatted?
D. DELETE FROM MENU_ITEMS WHERE (PRICE = 1.99);
Tim wants to change the value of PHONE_NO to null (to indicate it is unknown) in any rows with a value of B52 for CLIENT_ID in the CLIENTS table. Which SQL command should he execute?
B. UPDATE CLIENTS SET PHONES_NO WHERE (CLIENT_ID = 'B52');
It is possible to lose some data currently stored in a column when you decrease its size using the MODIFY clause of the ALTER TABLE command.
A. True
B. False
A. True
Which of the following commands is permanent?
B. COMMIT
Penelope's employer has decided to stop selling ice cream treats, so she needs to remove the ICE_CREAM table and its data from the company's database. Which SQL command should Penelope use?
B. DROP TABLE ICE_CREAM;
Sandra creates a view for some colleagues to use. Her colleagues _______.
D. can see a picture of the database using this view
Compared with giving a user direct access to the tables in a database, giving the user access to one or more views _____.
B. offers a greater measure of security
You can add a row to the underlying table through a view if columns that are not included in the view _______.
C. can accept nulls
Percy, a database administrator, allows James, a user, to change data in the relations by granting him ________.
A. UPDATE privileges
If Mitzi creates a database index for the FOOD_GROUP column in the FOOD_INFO table, what columns would you expect to find in the associated index table?
C. FOOD_GROUP and ROW_NUMBER
Which of the following elements is NOT required in the SQL syntax to create an index?
C. WHERE clause
In MySQL, with which query can you view all the tables and views in the system catalog for the FRUITS database?
D. SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'FRUITS');
When you specify a foreign key, the table containing the foreign key is the parent.
A. True
B. False
B. False
Why do developers embed SQL commands in other programming languages?
A. to perform tasks that cannot be accomplished by SQL alone
In Oracle and SQL Server, you can display a value in lowercase letters using the ______.
C. LOWER function
Which MySQL statement would you use to display a grid based on the CUPCAKES table with a list of values from the FLAVOR column beside their prices from the PRICE column with any numbers after the decimal place removed?
B. SELECT FLAVOR, FLOOR(PRICE) AS TRUNCATED_PRICE FROM CUPCAKES;
Which MySQL statement will display the numeric value for a date two weeks (14 days) after the EVENT_DATE value in a DUE_DATE column?
B. SELECT ORDER_NUM, EVENT_DATE+14 AS DUE_DATE FROM ORDERS;
Which function should Marley use to calculate the number of days between a date from a MySQL table and the current date?
B. DATEDIFF()
What does the MySQL statement SELECT CONCAT(COLOR, ' ', SIZE) AS DESCRIPTION FROM INVENTORY; do?
A. displays the values of COLOR and SIZE together with a space in between
Which command do you use to create a stored procedure in Oracle?
D. CREATE PROCEDURE
If the user input assigned to the variable MY_CUPCAKE_ID represents the primary key for the table CUPCAKES, what will the embedded query SELECT CONCAT (FLAVOR_NAME, ' ', SIZE) INTO DESCRIPTION FROM CUPCAKES WHERE PRODUCT_ID = MY_CUPCAKE_ID; do?
D. retrieve and combine data from two columns in one row of CUPCAKES
The UPDATE command _______.
C. typically includes a SET clause and a WHERE clause
What three commands are involved in using a cursor in a procedure?
B. OPEN, FETCH, and CLOSE
What is the purpose of a "declare an exception" handler in a MySQL procedure?
C. to display meaningful output for a user when an error occurs
A trigger is a pointer to a row in the collection of rows retrieved by an SQL command.
A. True
B. False
B. False
Author
jdavis123
ID
360311
Card Set
Database Application Development Post-Course Assessment