Intro to Database Midterm Practice Exam

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/53

encourage image

There's no tags or description

Looks like no tags are added yet.

54 Terms

1
New cards

How many tables make up the KimTay database?

5

2
New cards

In general, when designing tables, which type of structure is most preferable?

Simple

3
New cards

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

SERVICE_REQUEST

4
New cards

The KimTay database stores several items for each customer's invoice, including the _____.

Invoice date

5
New cards

The KimTay database must combine data from all of its tables in order to print a(n) _____.

Invoice

6
New cards

KimTay's database allows sales reps to sell the same item for different prices by _____.

including a QUOTED_PRICE column in the INVOICE_LINE table

7
New cards

In the StayWell database, each rental property is identified by _____.

A unique integer

8
New cards

Combining the INVOICE_LINE and INVOICES tables in the KimTay database will _____.

make the table more complicated

9
New cards

StayWell rents out and helps to maintain _____.

one-to-five bedroom properties

10
New cards

A property of an entity is _____.

an attribute

11
New cards

In a relational database, _____.

each row should be unique

12
New cards

The duplication of data is formally called _____.

redundancy

13
New cards

One of the categories of update anomalies is _____.

inconsistant data

14
New cards

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

15
New cards

In an entity-relationship (E-R) diagram, tables are represented by _____.

Rectangles

16
New cards

When the commonly accepted shorthand representation is used to describe a database, _____.

it is always acceptable to qualify column names

17
New cards

A relational database _____.

consists of tables called relations

18
New cards

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.

19
New cards

Which statement regarding primary keys is true?

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

20
New cards

In the following shorthand representation of a database, the underlined items are _____.

primary keys

21
New cards

When you are designing a database, _____.

you might be able to determine the relationships between tables directly from the requirements

22
New cards

When you convert an unnormalized table to a table in first normal form, the primary key of the table in first normal form _____.

is usually the primary key of the unnormalized table concatenated with the key for the repeating group

23
New cards

A table in second normal form should be improved to third normal form because _____.

its determinants can cause update anomalies

24
New cards

Within an entity-relationship diagram, which of the following would indicate that the relationship between A and B is one (A) to many (B)?

A line drawn from rectangle A ends in a crow's foot at rectangle B.

25
New cards

SQL was developed in the mid-____.

1970s

26
New cards

What was the original name for SQL?

SEQUEL

27
New cards

It is recommended that table names be limited to _____.

30 characters

28
New cards

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

TBL_1

29
New cards

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

semicolon

30
New cards

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

DELETE

31
New cards

Which data type should you use for columns that contain letters and special characters or numbers that will not be used in calculations?

CHAR

32
New cards

Which of the following SQL commands changes the value in the column LAST_NAME within the row containing a REP_ID of 007?

UPDATE SALES_REP SET LAST_NAME = 'Bond' WHERE REP_ID = '007';

33
New cards

A MySQL database includes a CUSTOMER table, which stores each customer's current balance in U.S. dollars and cents, among other information. The correct data type for the BALANCE column in the CUSTOMER table is _____.

DECIMAL

34
New cards

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

semicolon

35
New cards

Which MySQL command do you use to define a table’s structure by listing its columns, data types, and column lengths?

CREATE TABLE

36
New cards

What special value is used in SQL to represent cases in which an actual value is unknown, unavailable, or not applicable?

null

37
New cards

Which SQL command is used to add rows to a table once its structure has been defined?

INSERT

38
New cards

When you add a row for which you have incomplete information to a SQL table, _____.

you use the INSERT command and name the columns for which you are entering data

39
New cards

Which SQL command is used to view the data in a table?

SELECT

40
New cards

What SQL command do you use to query a database?

SELECT

41
New cards

In the SELECT clause, you can indicate that you want to include all columns using the _____.

* Symbol

42
New cards

Preceding a condition with which SQL operator reverses the truth of the original condition?

NOT

43
New cards

Which of the following operators can be used for a column computation?

+

44
New cards

Which operator uses one or more wildcard characters to test for a pattern match?

LIKE

45
New cards

Mallory would like to display the rows from a MySQL table that have "Red," "Pink," or "White" in the COLOR column. A concise way of writing her query would be to use a(n) _____.

IN clause

46
New cards

When you need to sort data on two columns, the less important column is called the _____.

minor sort key

47
New cards

Which function calculates a total of the values in a column?

SUM

48
New cards

Which clause lets you group data on a particular column?

GROUP BY

49
New cards

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

IS NOT NULL

50
New cards

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

display the results in ascending order by UNIT_PRICE

51
New cards

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

52
New cards

When a subquery is used in a SQL statement _____.

the subquery is evaluated first

53
New cards

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

54
New cards

When you need to find rows with null values in a MySQL table, you can use the _____.

IS NULL operator