Database Concepts Which of the following is NOT a disadvantage of

advertisement
Database Concepts
1.
2.
3.
4.
5.
6.
7.
8.
9.
Which of the following is NOT a disadvantage of maintaining a file processing system over a
database?
a. Data redundancy
b. Wasteful space
c. Ability to update data in one place
d. Data inconsistency
Which of the following is NOT a characteristic of a database?
a. Ability to assign roles to different users
b. A collection of related tables
c. Provide users with the ability to track information
d. Each user must have a copy of all data on the local machine
Which of the following is NOT a characteristic of entities?
a. Can represent a person or thing
b. Each entity is distinguishable from other entities
c. Consists of rows in a table
d. Each entity can be transformed into a table in the database
An attribute:
a. Can only contain text data
b. Represents a property of the entity
c. Can only contain a numerical value
d. Is also called the primary key of the table
A relationship:
a. Identifies the link between different entity sets
b. Represents the link between different primary keys in tables
c. Can only link textual fields
d. Can represent the link between an employee and his / her supervisor
Which of the following is NOT a good example of a relationship between different entities?
a. A professor and his / her department at a university
b. A parent and his / her dependents
c. Product price and employee ID number
d. City and zip code
A database typically does NOT contain information about:
a. The user interface
b. Relationships between entities
c. Attributes of entities
d. Primary keys & foreign keys of tables
Which of the following is NOT a characteristic of a database system?
a. The end user
b. The web site
c. The database management system
d. The database application
Which of the following is NOT a characteristic of a database management system?
a. Reads and updates data
b. Assign roles to different users
c. Present data to the user
d. Creates tables
10. Which of the following is not a good choice for the name of a table attribute?
a. EmployeeID
b. FirstName
c. Field1
d. EmailAddress
11. A database typically contains:
a. Tables
b. Triggers
c. Stored Procedures
d. All of the above
12. The database’s description of its structure is NOT referred to as a:
a. Data dictionary
b. Data Directory
c. Candidate keys
d. Metadata
13. Which of the following is a good choice for a primary key of a table?
a. Email Address
b. First Name & Last Name
c. Street Address
d. Product Description
14. The database management system:
a. Stores information about the tables & their attributes
b. Allows users to interact with the database
c. Only creates numerical fields
d. Does not provide the ability to create forms and reports
15. The relational database model was NOT
a. Developed by E.F. Codd
b. Designed to show the links between different tables
c. Developed to store only textual information
d. Based upon relational algebra
16. Which of the following is NOT an advantage of a view?
a. Allows the user to edit the entire database
b. Hide restricted data from a user that does not have permission to view that data
c. Present only a portion of the data to answer a particular question or query
d. Simplifies the data presented
17. Which of the following is a valid relationship between two different tables?
a. EmployeeID & product price
b. Street address & first name
c. Student & registered classes
d. Computer & salary
18. Which of the following is not a characteristic of primary key?
a. Uniquely identifies each record in a table
b. Can be a combination of one or more table attributes
c. Can be represented by an autonumber field
d. Links an attribute in one table to an attribute in another table
19. Which of the following is not a database design method?
a. From existing data
b. New systems development
c. Modification of a table
d. Database redesign
20. Which of the following is NOT a characteristic of a foreign key?
a. Must be the primary key of the table in all cases.
b. Links an attribute in one table with an attribute in another table.
c. Shows relationships between different tables.
d. An example would be a link between Students in a class and students at the university.
Data Modeling
1. Data modeling is NOT:
a. The most important task when creating a database
b. Creates a logical representation of the database
c. Easier to modify than the database
d. The last step in the design of a new database
2. The Entity-Relationship model was NOT:
a. Developed by Peter Chen
b. Proposed to model the conceptual design of a database
c. Designed to create the database itself
d. Used to create the schema
3. Which of the following is NOT a component of the E-R model?
a. Entities
b. Relationships
c. Attributes
d. Queries
4. Within the E-R model, entities are represented by:
a. Rectangles
b. Triangles
c. Circles
d. Lines
5. A multi-value attribute is:
a. An attribute with more than one value
b. Description of its characteristics
c. An attribute consisting of a group of attributes
d. The primary keys of all tables
6. In an E-R diagram, attributes can be represented by:
a. Diamonds
b. Ellipses
c. Squares
d. Parallelograms
7. An example of a composite identifier is:
a. First name and last name
b. First name only
c. Last name only
d. First name or last name
8. What is the minimum number of entity sets in a relationship?
a. 0
b. 1
c. 2
d. 3
9. A derived attribute CANNOT be:
a. Calculated by using other data in the table
b. Total cost per line item (quantity X unit cost)
c. Represented by a dotted line in an E-R diagram
d. Represented by a thick line in an E-R diagram
10. Which of the following is not representative of a binary relationship between different tables?
11.
12.
13.
14.
15.
16.
17.
18.
19.
a. One to one
b. One to Many
c. One to None
d. Many to Many
In an E-R diagram, optional relationships are represented by:
a. Placing all attributes inside a square with curved edges
b. Placing a circle on the side of the entity set that is optional
c. Drawing a dotted circle around the optional entity set
d. There are no optional relationships.
Which of the following is NOT a characteristic of Crow’s Foot notation:
a. Relationships can be one to many
b. Relationships can be many to many
c. Participation is optional or required
d. Relationships are all required.
A subtype entity:
a. Is weak
b. Always has a relationship with the supertype of one to many
c. Inherits attributes from the supertype entity
d. Increases the amount of nulls in a table
A discriminator:
a. Determines the appropriate subtype
b. Contains only numerical identifiers
c. Is always the primary key of the table
d. Is always the foreign key of the table
The data modeling process is characterized by:
a. One iteration
b. Always involving users in the process
c. Translating the processes of a department into a database design.
d. None of the above
How would a 1 to many relationship be represented in Crow’s foot notation?
a. Employee |-----------------|<-Department
b. Employee |----------|Department
c. Employee O--------|Department
d. Employee |-------O Department
Which of the following is NOT an example of a discriminator?
a. Gender
b. College year
c. Supertype
d. Car make
The relationship between manufacturer and product SKU would most likely be:
a. One to many
b. Many to many
c. None to many
d. One to one
Which of the following is an example of a composite attribute?
a. Product ID and product cost
b. Zip code and street address
c. Grade and course
d. Student and courses taken
20. The cardinality of a relationship refers to:
a. The maximum number of entity instances that can participate in a relationship
b. The minimum number of entity instances that can participate in a relationship
c. The count of entity instances that can participate in a relationship
d. A relationship between entity instances that does not exist.
Relational Model - Functional Dependencies & Normalization
1. Which of the following is NOT a characteristic of a relation?
a. Rows contain data about an entity
b. Columns contain data of the same kind
c. Table cells hold a single value
d. The order of rows is important
2. Which of the following is NOT a characteristic of a functional dependency?
a. One or more attributes determines the value of another attribute
b. Attribute on the left side of the functional dependency is called the antecedent
c. May be based on equations
d. Is represented by Attribute1 - Attribute2
3. Which of the following is a valid functional dependency?
a. Age - Weight
b. Birthday  Age
c. Height -Weight
d. Weight  Height
4. Which of the following is NOT a valid functional dependency, given that A  (B,C)?
a. A- B
b. A  C
c. B  C
d. None of the above
5. Which of the following are the best attributes to choose when designing a table containing
mailing address information?
a. Name, Street Address, City, State, Zip
b. Name, Street Address, Zip Code; second table containing Zip Code, State, and City
c. First Name, Last Name, Address1, Address2, Address3, City, State, Zip
d. All of the above are good designs.
6. Which of the following is a valid functional dependency?
a. (Quantity, Price)  Extended Price
b. Quantity  Extended Price
c. Price  Extended Price
d. Extended Price  (Quantity, Price)
7. Which of the following is NOT a valid deduced functional dependency?
a. If A  B, then AC  BC
b. If A  B and B  C, then A  C
c. If AC  D and BE  D, then AC  BE
d. If D  AC and D  BE, then D  (A, B, C, E)
8. Which of the following is a Superkey that can be used to uniquely identify a person?
a. Street Address
b. Birth date
c. Social Security Number
d. Mother’s maiden name
9. Which of the following is NOT a characteristic of a primary key?
a. It is chosen from the set of candidate keys
b. Every value of the primary key is unique.
c. It functionally determines all other attributes in the relation
d. It cannot contain more than one attribute.
10. Which of the following is NOT a characteristic of a surrogate key?
a. It is user-supplied.
b. It uniquely identifies all other attributes in a relation.
c. It is hidden on forms and reports.
d. Values will not repeat.
11. Which of the following is the best way to split the relation (SKU number, product description,
cost, sale price, department name)
a. Leave as is, cannot be decomposed
b. SKU number, product description, cost, sale price, departmentID, in one table;
departmentID, department name in another
c. SKU number, product description, cost, departmentID in one table, DepartmentID,
department name in another
d. SKU number, product description, departmentID in one table; departmentID and
department namein another, SKU number, cost, sale price in a third table
12. Which of the following is the highest level normal form?
a. First normal form
b. Second normal form
c. Boyce Codd normal form
d. Dunning Newman normal form
13. If a column contains the following values, which of the following relations is not in First normal
form?
a. {1, 2, 3, 4, 1}
b. {1, 2, 3, 4}
c. {1, 4, 2, 3}
d. {1, 2, 3, 4, 5}
14. Which of the following is NOT a characteristic of Third normal form?
a. No non key attribute is functionally dependent upon another non key attribute.
b. The relation must also be in first normal form.
c. The relation must also be in second normal form.
d. If a table contains three attributes A, B, C, D and A B, C,D and C D, then the relation
will be in third normal form if it is decomposed into 2 relations A, C and B, C, D
15. Which of the following is NOT a characteristic of Second normal form?
a. An attribute is non key if it is not part of the primary key.
b. It may or may not be in First Normal form.
c. No non key attribute is dependent on only a portion of the primary key.
d. It must also be in Boyce Codd normal form.
16. Which of the following is a characteristic of Boyce Codd Normal form?
a. Every determinant is a candidate key.
b. The table qualifies as a relation
c. All non key attributes are dependent on the primary key.
d. There are no transitive dependencies.
17. Given two relations, A, B and B,C, C where A B and B C with no repeating values, this
relation must at least be in which normal form?
a. First Normal Form
b. Second Normal Form
c. Third Normal Form
d. Boyce Codd Normal Form
18. Given this set of functional dependencies in a table (AB, AC, C  D), which attribute is the
best choice for a primary key?
a. A
b. B
c. C
d. D
19. Which of the following attributes could NOT be considered a candidate key for a relation if A
B, B C, and CD?
a. A
b. B
c. C
d. D
20. Which of the following is the best choice for a primary key for a relation?
a. ProductID
b. ProductDescription
c. UnitPrice
d. OrderDate
SQL
1. How many relations are generated as the result of a relational operator?
a. 1
b. 2
c. 3
d. 4
2. Which of the following is NOT a valid SQL query verb?
a. Select
b. Insert
c. Update
d. Remove
3. Which of the following is NOT a valid SQL data type?
a. Integer
b. String
c. Char
d. Date
4. Which of the following is NOT a characteristic of the Select statement in SQL?
a. Returns all rows that meets given criteria.
b. Eliminates duplicates.
c. Equivalent to the project operator in relational algebra.
d. Allows for the display of only selected attributes.
5. The SQL statement Select * from Students where StudentID=100 will carry out which of the
following actions.
a. Display the primary key in the student table.
b. Display all attributes from the Students table where the StudentID is 100
c. Display only the StudentID attribute from the Students table where StudentID is 100.
d. Display all records from the Students table.
6. The SQL statement Order By StudentID will carry out which of the following actions.
a. Sort StudentID ascending
b. Sort StudentID descending
c. Randomly sort StudentID
d. Sort StudentID by the primary key.
7. The SQL statement Select Count(StuID) from Students will carry out which of the following
actions.
a. Return the number of rows in the Students table.
b. Return the number of columns in the Students table.
c. Return the number of cells in the Students table.
d. Return the number of unique rows in the Students table.
8. Which of the following actions will be carried out by the Select (Count(Distinct StuID)) from
Students statement?
a. Return all unique rows in the Students table.
b. Return all rows in the Students table.
c. Return the number of rows in the Students table.
d. Return the number of unique values entered in the StuID column in the Students table.
9. Which of the following is NOT a SQL calculation function?
a. Min
b. Max
10.
11.
12.
13.
14.
15.
16.
17.
18.
c. Sum
d. Summary
Which of the following is the SQL statement used to find the average GPA of students in their
Freshman year at the college?
a. Select Average(GPA) from Students where Year=”Freshman”;
b. Select Avg(GPA) from Students where Year=”Freshman”;
c. Select Total(GPA) from Students where Year=”Freshman”;
d. Insert Avg(GPA) from Students where Year=”Freshman”;
If you wanted to find all nulls in the FirstName field of a table, you would use the following
criteria:
a. Where FirstName IS NULL
b. Where FirstName = “”
c. Where FirstName<>”%”
d. Where FirstName Like Null
If you wanted to update the value of StudentPreReq for each student taking IS631 to “NONE”,
the SQL Statement would be:
a. Select Student Set StudentPreReq=”NONE” where ClassID=”IS631”
b. Insert Student From StudentPreReq=”NONE” where ClassID=”IS631”
c. Delete Student Set StudentPreReq=”NONE” where ClassID=”IS631”
d. Update Student Set StudentPreReq=”NONE” where ClassID=”IS631”
Which of the following SQL statements is the correct way to insert a new student into the
database?
a. Insert Into Students (StudentID, StudentName) Values “12345”,“New Student”;
b. Insert Into Students (StudentID, StudentName) “12345”,“New Student”;
c. Insert Into Students (StudentID, StudentName);
d. Insert Students (StudentID, StudentName) Values “12345”,“New Student”;
Which of the following SQL statements would delete all rows from the STUDENTS table whose
last name is Jones?
a. Delete From Students if LastName=”Jones”;
b. Delete From Students where LastName=”Jones”;
c. Delete From Students when LastName=”Jones”;
d. Delete Students where LastName=”Jones”;
Which of the following is a characteristic of the SQL functions?
a. Can operate on a single column of a table.
b. Must be numerical values entered in the row.
c. Includes null values in the calculation.
d. Cannot calculate the average value.
Which of the following items are NOT valid for use in a Where predicate of a SQL query?
a. IS NULL
b. IS NOT NULL
c. <>
d. NOT EQUAL
Which of the following is NOT a valid SQL statement?
a. Select * From Students;
b. Select All From Students;
c. Select StudentID from Students;
d. Select FirstName from Students;
Which of the following is NOT a characteristic of the CREATE TABLE SQL statement?
a. It assembles a new table in the database with the specified attributes.
b. It cannot create the primary key.
c. It can create any number of attributes.
d. It can create an attribute with SmallInt values.
19. Which of the following field attributes CANNOT be set using the CREATE TABLE SQL statement?
a. NOT NULL
b. Foreign Key
c. Primary Key
d. Values to be inserted into the table.
20. Which of the following SQL statements is correct?
a. Select ComputerName, ComputerID from Computers where ComputerID=”1000”;
b. Select ComputerName, ComputerID where ComputerID=”1000” from Computers;
c. Insert Into ComputerName Values “1000” ComputerID, Computers;
d. Delete From Computers Then ComputerID=”1000”;
Download