Multiple Choice Questions

advertisement
班級
學號
姓名
A. Multiple Choice Questions (80%)
( D )1. A table on the many side of a one to many or many to many relationship must:
A)be in Second Normal Form (2NF) B)be in Third Normal Form (3NF) C)have a
single attribute key D)have a composite key
( A )2. A data type that creates unique numbers for key columns in Microsoft Access is:
A)autonumber
B)Boolean
C)sequential key
D) sequential number
( B )3. Assume you are dealing with a purchasing database involving a single table. This
table contains information on the customer, sale, and items purchased, where the sales
order number is the primary key. Using this database design, as you remove old sales
information, you may loose information on some of your customers. This is an example
of:
A)a hidden dependency
B)a deletion anomaly
C)an update anomaly
D)referential data integrity
( D )4. Tables in second normal form (2NF):
A)eliminate all hidden dependencies
B)eliminate the possibility of a insertion
anomalies C)have a composite key D)have all non-key fields depend on the whole
primary key
( BA )5. A dependency exist between two columns when:
A)together they constitute a composite key for the table B)knowing the value in one
column determines the value stored in another column
C)the table is in 3NF
D)together they constitute a foreign key
( C )6. Data integrity constraints are used to:
A)control who is allowed access to the data
B)ensure that duplicate records are not
entered into the table C)improve the quality of data entered for a specific property
(i.e., table column) D)prevent users from changing the values stored in the table
( B )7. Establishing limits on allowable property values, and specifying a set of acceptable,
predefined options that can be assigned to a property are examples of:
A)Attributes
B)Data integrity constraints
C)Method constraints D)Referential
integrity constraints
( C )8. Which of the following can be addressed by enforcing a referential integrity
constraint?
A)all phone numbers must include the area code B)certain fields are required (such
as the email address, or phone number) before the record is accepted
C)information
on the customer must be known before anything can be sold to that customer
D)when entering an order quantity, the user must input a number and not some text
(i.e., 12 rather than ‘a dozen’)
( X )9. Which of the following can be addressed by enforcing a data integrity constraint?
A)Ensuring that only numbers are entered into some properties (i.e., the Grades field,
which records test scores) B)The fields that constitute the primary key are unique
for each record
C)The records in the database are ordered alphabetically, first by
last name and then by first name
D)Valid input for the gender property is either M,
F, Unknown
1/3
( A )10. Failure to specify cascading delete when enforcing referential integrity can cause
what problem?
A)A foreign key may reference a value in the originating table that no longer exists
B)All the records in a given table can be accidentally deleted
C)The primary key
may no longer be unique in a given table D)There will be no control over the
creation of duplicate data
( B )11. The data dictionary/repository contains:
A) all the data contained in the database
B)definitions of all the tables, columns,
data domains and assumptions used in the database C)help files for working with
databases D)all of the above
( D )12. The term for information that describes what type of data is available in a database
is:
A)data dictionary B)data repository C)index data D)metadata
( C )13. What is the benefit of using a query language rather than a nature language to get
information out of a database?
A)Query languages allow the user to pose unstructured, open ended queries
B)Query languages are more flexible than natural language C)Query languages are
more precise so there is less room for misinterpretation
D)There is no benefit of
query languages over natural languages for getting information out of a database.
( AD )14. Which of the following is not true about the Query by Example (QBE) method of
accessing data in a database?
A)Can totally replace the need to learn and use SQL B)Easier for beginners to use
than SQL C)Provides a visually-oriented tools to query the database D)All of the
options above are true.
( D )15. Which of the following is not one of the primary tasks of a query language?
A)Change and manage the information stored in the database
B)Define the
structure of the database C)Locate and retrieve data contained in the database
D)All the above are primary tasks of a query language
( D )16. What does a Null value represent in a database?
A)A negative or false value B)A text string full of spaces
'illegal value' D)Missing data
C)An error, such as
( C )17. What basic question is addressed with the SQL keyword SELECT?
A)How are the tables connected together B)What do you already know (or what
constraints are given)
C)What output do you want to see
D)What tables are
involved
( CD )18. What basic question is addressed with the SQL keyword FROM?
A)How are the tables connected together B)What do you already know (or what
constraints are given)
C)What output do you want to see
D)What tables are
involved
( BC )19. What basic question is addressed with the SQL keyword WHERE?
A)How are the tables connected together B)What do you already know (or what
constraints are given)
C)What output do you want to see
D)What tables are
involved
( B )20. Which SQL command is used to indicate how tables are linked together?
2/3
A)GROUP
B)JOIN
C)LINK
D)TABLES
( B )21. Which SQL command is used to eliminate duplicate records from a query result?
A)COMBINE B)DISTINCT C)GROUP D)UNIQUE
( X )22. If you want to get a list of your customers that have purchased from you in the last
year, but you only want to list each customer once, how can you prevent multiple
listings of the same customer?
A)INDEX BY B)ORDER BY C)SELECT BY D)SEQUENCE
( D )23. What type of results can a Boolean Expression have?
A)A number B)A text string C)All type of results are possible (i.e., yes/no, text,
numbers, dates, etc)
D)Either a Yes or No
( C )24. When creating a query, what is the purpose of including a column Alias?
A)The real name is not known B)To control the sort order C)To give the query
designer control over the column name
D)To maintain anonymity
( A )25. What is the purpose of the SQL clause BETWEEN?
A)Impose a query constraint covering a range of values B)Indicate that two tables
have an association C)To establish the sequence of columns for a query D)To
modify the JOIN command
( C )26. A stored query is referred to as a:
A)perspective B)snapshot C)view
D)window
( A )27. What modifier do you add to the ORDER BY command to sequence the output in
descending order?
A)DESC
B)DOWN
C)ZTOA
D)No modifier is needed. This is the default
ordering
( A )28.What is the impact of not including a JOIN command when using multiple tables in
a query?
A)All records in each table are associated with all records in the other tables B)The
foreign keys in each table are linked to the primary keys in the other tables C)The
primary keys in each table are joined together D)The query will not work – an error
is generated
( D )29. What is the purpose of the SQL operator IN?
A)Indicates which table each field can be found
B)Specifies that the sort order
should be increasing C)Used in the GROUP BY statement to indicate sub-groups
D)Used to test if one value appears in a set of values
( B )30. An UPDATE query:
A)is used to add new records to a table
B)is used to change existing value within a
table
C)is used to change the structure of the database
D)is used to determine
what has changed in the database since the last benchmark process
( B )31. What is a Schema?
A)A very high level, conceptual overview of the database B)Collection of tables in
the database
C)The collection of saved queries
D)The systems and processes
contained in the DBMS supporting the administration of the data
( A )32. You would use this SQL command to remove a table and all its contents from the
database schema?
3/3
A)DROP TABLE
B)GROUP BY
C)INDEX BY
D)SEQUENCE BY
B. Write the SQL statements to answer the following two questions based on
tables Animal and SaleAnimal in a database.
Animal(AnimalID, Name, Category, DateBorn, ListPrise)
SaleAnimal(SaleID, AnimalID, SalePrice)
1. List all the rows in table Animal whose Category is “CAT” which was born in May. (10%)
SELECT AnimalID, Name, Category, DateBorn
FROM Animal
WHERE (((Animal.Category)="Cat") AND ((Animal.DateBorn) Between #5/1# And #5/31#));
DateBorn 內容只紀錄 月與日
2. What is the total money made by selling “CAT” in December?
(10%)
SELECT Sum(SaleAnimal.SalePrice) AS SumOfSalePrice (可有可無)
FROM Sale INNER JOIN SaleAnimal ON Sale.SaleID = SaleAnimal.SaleID
WHERE ((DateBorn Between #12/1# And #12/31#));
月份以 DateBorn 的日期為依據
4/3
Download