Shared Flashcard Set

Details

MSSQL Lesson 6
Multiple-Choice Questions from MSSQL Lesson 6
7
Computer Science
Undergraduate 2
03/03/2013

Additional Computer Science Flashcards

 


 

Cards

Term

You have data in your database that looks like Table 6-5 (pg. 70).  What is the ProductName object?

 

a. a record

b. an entity

c. a data type

d. a view

Definition
b. Tables consist of columns and rows and of attributes and records. Fields store a single value (an intersection of a column and row) and contain a certain type of information such as last name or zip code. A record is a group of related fields containing information about a single entity (such as a person) that spans all the fields. In Microsoft Access, a field is a synonym for column. ProductName, therefore, is sometimes known as a field that contains the name of the product for each record in the table.
Term

In Table 6-5, which object contains all the data about screwdrivers?

 

a. a record

b. a field

c. a data type

d. a view

Definition
a. Tables consist of fields and records. Fields contain a certain type of information such as last name or zip code. A record is a group of related fields containing information about a single entity (such as a person) that spans all the fields. The line that contains all of the records about screwdrivers is, therefore, a record.
Term

In Table 6-4, which values can be used in the InStock field?

 

a. dates

b. numbers.

c. texts

d. 0s and 1s

Definition
d. Data types restrict the type of data that can be inserted in a column. The InStock column has the bit data type assigned, which means only 0s and 1s can be stored in it.
Term

Suppose you want to add a column to Table 6-4 that contains the price of the product.  None of your products cost more than $300.  Which data type should you use?

 

a. int

b. money

c. smallmoney

d. float

e. real

Definition

c. This new column would be best suited for smallmoney. Int allows only whole numbers so it would not allow change (in other words, $1.50 would not work). Float would work as well, but it is not meant for storing currency. Money is meant for storing currency, but it is best suited to values larger than 214,748.3647. So, because you are selling products valued at less that $300, it is best to use smallmoney.

Term

Using the data from Table 6-5 (pg. 71), you need to partition the table into three divisions, one for employees who make less than $50,000, one for employees who make $50,000 to $70,000, and one for employees who make $70,001 and higher.  Palce the following steps in order to create a partition for this table.

 

a. Create a partition scheme.

b. Create a partition function.

c. Add filegroups to the database.

d. Choose a partition column and value.

Definition
d, c, b, a. First, you have to plan the partition and choose a column. Next, you need to make sure you have enough filegroups in the database to handle the partitions. After you have that, you can create a partition function, and then you can create the partition scheme.
Term

Using the data from Table 6-5 (pg. 71), you need to partition the table into three divisions, one for employees who make less than $50,000, one for employees who make $50,000 to $70,000, and one for employees who make $70,001 and higher.  Which function should you use?


a. CREATE PARTITION FUNCTION pfSalary (money) AS RANGE LEFT FOR VALUES (50000, 70000);

b. CREATE PARTITION FUNCTION pfSalary (money) AS RANGE LEFT FOR VALUES (50001, 70001);

c. CREATE PARTITION FUNCTION pfSalary (money) AS RANGE RIGHT FOR VALUES (50000, 70000);

d. CREATE PARTITION FUNCTION pfSalary (money) AS RANGE RIGHT FOR VALUES (50001, 70001);

Definition
a. The LEFT range gives you three partitions: 0–50,000, 50,001–70,000, and 70,001 and higher. A RIGHT range would give you 0–49,999, 50,000–69,999, and 70,000 and higher.
Term

Using the data from Table 6-5, you need to partition the table into three divisions, one for employees who make less than $49,999, one for employees who make $50,000 to $69,999, and one for employees who make $70,000 and higher.  Which function should you use?

 

a. CREATE PARTITION FUNCTION pfSalary (money) AS RANGE LEFT FOR VALUES (50000, 70000);

b. CREATE PARTITION FUNCTION pfSalary (money) AS RANGE LEFT FOR VALUES (50001, 70001);

c. CREATE PARTITION FUNCTION pfSalary (money) AS RANGE RIGHT FOR VALUES (50000, 70000);

d. CREATE PARTITION FUNCTION pfSalary (money) AS RANGE RIGHT FOR VALUES (50001, 70001);

Definition
c. The RIGHT range gives you three partitions, 0–49,999, 50,000–69,999, and 70,000 and higher. A LEFT range would give you 0–49,999, 50,000–69,999, and 70,000 and higher.
Supporting users have an ad free experience!