Quiz 1 Practice (Ch. 1-3) Intro to Database

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which of the following is NOT a hardware component of a client/server system? A. client B. server C. printer D. network

C. printer

How would you code a SELECT clause so it returns all columns from the base table? A. SELECT * B. SELECT COLUMNS C. SELECT *.* D. SELECT ALL

A. SELECT *

Which clause do you use to filter the rows returned by a SELECT statement? A. WHERE B. ORDER BY C. SELECT D. FROM

A. WHERE

Which of the following types of SQL statements is NOT a DML statement? A. SELECT B. CREATE TABLE C. UPDATE D. INSERT

B. CREATE TABLE

The order of precedence for the logical operators in a WHERE clause is A. Or, And, Not B. Not, And, Or C. And, Or, Not D. Not, Or, And

B. Not, And, Or

What is the result of the expression that follows if the value of last_name is "Smith" and the value of first_name is "Steve"?CONCAT(last_name, first_name) A. Smith, Steve B. SmithSteve C. Smith,Steve D. Smith Steve

B. SmithSteve

Which of the following WHERE clauses will return vendor names from A to C? A. WHERE vendor_name < 'C' B. WHERE vendor_name < 'D' C. WHERE vendor_name = D D. WHERE vendor_name = 'D'

B. WHERE vendor_name < 'D'

The processing that's done by the DBMS is typically referred to as A. back-end processing B. the user interface C. the file server D. front-end processing

A. back-end processing

The interface between an application program and the DBMS is usually provided by the A. programmer B. back end C. front end D. data access API

D. data access API

Which of the following recommendations WON'T improve the readability of your SQL statements? A. Use comments to describe what each statement does. B. Indent continued lines. C. Break long clauses into multiple lines. D. Start each clause on a new line.

A. Use comments to describe what each statement does.

Which of the following can you do when working with a table in MySQL Workbench? A. all of the above B. view the data for the table C. view the column definitions for the table D. edit the column definitions for the table E. a and b only

A. all of the above

When you code a calculated value in a SELECT clause, the expression for the calculated value can include A. arithmetic operators and functions only B. arithmetic operators, comparison operators, and functions only C. arithmetic operators only D. arithmetic operators, comparison operators, logical operators, and functions

A. arithmetic operators and functions only

When you code an ORDER BY clause, you can specify a A. column name, alias, expression, or column number B. column name or expression only C. column name, alias, or expression only D. column name or alias only

A. column name, alias, expression, or column number

A database driver is software that lets the A. data access model communicate with the database B. data access model communicate with the application program C. application program communicate with the database D. application program communicate with the data access model

A. data access model communicate with the database

Which of the following is NOT a common error when entering and executing SQL statements? A. forgetting to connect to a database server B. selecting the wrong database C. misspelling a keyword D. misspelling the name of a table

A. forgetting to connect to a database server

A single table in a relational database consists of A. rows and columns B. matrixes C. columns only D. rows only

A. rows and columns

To start the server in MySQL Workbench, you can click the Start Server button in the A. tab that's displayed when you select Startup / Shutdown from the Navigator window B. MySQL Connections section of the Home page C. Schemas tab of the Navigator window D. toolbar for an open database connection

A. tab that's displayed when you select Startup / Shutdown from the Navigator window

When coded in a WHERE clause, which of the following would NOT return rows for vendors in the cities of San Diego and Santa Ana? A. vendor_city REGEXP 'NA$' B. vendor_city LIKE 'SAN%' C. vendor_city REGEXP '^SA'

A. vendor_city REGEXP 'NA$'

Which of the following is not true when you're using MySQL Workbench to test a script that contains more than one SQL statement? A. When you run a script, the results are displayed in the Result grid. B. You cannot run all of the statements in the script at once. C. You can run each statement in the script by itself.

B. You cannot run all of the statements in the script at once.

Which of the following can you NOT code in a SELECT clause when you omit the FROM clause from a SELECT statement? A. a function B. a base table column C. an arithmetic expression D. a literal value

B. a base table column

The result of a SELECT statement is A. a stored procedure B. a result set C. a calculated value

B. a result set

Before you can run a SQL statement, you must A. open a SQL tab B. all of the above C. select the database that the statement will be executed against D. enter the statement in the SQL editor

B. all of the above

The intersection of a row and column is commonly called a A. field B. cell C. record D. box

B. cell

The MySQL database server can also be referred to as the A. database controller B. database engine C. database driver D. database manager

B. database engine

Which of the following types of diagrams can be used to show how the tables in a database are defined and related? A. all of the above B. entity relationship C. table relationship D. object relationship

B. entity relationship (ER or EER)

Before you can use MySQL Workbench to work with a MySQL database, you must A. create a user other than the root user B. open a connection to the database server C. all of the above D. edit the parameters for the connection you will be using so they will work with the database server

B. open a connection to the database server

To save your own SQL statement in MySQL Workbench so you don't have to type it each time, you can create a new A. snapshot B. snippet C. stored statement D. custom statement

B. snippet

To uniquely identify each row in a table, you can define a A. foreign key B. unique key or primary key C. unique key or foreign key D. primary key or foreign key

B. unique key or primary key

Which of the following statements about sorting the rows in a result set is NOT true? A. The sort order is determined by the character set you're using. B. Null values always appear first in the sort sequence. C. A column that's used for sorting must be included in the SELECT clause. D. The rows can be sorted by any number of columns in either ascending or descending sequence

C. A column that's used for sorting must be included in the SELECT clause.

How would you identify the many side of a relationship between two tables in a database? A. By defining a primary key in one table that's related to a unique key in the other table B. By defining a primary key in one table that's related to the primary key in the other table C. By defining a foreign key in one table that's related to the primary key in the other table D. By defining a foreign key in one table that's related to a foreign key in the other table

C. By defining a foreign key in one table that's related to the primary key in the other table

Which clause of the SELECT statement specifies the table that contains the data to be retrieved? A. ORDER BY B. SELECT C. FROM D. WHERE

C. FROM

To run SQL statements at the command line, you can use the A. a text editor B. command-line version of MySQL Workbench C. MySQL Command Line Client D. MySQL Program Server

C. MySQL Command Line Client

Which of the following SELECT statements would you use to prevent duplicate rows from being returned? A. SELECT vendor_id FROM DISTINCT invoices ORDER BY vendor_id B. SELECT vendor_id FROM invoices WHERE DISTINCT ORDER BY vendor_id C. SELECT DISTINCT vendor_id FROM invoices ORDER BY vendor_id D. SELECT vendor_id DISTINCT FROM invoices ORDER BY vendor_id

C. SELECT DISTINCT vendor_id FROM invoices ORDER BY vendor_id

What determines the kind of data that can be stored in a column of a table? A. The default value that's assigned to the column B. The relationship between the column and the primary key of the table C. The data type that's assigned to the column D. Whether the column can contain a null value

C. The data type that's assigned to the column

The type of operation that retrieves data from two or more tables is called a A. combination B. match C. join D. consolidation

C. join

When coded in a WHERE clause, which search condition will return invoices when payment_date isn't null and invoice_total is greater than or equal to $500? A. NOT (payment_date IS NULL AND invoice_total <= 500) B. payment_date IS NOT NULL OR invoice_total >= 500 C. payment_date IS NOT NULL AND invoice_total >= 500 D. payment_date IS NULL AND invoice_total > 500

C. payment_date IS NOT NULL AND invoice_total >= 500

If you define a column with a default value, that value is used whenever a row A. with a null value for that column is added to the table B. is added to the table C. that doesn't include a value for that column is added to the table D. in the table is updated

C. that doesn't include a value for that column is added to the table

When you run a SQL statement that contains a coding error, the error message that MySQL Workbench displays DOES NOT include A. an error code B. brief description of the error C. the likely cause of the error

C. the likely cause of the error

Which of the following is NOT a valid column alias? A. total_sales B. total C. total sales D. "Total Sales"

C. total sales (cannot have spaces)

Which of the following is NOT a database object in MySQL? A. function B. table C. view D. EER diagram

D. EER diagram

Which of the following would return a maximum of 7 rows, starting with the 5th row? A. LIMIT 4, 6 B. LIMIT 7, 4 C. LIMIT 4 D. LIMIT 4, 7

D. LIMIT 4, 7

Which of the following types of statements DOES NOT modify the data in a table? A. DELETE B. INSERT C. UPDATE D. SELECT

D. SELECT

When you code a SELECT statement, you must code the four main clauses in the following order A. SELECT, WHERE, ORDER BY, FROM B. SELECT, FROM, ORDER BY, WHERE C. SELECT, ORDER BY, FROM, WHERE D. SELECT, FROM, WHERE, ORDER BY

D. SELECT, FROM, WHERE, ORDER BY

Which of the following SELECT clauses could you use to assign an alias to the invoice_total column? A. SELECT invoice_number, invoice_date, invoice_total AS total B. SELECT invoice_number, invoice_date, invoice_total total C. SELECT invoice_number, invoice_date, invoice_total : total D. a and b only E. all of the above

D. a and b only

The online version of the MySQL Reference Manual lets you A. use the links in the left sidebar to drill down to the information you're looking for B. search for a specific word or phrase C. return to the Home page D. all of the above

D. all of the above

In a SQL Editor tab of MySQL Workbench, you can do all BUT ONE of the following. Which one is it? A. run a SQL script B. display a SQL script C. code SQL statements D. create a database diagram

D. create a database diagram

The SQL statements that work with the data in a database are called A. data modification language B. data modification statements C. data manipulation statements D. data manipulation language

D. data manipulation language

Which of the following expressions does NOT compute 10% of the balance due if balance due is the invoice total minus the credit total minus the payment total? A. (invoice_total - (payment_total + credit_total)) * 0.10 B. ((invoice_total - payment_total) - credit_total) / 10 C. (invoice_total - payment_total - credit_total) / 10 D. invoice_total - credit_total - payment_total / 10

D. invoice_total - credit_total - payment_total / 10

When coded in a WHERE clause, which of the following search conditions will NOT return a result set that includes all invoices with an invoice_total value of $1000 or less? A. invoice_total BETWEEN 0 AND 1000 B. invoice_total <= 1000 C. NOT (invoice_total > 1000) D. invoice_total IN (0, 1000)

D. invoice_total IN (0, 1000)

A file that contains one or more SQL statements is called a A. stored procedure B. statement list C. snippet D. script

D. script

Which of the following types of relationships can a relational database NOT define? A. one-to-one B. many-to-many C. one-to-many D. zero-to-many

D. zero-to-many


Set pelajaran terkait

Astronomy 101 Chapter 9; Mastering Astronomy Assignment

View Set

Chapter 40: Caring for Clients with Neurologic Deficits

View Set

Organizational Behavior McGraw Hill - Chapter 5

View Set

Need to Know Test - Nurs 225 FINAL

View Set

Psychology - Chapter 1, 2, and 4

View Set