CS304 Database Concepts

Download Report

Transcript CS304 Database Concepts

SE305
Database System Technology
23/10/2014
Quiz-2
1. If we just want to delete all tuples in a table,
which SQL query shall we choose?
a) delete * from t;
b) delete from t;
c) drop table t;
d) drop * table t;
2. Consider the query select sum (salary) from
instructor, which statement is NOT correct?
a) This query totals all salaries
b) Ignores null values amounts
c) Result is 0 if there is no non-null amount
d) The column name for the sum is sum(salary)
3.Which statement is NOT correct?
a) SQL allows duplicates in relations as well as
in
query results
b) The From clause corresponds to the
cartesian product operation
c) โ€˜Intro%โ€™ matches โ€˜Introductionโ€™
d) 5+null returns 5
4. Consider schema R(a,b,c), which query is correct?
a) SELECT a FROM R GROUP BY b,c
b) SELECT a,b FROM R GROUP BY c
c) SELECT avg(a),min(b) FROM R GROUP BY c
d) SELECT a,b FROM R GROUP BY b
5. What is the value of ๐‘‘๐‘œ๐‘š(๐‘ก โˆˆ ๐‘Ÿ โˆง ๐‘ก ๐‘Ž = 1)?
a) the set only contains 1
b) the set of all values appearing in r
c) the set contains all possible values of each
attribute in r.
d) the set containing 1 and all values
appearing in r.
6. Which type of relationship does the following ER
diagram express?
a) one-to-one
b) one-to-many
c) many-to-one
d) many-to-many
7. In ER diagram identifying relationship is depicted
by?
a) Triangle
b) Rectangle
c) Double diamond
d) Cycle
8. Which is the best schema for the following ER
diagram?
a) advisor=(s_id,i_id)
b) advisor=(s_name,i_id)
c) advisor=(s_id,i_name)
d) advisor=(s_name,i_name)
9. Which information is NOT useful in create a schema to
represent aggregation?
a) primary key of the aggregated relationship
b) the primary key of the associated entity set
c) any descriptive attributes
d) attributes of the aggregated relationship
10. Which design is better for a multivalued attribute M of
an entity E?
a) represent M in a single table
b) represent M with other attributes together
c) represent M with composite attributes
d) represent M in a relationship associated with E