dbms
dbms
DBMS
1. What is the full form of DBMS?(b)
a) Data of Binary Management System
b) Database Management System
c) Database Management Service
d) Data Backup Management System
2. What is a database?(c)
a) Organized collection of information that cannot be accessed, updated, and managed
b) Collection of data or information without organizing
c) Organized collection of data or information that can be accessed, updated, and managed
d) Organized collection of data that cannot be updated
3. What is DBMS?(d)
a) DBMS is a collection of queries
b) DBMS is a high-level language
c) DBMS is a programming language
d) DBMS stores, modifies and retrieves data
Explanation: Charles Bachman along with his team invented the first DBMS known as
Integrated Data Store (IDS).
d) Decentralized
14. Which of the following is known as a set of entities of the same type that share
same properties, or attributes?(c)
a) Relation set
b) Tuples
c) Entity set
d) Entity Relation model
17. The values appearing in given attributes of any tuple in the referencing relation
must likewise occur in specified attributes of at least one tuple in the referenced
relation, according to _____________________ integrity constraint.(a)
a) Referential
b) Primary
c) Referencing
d) Specific
18. _____________ is a hardware component that is most important for the operation
of a database management system.(b)
a) Microphone
b) High speed, large capacity disk to store data
c) High-resolution video display
d) Printer
20. The ability to query data, as well as insert, delete, and alter tuples, is offered by
____________(d)
a) TCL (Transaction Control Language)
b) DCL (Data Control Language)
c) DDL (Data Definition Langauge)
d) DML (Data Manipulation Langauge)
4
23. Which of the following set should be associated with weak entity set for weak
entity to be meaningful?(d)
a) Neighbour set
b) Strong entity set
c) Owner set
d) Identifying set
24. Which of the following command is correct to delete the values in the relation
teaches?(a)
a) Delete from teaches;
b) Delete from teaches where Id =’Null’;
c) Remove table teaches;
d) Drop table teaches;
27. Which forms have a relation that contains information about a single entity?(a)
a) 4NF
b) 2NF
c) 5NF
d) 3NF
28. The top level of the hierarchy consists of ______ each of which can contain
_____.(d)
a) Schemas, Catalogs
5
b) Schemas, Environment
c) Environment, Schemas
d) Catalogs, Schemas
29. _______ indicates the maximum number of entities that can be involved in a
relationship.(c)
a) Greater Entity Count
b) Minimum cardinality
c) Maximum cardinality
d) ERD
30. The user IDs can be added or removed using which of the following fixed roles?
(b)
a) db_sysadmin
b) db_accessadmin
c) db_securityadmin
d) db_setupadmin
32. The traditional storage of data organized by the customer, stored in separate
folders in filing cabinets is an example of ______________ type of ‘database’
management system.(d)
a) Object-oriented database management system
b) Relational database management system
c) Network database management system
d) Hierarchical database management system
.
33. After groups have been established, SQL applies predicates in the ___________
clause, allowing aggregate functions to be used.(b)
a) Where
b) Having
c) Group by
d) With
\35. What does a foreign key combined with a primary key create?(a)
a) Network model between the tables that connect them
b) Parent-Child relationship between the tables that connects them
c) One to many relationship between the tables that connects them
d) All of the mentioned
37. Which of the following is correct regarding the file produced by a spreadsheet?(a)
a) can be used as it is by the DBMS
b) stored on disk in an ASCII text format
c) all of the mentioned
d) none of the mentioned
40. The query specifying the SQL view is said to be updatable if it meets which of the
following conditions?(d)
a) select clause contains relation attribute names but not have expressions, aggregates, or
distinct specification
b) from clause has 1 relation
c) query does not have group by or having clause
d) All of the mentioned
41. When the “ROLLUP” operator for expression or columns within a “GROUP BY”
clause is used?(c)
a) Find the groups that make up the subtotal in a row
7
b) Create group-wise grand totals for the groups indicated in a GROUP BY clause
c) Group expressions or columns specified in a GROUP BY clause in one direction, from
right to left, for computing the subtotals
d) To produce a cross-tabular report for computing subtotals by grouping phrases or
columns given within a GROUP BY clause in all available directions
42. Which of the following is the best way to represent the attributes in a large db?
a) Dot representation(b)
b) Concatenation
c) Relational-and
d) All of the mentioned
43. Which of the following is the subset of SQL commands used to manipulate Oracle
Structures, including tables?(d)
a) Data Described Language
b) Data Retrieval Language
c) Data Manipulation Language
d) Data Definition Language
44. Which of the following functions construct histograms and use buckets for
ranking?(a)
a) Ntil()
b) Newtil()
c) Rank()
d) All of the mentioned
Explanation: ntile(n) returns the number of the bucket in which each tuple is stored, with
bucket numbers beginning with 1.
45. __________ command is used in SQL to issue multiple CREATE TABLE, CREATE
VIEW and GRANT statements in a single transaction.(c)
a) CREATE CLUSTER
b) CREATE PACKAGE
c) CREATE SCHEMA
d) All of the mentioned
46. Which of the following key is required in to handle the data when the encryption
is applied to the data so that the unauthorised user cannot access the data?(c)
a) Primary key
b) Authorised key
c) Encryption key
d) Decryption key
47. Which of the following is known as the process of viewing cross-tab with a fixed
value of one attribute?(c)
a) Dicing
b) Pivoting
c) Slicing
8
48. For designing a normal RDBMS which of the following normal form is considered
adequate?(b)
a) 4NF
b) 3NF
c) 2NF
d) 5NF
49. Which of the following is popular for applications such as storage of log files in a
database management system since it offers the best write performance?(b)
a) RAID level 0
b) RAID level 1
c) RAID level 2
d) RAID level 3
Explanation: RAID level 0 refers to data stripping. RAID level 1 refers to disk mirroring with
block striping. RAID level 2 refers to bit-level stripping and RAID level 3 refers to byte-level
striping with dedicated parity.
50. Which of the following represents a query in the tuple relational calculus?(b)
a) { }{P(t) | t }
b) {t | P(t)}
c) t | P() | t
d) All of the mentioned
52. Evaluate the statements issued by the DBA in the given sequence if OE and
SCOTT are the users and the ORDERS table is owned by OE.(c)
53. Which of the following establishes a top-to-bottom relationship among the items?
(c)
a) Relational schema
b) Network schema
c) Hierarchical schema
d) All of the mentioned
54. A major goal of the db system is to minimize the number of block transfers
between the disk and memory. Which of the following helps in achieving this goal?
(d)
a) Secondary storage
b) Storage
c) Catalog
d) Buffer
55. What happens if a piece of data is stored in two places in the db?(a)
a) Storage space is wasted & Changing the data in one spot will cause data inconsistency
b) In can be more easily accessed
c) Changing the data in one spot will cause data inconsistency
d) Storage space is wasted
56. The logical design, and the snapshot of the data at a given instant in time is
known as?(d)
a) Instance & Relation
b) Relation & Schema
c) Domain & Schema
d) Schema & Instance
d) Instance
5. For each attribute of a relation, there is a set of permitted values, called the
________ of that attribute.(a)
a) Domain
b) Relation
c) Set
d) Schema
6. Database __________ which is the logical design of the database, and the database
_______ which is a snapshot of the data in the database at a given instant in time.(d)
a) Instance, Schema
b) Relation, Schema
c) Relation, Domain
d) Schema, Instance
7. Course(course_id,sec_id,semester)
Here the course_id,sec_id and semester are __________ and course is a
_________(b)
a) Relations, Attribute
b) Attributes, Relation
c) Tuple, Relation
d) Tuple, Attributes
8. Department (dept name, building, budget) and Employee (employee_id, name, dept
name, salary)
Here the dept_name attribute appears in both the relations. Here using common
attributes in relation schema is one way of relating ___________ relations.(c)
a) Attributes of common
b) Tuple of common
c) Tuple of distinct
d) Attributes of distinct
b) Same
c) Sorted
d) Constant
5. The result which operation contains all pairs of tuples from the two relations,
regardless of whether their attribute values match.(b)
a) Join
b) Cartesian product
c) Intersection
d) Set difference
7. The most commonly used operation in relational algebra for projecting a set of
tuple from a relation is(c)
a) Join
b) Projection
12
c) Select
d) Union
8. The _______ operator takes the results of two queries and returns only rows that
appear in both result sets.(b)
a) Union
b) Intersect
c) Difference
d) Projection
10. The _________ provides a set of operations that take one or more relations as
input and return a relation as an output.(b)
a) Schematic representation
b) Relational algebra
c) Scheme diagram
d) Relation flow
1. Which one of the following is used to define the structure of the relation, deleting
relations and relating schemas?(b)
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
2. Which one of the following provides the ability to query information from the
database and to insert tuples into, delete tuples from, and modify tuples in the
database?(a)
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
.
3.
d) Integrity constraint
4.
5. The basic data type char(n) is a _____ length character string and varchar(n) is
_____ length character.(c)
a) Fixed, equal
b) Equal, variable
c) Fixed, variable
d) Variable, equal
8.
9.
b) DML
c) Relational
d) DDL
1.
Name
Annie
Bob
Callie
Derek
Which of these query will display the the table given above ?(c)
a) Select employee from name
b) Select name
c) Select name from employee
d) Select employee
2. Here which of the following displays the unique values of the column?(c)
3. The ______ clause allows us to select only those rows in the result relation of the
____ clause that satisfy a specified predicate.(a)
a) Where, from
b) From, select
15
c) Select, from
d) From, where
4. The query given below will not give an error. Which one of the following has to be
replaced to get the desired output?(c)
5. The ________ clause is used to list the attributes desired in the result of a query.(b)
a) Where
b) Select
c) From
d) Distinct
7.
8.
1.
2.
d) From
3.
SELECT emp_name
FROM department
WHERE dept_name LIKE ’ _____ Computer Science’;
Which one of the following has to be added into the blank to select the dept_name
which has Computer Science as its ending string?(a)
a) %
b) _
c) ||
d) $
5.
SELECT name
FROM instructor
WHERE dept name = ’Physics’
ORDER BY name;
By default, the order by clause lists items in ______ order.(d)
a) Descending
b) Any
c) Same
d) Ascending
6.
SELECT *
FROM instructor
ORDER BY salary ____, name ___;
To display the salary from greater to smaller and name in ascending order which of
the following options should be used?(c)
a) Ascending, Descending
b) Asc, Desc
c) Desc, Asc
d) Descending, Ascending
7.
SELECT name
FROM instructor
18
SELECT name
FROM instructor
WHERE salary BETWEEN 90000 AND 100000;
b)
SELECT name
FROM employee
WHERE salary <= 90000 AND salary>=100000;
c)
SELECT name
FROM employee
WHERE salary BETWEEN 90000 AND 100000;
d)
SELECT name
FROM instructor
WHERE salary BETWEEN 100000 AND 90000;
Answer: a
8.
SELECT instructor.*
FROM instructor, teaches
WHERE instructor.ID= teaches.ID;
This query does which of the following operation?(b)
a) All attributes of instructor and teaches are selected
b) All attributes of instructor are selected on the given condition
c) All attributes of teaches are selected on given condition
d) Only the some attributes from instructed and teaches are selected
9. In SQL the spaces at the end of the string are removed by _______ function.(c)
a) Upper
b) String
c) Trim
d) Lower
b) %
c) ||
d) _
1. The union operation is represented by(b)
a) ∩
b) U
c) –
d) *
(SELECT course id
FROM SECTION
WHERE semester = ’Fall’ AND YEAR= 2009)
EXCEPT
(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010);
This query displays (d)
a) Only tuples from second part
b) Only tuples from the first part which has the tuples from second part
c) Tuples from both the parts
d) Tuples from first part which do not have second part
10. The _____________ is essentially used to search for patterns in target string.(a)
a) Like Predicate
b) Null Predicate
c) In Predicate
d) Out Predicate
1. A _____ indicates an absent value that may exist but be unknown or that may not
exist at all.(c)
a) Empty tuple
b) New value
c) Null value
d) Old value
2. If the attribute phone number is included in the relation all the values need not be
entered into the phone number column. This type of entry is given as(c)
a) 0
b) –
c) Null
d) Empty space
3. The predicate in a where clause can involve Boolean operations such as and. The
result of true and unknown is_______ false and unknown is _____ while unknown
and unknown is _____(d)
a) Unknown, unknown, false
b) True, false, unknown
c) True, unknown, unknown
d) Unknown, false, unknown
4.
21
SELECT name
FROM instructor
WHERE salary IS NOT NULL;
Selects
a) Tuples with null value
b) Tuples with no null values
c) Tuples with any salary
d) All of the mentioned
Answer: b
5. In an employee table to include the attributes whose value always have some value
which of the following constraint must be used?(b)
a) Null
b) Not null
c) Unique
d) Distinct
6. Using the ______ clause retains only one copy of such identical tuples.(d)
a) Null
b) Unique
c) Not null
d) Distinct
7.
1. Aggregate functions are functions that take a ___________ as input and return a
single value.(a)
a) Collection of values
b) Single value
c) Aggregate value
d) Both Collection of values & Single value
2.
SELECT __________
FROM instructor
WHERE dept name= ’Comp. Sci.’;
Which of the following should be used to find the mean of the salary ?(b)
a) Mean(salary)
b) Avg(salary)
c) Sum(salary)
d) Count(salary)
Answer: a
4. All aggregate functions except _____ ignore null values in their input collection.(b)
a) Count(attribute)
b) Count(*)
c) Avg
d) Sum
5. A Boolean data type that can take values true, false, and________(d)
a) 1
23
b) 0
c) Null
d) Unknown
6. The ____ connective tests for set membership, where the set is a collection of
values produced by a select clause. The ____ connective tests for the absence of set
membership.(c)
a) Or, in
b) Not in, in
c) In, not in
d) In, or
7. Which of the following should be used to find all the courses taught in the Fall 2009
semester but not in the Spring 2010 semester .
a)
(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010)
d)
Answer: a
c) > all
d) > some
9. Which of the following is used to find all courses taught in both the Fall 2009 semester
and in the Spring 2010 semester .
a)
SELECT course id
FROM SECTION AS S
WHERE semester = ’Fall’ AND YEAR= 2009 AND
EXISTS (SELECT *
FROM SECTION AS T
WHERE semester = ’Spring’ AND YEAR= 2010 AND
S.course id= T.course id);
b)
SELECT name
FROM instructor
WHERE salary > SOME (SELECT salary
FROM instructor
WHERE dept name = ’Biology’);
c)
(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010)
View Answer
Answer: a
10. We can test for the nonexistence of tuples in a subquery by using the _____
construct.(b)
a) Not exist
b) Not exists
c) Exists
d) Exist
25
1.
Answer: b
2. SQL applies predicates in the _______ clause after groups have been formed, so
aggregate functions may be used.(d)
a) Group by
b) With
c) Where
d) Having
5. Which of the following creates a temporary relation for the query on which it is
defined?(a)
a) With
b) From
c) Where
d) Select
26
6.
7. Subqueries cannot(c)
a) Use group by or group functions
b) Retrieve data from a table different from the one in the outer query
c) Join tables
d) Appear in select, update, delete, insert statements.
10. How can you find rows that do not match some specified condition?(b)
a) EXISTS
b) Double use of NOT EXISTS
c) NOT EXISTS
d) None of the mentioned
3. Which one of the following deletes all the entries but keeps the structure of the
relation.(d)
a) Delete from r where P;
b) Delete from instructor where dept name= ’Finance’;
c) Delete from instructor where salary between 13000 and 15000;
d) Delete from instructor;
INSERT INTO course VALUES (’CS-437’, ’DATABASE Systems’, ’Comp. Sci.’, 4);
d) Not possible
Answer: b
5. Which of the following deletes all tuples in the instructor relation for those instructors
associated with a department located in the Watson building which is in department relation.
a)
Answer: c
6.
UPDATE instructor
_____ salary= salary * 1.05;
Fill in with correct keyword to update the instructor relation.(b)
a) Where
b) Set
c) In
d) Select
7. _________ are useful in SQL update statements, where they can be used in the set
clause.(d)
a) Multiple queries
b) Sub queries
c) Update
d) Scalar subqueries
CASE
WHEN pred1 ... result1
WHEN pred2 ... result2
. . .
WHEN predn ... resultn
ELSE result0
END
b)
CASE
WHEN pred1 THEN result1
WHEN pred2 THEN result2
. . .
WHEN predn THEN resultn
ELSE result0
END
c)
29
CASE
WHEN pred1 THEN result1
WHEN pred2 THEN result2
. . .
WHEN predn THEN resultn
ELSE result0
d) All of the mentioned
Answer: b
10. Which of the following relation updates all instructors with salary over $100,000
receive a 3 percent raise, whereas all others receive a 5 percent raise.(a)
a)
UPDATE instructor
SET salary = salary * 1.03
WHERE salary > 100000;
UPDATE instructor
SET salary = salary * 1.05
WHERE salary <= 100000;
b)
UPDATE instructor
SET salary = salary * 1.05
WHERE salary < (SELECT avg (salary)
FROM instructor);
c)
UPDATE instructor
SET salary = CASE
WHEN salary <= 100000 THEN salary * 1.03
ELSE salary * 1.05
END
d) None of the mentioned
3.
30
SELECT *
FROM student JOIN takes USING (ID);
The above query is equivalent to
a)
SELECT *
FROM student INNER JOIN takes USING (ID);
b)
SELECT *
FROM student OUTER JOIN takes USING (ID);
c)
SELECT *
FROM student LEFT OUTER JOIN takes USING (ID);
d) None of the mentioned
Answer: a
4. What type of join is needed when you wish to include rows that do not have
matching values?(c)
a) Equi-join
b) Natural join
c) Outer join
d) All of the mentioned
Explanation: Types are inner join, left outer join, right outer join, full join, cross join.
31
8. Which join refers to join records from the right table that have no matching key in
the left table are include in the result set(b)
a) Left outer join
b) Right outer join
c) Full outer join
d) Half outer join
9. The operation which is not considered a basic operation of relational algebra is(a)
a) Join
b) Selection
c) Union
d) Cross product
1. Which of the following creates a virtual relation for storing the query?(b)
a) Function
b) View
c) Procedure
d) None of the mentioned
2. Which of the following is the syntax for views where v is view name?(c)
a) Create view v as “query name”;
b) Create “query expression” as view;
c) Create view v as “query expression”;
d) Create view “query expression”;
3.
SELECT course_id
FROM physics_fall_2009
WHERE building= ’Watson’;
Here the tuples are selected from the view.Which one denotes the view.(c)
a) Course_id
b) Watson
c) Building
d) physics_fall_2009
6. SQL view is said to be updatable (that is, inserts, updates or deletes can be applied
on the view) if which of the following conditions are satisfied by the query defining
the view?(d)
a) The from clause has only one database relation
b) The query does not have a group by or having clause
c) The select clause contains only attribute names of the relation and does not have any
expressions, aggregates, or distinct specification
d) All of the mentioned
7. Which of the following is used at the end of the view to reject the tuples which do
not satisfy the condition in where clause?(c)
a) With
b) Check
c) With check
d) All of the mentioned