Quiz
SER 322 Midterm
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (63)
1What is a Composite attribute?
- AAn attribute that represents a value that is derivable from a related attribute or set of attributes, not necessarily in the same entity
- BAn attribute that holds multiple values for a single component
- CAn attribute composed of multiple components each with individual existence
- DAn attribute that holds a single value for a single entity
- EAn attribute composed of a single component with an independent existence
2A condition that an entity can be a member of at most one of the subclasses of the specialization is called ______________.
- Acompleteness constraint
- Boverlapping constraint
- Cdisjointness constraint
- Dpredicate constraint
3A condition that every entity in the superclass must be a member of some subclass in the specialization/ generalization is called ______________.
- Acompleteness constraint
- Bdisjointness constraint
- Coverlapping constraint
- Dpredicate constraint
4An entity is ____________.
- Aan inanimate object in an application
- Ba collection of items in a mini-world
- Ca distinct object or thing in a mini-world
- Da data structure
5An entity that does not have sufficient attributes to form a primary key is termed a __________.
- AVariant
- BStrong entity
- CWeak entity
- DVariable
6In an E-R diagram entities are represented by _______________.
- Adiamond shaped box
- Bcircles
- Cellipse
- Drectangles
7Relationship types of degree 3 are called _______________.
- Aternary
- Bbinary
- Cn-ary
- DNo answer text provided.
8Suppose:
VEHICLE is a superclass
{CAR, TRUCK} are subclasses of VEHICLE
VEHICLE is a _____________________of {CAR, TRUCK}.- Aunion-type
- Bspecialization
- Cgeneralization
- Dcategory
9What is Specialization?
- Athe process of defining a set of subclasses of a superclass
- Bthe process of defining a set of superclasses of a subclass
- Cthe process of identifying and defining classes
- DNo answer text provided.
10What is a Derived attribute?
- AAn attribute composed of multiple components each with individual existence
- BAn attribute that holds multiple values for a single component
- CAn attribute that holds a single value for a single entity
- DAn attribute composed of a single component with an independent existence
- EAn attribute that represents a value that is derivable from a related attribute or set of attributes, not necessarily in the same entity
11What is a Single-valued attribute?
- AAn attribute that represents a value that is derivable from a related attribute or set of attributes, not necessarily in the same entity
- BAn attribute that holds multiple values for a single component
- CAn attribute that holds a single value for a single entity
- DAn attribute composed of multiple components each with individual existence
- EAn attribute composed of a single component with an independent existence
12What is a Multi-valued attribute?
- AAn attribute that represents a value that is derivable from a related attribute or set of attributes, not necessarily in the same entity
- BAn attribute that holds multiple values for a single component
- CAn attribute that holds a single value for a single entity
- DAn attribute composed of multiple components each with individual existence
- EAn attribute composed of a single component with an independent existence
13What is a Simple attribute?
- AAn attribute that represents a value that is derivable from a related attribute or set of attributes, not necessarily in the same entity
- BAn attribute that holds multiple values for a single component
- CAn attribute that holds a single value for a single entity
- DAn attribute composed of multiple components each with individual existence
- EAn attribute composed of a single component with an independent existence
14What type of relationship is described by the following rule? For one instance of entity A, there exists zero, one, or many instances of entity B; and for one instance of entity B, there exists zero, one, or many instances of entity A. Select the best answer.
- A1:1 relationship
- B1:N relationship
- CM:N relationship
- DNo answer text provided.
15What type of relationship is described by this rule? For one instance of entity A, there exists zero, one, or many instances of entity B; but for one instance of entity B, there exists zero or one instance of entity A. Select the best answer.
- A1:1 relationship
- B1:N relationship
- CM:N relationship
- DNo answer text provided.
16_____ is a attribute (or a set of attributes) in a database relation that has a unique value.
- AForeign Key
- BSuper Key
- CSecondary Key
- DAlternate Key
17 _____ constraint dictates that the foreign key must contain values that match the primary key in the related table, or must contain null.
- ADomain
- BKey
- CReferential Integrity
- DEntity Integrity
18Consider the following relations for a database that keeps track of business trips of salespersons in a sales office:
SALESPERSON (SSN, Name, Start_Year, Dept_No)
TRIP (TripID, SSN, From_City, To_City, Departure_Date, Return_Date)
EXPENSE (TripID, Account#, Amount)
Identify the foreign keys for this schema.- ATripID in EXPENSE relation references TRIP relation; SSN in TRIP relation references SALESPERSON relation
- BTripID in EXPENSE relation references TRIP relation
- CSSN in SALESPERSON relation
- DAccount# in EXPENSE relation
19Consider the following relations for a database that keeps track of business trips of salespersons in a sales office:
SALESPERSON (SSN, Name, Start_Year, Dept_No)
TRIP (TripID, SSN, From_City, To_City, Departure_Date, Return_Date)
EXPENSE (TripID, Account#, Amount)
Which one of the following is a valid super key for TRIP relation?- ASSN, To_City
- BSSN
- CFrom_city, Departure_Date
- DTripID, SSN, Return_Date
20In relational model terminology, table is considered as
- Aquery
- Bdomain
- Crelation
- Dtuple
21Suppose R(A, B) has the following tuples:
A B
3 3
6 5
2 3
and relation S(B, C) has the following tuples:
B C
1 6
5 8
3 5
Compute the natural join of R and S. Which of the following tuples is in the resulting relation with schema (A, B, C).- A(3 3 5)
- B(6 5 6)
- C(3 3 1)
- D(2 3 3)
22Suppose relation R(A,B) has the following tuples:
A B
2 a
4 t
2 g
4 c
9 t
and relation S(B,C,D) has the following tuples:
B C D
c 5 6
a 7 8
t 8 3
Compute the theta-join of R and S with the condition R.B = S.B AND R.A < S.C Which of the following tuples is in the result? Assume each tuple has schema (A, R.B, S.B, C, D).- A(9, t, t, 8, 3)
- B(2, g, t, 8, 3)
- C(4, t, t, 8, 3)
- D(2, g, g, 7, 8)
23Suppose relation R(A,B,C) has the following tuples:
A B C
1 2 3
4 2 7
4 5 6
2 5 3
1 2 6
Compute the projection π C,B (R). Which of the following tuples is in the result?- A(2,5)
- B(2,6)
- C(7,2)
- D(6,4)
24The division operation is applied to two relations: R(Z) divided by S(X) where __________.
- AX is a subset of Z
- BZ is a subset of X
- CZ and X are union/type compatible
- DZ = X
25What is the purpose of select operation in Relational Algebra?
- ASelects all tuples that satisfy the selection condition from a relation R.
- BProduce a new relation with only some of the attributes of relation R, and removes duplicate tuples.
- CProduces all combinations of tuples from relations R1 and R2 that satisfy the join condition
- DProduces a relation that includes all tuples from relation R.
26Which of the following operation(s) require that relations on which they are applied be union-compatible?
- AUNION
- BINTERSECTION
- CDIFFERENCE
- DNATURAL JOIN
- EALL OF THE ABOVE
27With SQL, how do you select all the records from a table named "Students" where the “FirstName” is Jack and “Marks” are greater than 65?
- ASELECT * FROM Students WHERE ‘FirstName’=’Jack’ AND ‘Marks’>65;
- BSELECT * FROM Students WHERE ‘FirstName’=’Jack’, ‘Marks’>65;
- CSELECT * FROM Students WHERE FirstName=’Jack’ AND Marks>65;
28The following keyword selects records that have matching values in both tables.
- ALEFT JOIN
- BINNER JOIN
- CRIGHT JOIN
- DSELF JOIN
29Which SQL keyword is used to sort the result-set in descending order using the NAME column?
- ASORT BY NAME DESC
- BORDER BY NAME DESC
- CORDER DESC NAME
- DORDER NAME DESC
30Which SQL keyword is used to group rows with same values .
- AJOIN
- BORDER BY
- CCOMBINE
- DGROUP BY
31How do you change the marks of all students in Students table with marks 65 to 70 with SQL.
- AUPDATE Students SET Marks=65 WHERE Marks = 70;
- BMODIFY Students SET Marks=70 WHERE Marks = 65;
- CUPDATE Students SET Marks=70 WHERE Marks = 65;
32With SQL, how can you delete the records from “Students” table where the “LastName” is Williams .
- ADELETE ROW Students WHERE LastName =’Williams’;
- BDELETE FROM Students WHERE LastName =’Williams’;
- CDELETE Students WHERE LastName =’Williams’;
- DDELETE TABLE Students WHERE LastName = ‘Williams’;
33Composite attribute in ER model is represented in relational model as ________________.
- AOne column for each component attribute and NO column for the composite attribute
- BOne column for the composite attribute
- COne column for each component attribute and one column for the composite attribute
- DSeparate table for component attributes
34For disjoint AND complete mapping class hierarchy, a table is created for the super class entity set during mapping to relational model.
- ATrue
- BFalse
35For mapping one to one relationship without total participation from ER model to relational model, the following is true.
- AThere is one column for each participating entity set’s primary key.
- BThe representation is ignored
- COne extra column is augmented to the table of the entity set
36For many-to-many relationships being represented in relational model, primary key of the new schema is the foreign key of relation with less cardinality.
- ATrue
- BFalse
37During mapping weak entity sets of (E)ER model to relational model, primary key of the weak entity set is
- Aforeign key of the strong entity set
- Bdiscriminator plus foreign key
- Cdiscriminator
- Dprimary key of the strong entity set
38The goals for mapping a (E)ER model to Relational model are:
- APreserve all information
- BMinimize null values
- CMaintain constraints to extent possible
- DMinimize number of tables
39For non-disjoint and/or non-complete class hierarchy, which of the following statements are true when mapping from ER to relational model.
- Aa table is created for each super class entity set according to
normal entity set translation method. - Bprimary key of the subclass table is used as primary key of the new table
- Cprimary key of the super class table is used as the primary key of the new table.
- Da table is created for each subclass entity set with a column for
each of the attributes of that entity set plus one for each
attributes of the primary key of the super class entity set
- Aa table is created for each super class entity set according to
40Which type of driver provides JDBC access via one or more ODBC drivers?
- AType 1 driver
- BType 2 driver
- CType 3 driver
- DType 4 driver
41Which of the following provides the application-to-JDBC Manager connection.
- AJDBC Driver
- BJDBC API
- CJDBC Driver API
- DSQL Server
42
With the code below, indicate JDBC coding best practices that have been violated (this code does compile and run!):
import java.sql.*;
public class StudentData{
public static void main(String[] args) {
ResultSet rs = null;
Statement stmt = null;
Connection conn = null;
try {
Class.forName("org.postgresql.Driver");
conn = DriverManager.getConnection(args[2], args[0], args[1]);
stmt = conn.createStatement();
rs = stmt.executeQuery("SELECT * FROM Student WHERE rollno='" + args[3] + "'");
while (rs.next()) {
System.out.print(rs.getInt(1) + "\t");
System.out.print(rs.getString(2) + "\t ");
System.out.print(rs.getInt(3) + "\t ");
System.out.println(rs.getDate(4));
}
stmt.close();
stmt = null;
rs.close();
rs = null;
}
catch (Exception exc) {
exc.printStackTrace();
}
}
}
- AThe program imports all of the java.sql packages
- BThis program does not properly close database resources
- CThe program should catch SQLException
- DThe program should not string-concatenate a query, but rather use a PreparedStatement.
- EThe program retrieves data from a ResultSet by column number instead of by name
- FThe program hardcodes the name of the JDBC driver and the SQL query. These should be externalized from the compilable code.
- GAnswer 1, 3 and 5 only
- HAnswers 1-6 all apply
43In JDBC, it is a good practice to use standard SQL statement and avoid using db specific query until necessary.
- ATrue
- BFalse
44Which statement about JDBC is true?
- AJDBC is an API to access no relational databases
- BJDBC is an API to connect relational, object and xml databases
- CJDBC stands for Java Database Connectivity
- DJDBC is an API to bridge the object-relational mismatch between OO programs and relational databases
45Which of the following are not benefits of XML over traditional relational data modelling?
- ASupport for Large Objects (LOBs)
- BXML is readable and understandable, even by novices, and no more difficult to code than HTML.
- CXML is extendable.
- DAbility to extend the type system using DTDsor XML Schemas
46When XML is used as a DDL, we want to ensure the XML conforms to this so structural constraints may be specified:
- ADTD or XML Schema
- BXPath
- Cwell-formedness
- DSQL2006 extensions
47The type of XML Parsing that is parses an XML document based on expression and is used extensively in conjunction with XSLT.
- ASAX Parsing
- BDOM parsing
- CStAX
- DXPath Parsing
48On the XML below, which XPath expression will return all of the values of title attributes?
<slideshow
title="Sample Slide Show"
date="Date of publication"
author="Yours Truly"
>
<!-- TITLE SLIDE -->
<slide type="all">
<title>Wake up to WonderWidgets!</title>
</slide>
<!-- OVERVIEW -->
<slide type="all">
<title>Overview</title>
<item>Why <em>WonderWidgets</em> are great</item>
<item>Who <em>buys</em> WonderWidgets</item>
</slide>
</slideshow>- A//[@title]
- B//@title
- C//slide/title
- D//title
49Well formed XML document means
- Ait contains a root element
- Bit contain an element
- Cit contains one or more elements
- Dmust contain one or more elements and root element must contain all other elements
50A transaction is delimited by statements (or function calls) of the form __________.
- AStart transaction and Stop transaction
- BBegin transaction and End transaction
- CGet transaction and post transaction
- DRead transaction and write transaction
51All functional dependencies must ________
- Ahave attributes of the same table
- Bhave a single attribute on its left-hand side (LHS)
- Chave a single attribute on its right-hand side (RHS)
- DAll of the above
52
Assume that a relation R has the following properties. What is the normal form of R?
No multi-valued attributes
No partial key dependencies- AFirst Normal Form
- BSecond Normal Form
- CThird Normal Form
- DBoyce-Codd Normal Form
53
Assume that a relation R has the following properties. What is the normal form of R?
Has no multi-valued attributes
Has no partial key dependencies
Has attributes with atomic domains
Has transitive dependencies- A1NF & 2NF
- B1NF, 2NF, & 3NF
- C1NF & 3NF
- DBCNF
54Considering functional dependency, one in which removal from some attributes must affect dependency is called ________.
- Afull functional dependency
- Bpartial dependency
- Cprime functional dependency
- Dtransitive dependency
55During translation of SQL queries into relational algebra queries, Anti-join is used for unnesting ________ subqueries.
- ANOT EXISTS, NOT IN, ALL
- BEXISTS, IN, ANY
- CJOIN
- DOUTER JOIN
56During translation of SQL queries into relational algebra queries, Semi-join is used for unnesting ________ subqueries.
- ANOT EXISTS, NOT IN, ALL
- BEXISTS, IN, ANY
- CJOIN
- DLEFT OUTER JOIN
57In the __________ normal form, a composite attribute is converted to individual attributes.
- AFirst
- BSecond
- CThird
- DFourth
58Query Processing involves which of the following steps:
- AScanning query tokens
- BParsing to check query syntax
- CValidation check of all attribute and relation names
- DCreation of a query graph
- EDevise a Query execution strategy
59The database system must take special actions to ensure that transactions operate properly without interference from concurrently executing database statements. This property is referred to as _________.
- AAtomicity
- BDurability
- CIsolation
- DAll of the mentioned
60Which is a bottom-up approach to database design that decomposes unsatisfactory relations by breaking up their attributes into smaller relations?
- AFunctional dependency
- BDatabase modeling
- CNormalization
- DDecomposition
61Which of the following has “all-or-none” property in Transaction processing?
- AAtomicity
- BDurability
- CIsolation
- DAll of the mentioned
62Which one of the following is always a single-valued attribute?
- Aa person’s phone number
- Ba person’s address
- Ca person’s age
- Da person’s car
63__________ states that only valid data will be written to the database.
- AConsistency
- BAtomicity
- CDurability
- DIsolation
Information
- Description
- Quiz on SER 322 Midterm, created by Grant Jednesty on 13/09/2020.
- Author
- Grant Jednesty
- Language
- English
- Views
- 3
- History
- Created on 13 Sep 2020 · updated on 7 Oct 2020
- Rating
- No ratings yet Rate this quiz