Download dbms with answer

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft Access wikipedia , lookup

Concurrency control wikipedia , lookup

Oracle Database wikipedia , lookup

Ingres (database) wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Database wikipedia , lookup

Functional Database Model wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Relational algebra wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Clusterpoint wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Join (SQL) wikipedia , lookup

Database model wikipedia , lookup

Relational model wikipedia , lookup

Transcript
DBMS SET-1
1. Needing to using more complicated SQL in database applications is a(n) ________ of
normalization.
A.Advantage
B. Disadvantage
C. either an advantage or disadvantage
D.neither an advantage nor disadvantage
2. Eliminating modification anomalies is a(n) ________ of normalization.
A.Advantage
B. Disadvantage
C. either an advantage or disadvantage
D.neither an advantage nor disadvantage
3. Multivalued dependencies should ________ be eliminated.
B. Commonly
A.Always
C. Seldom
D.Never
4. When assessing the table structure of an acquired set of tables with data, accessing the validity
of possible referential integrity constraints on foreign keys is (part of) the:
A.first step.
B. second step.
C.third step.
D.fourth step.
5. Using the SQL GROUP BY phrase with a SELECT statement can help detect which of the
following problems?
A.The multivalue, multicolumn problem
B. The inconsistent values problem
C. The missing values problem
D.The general-purpose remarks column problem
6. When assessing the table structure of an acquired set of tables with data, determining foreign
keys is (part of) the:
A.first step.
B. second step.
C. third step.
D.fourth step.
7. Creating a read-only database is a task that is ________ assigned to beginning database
professionals.
A.always
B. commonly
C. seldom
D.never
8. Each answer below shows example data from a table. Which answer is an example of the
general-purpose remarks column problem?
A.Three columns have the values 534-2435, 534-7867, and 546-2356 in the same row.
Three rows have the values Brown Small Chair, Small Chair Brown, and Small Brown
B.
Chair in the same column.
C. Three rows have the values Brown, NULL, and Blue in the same column.
One row has the value "He is interested in a Silver Porsche from the years 1978-1988"
D.
in a column.
9. For a number of reasons, normalizations is not often an advantage for a(n) ________ database.
A.read-only
B. updateable
C. either a read-only or an updateable
D.None of the above is correct.
10. Most of the time, modification anomalies are serious enough that tables should be normalized
into:
A.1NF.
B. 2NF.
C. 3NF.
D.BCNF.
11. Each answer below shows example data from a table. Which answer is an example of the
missing values problem?
A.Three columns have the values 534-2435, 534-7867, and 546-2356 in the same row.
Three rows have the values Brown Small Chair, Small Chair Brown, and Small Brown
B.
Chair in the same column.
C.Three rows have the values Brown, NULL, and Blue in the same column.
One row has the value "He is interested in a Silver Porsche from the years 1978-1988" in a
D.
column.
12. When assessing the table structure of an acquired set of tables with data, determining
functional dependencies is (part of) the:
A.first step.
B. second step.
C. third step.
D.fourth step.
13. Each answer below shows example data from a table. Which answer is an example of the
multivalue, multicolumn problem?
A.Three columns have the values 534-2435, 534-7867, and 546-2356 in the same row.
Three rows have the values Brown Small Chair, Small Chair Brown, and Small Brown
B.
Chair in the same column.
C. Three rows have the values Brown, NULL, and Blue in the same column.
One row has the value "He is interested in a Silver Porsche from the years 1978-1988" in a
D.
column.
14. When assessing the table structure of an acquired set of tables with data, counting the number
of table rows is (part of) the:
A.first step.
B. second step.
C. third step.
D.fourth step.
15. If a table has been normalized so that all determinants are candidate keys, then that table is
in:
A.1NF.
B. 2NF.
C. 3NF.
D.BCNF.
16. Read-only databases are ________ updated.
A.always
C. seldom
B. commonly
D.never
17. Needing to assess the validity of assumed referential integrity constraints on foreign keys is
a(n) ________ of normalization.
A.advantage
B. disadvantage
C. either an advantage or disadvantage
D.neither an advantage nor disadvantage
18. When assessing the table structure of an acquired set of tables with data, determining primary
keys is (part of) the:
A.first step.
B. second step.
C. third step.
D.fourth step.
19. Normalization ________ data duplication.
A.eliminates
C. increases
B. reduces
D.maximizes
20. Each answer below shows example data from a table. Which answer is an example of the
inconsistent values problem?
A.Three columns have the values 534-2435, 534-7867, and 546-2356 in the same row.
Three rows have the values Brown Small Chair, Small Chair Brown, and Small
B.
Brown Chair in the same column.
C. Three rows have the values Brown, NULL, and Blue in the same column.
One row has the value "He is interested in a Silver Porsche from the years 1978-1988" in a
D.
column.
21. The DBMS acts as an interface between what two components of an enterprise-class
database system?
A.Database application and the database
B. Data and the database
C. The user and the database application
D.Database application and SQL
22. Which of the following products was an early implementation of the relational model
developed by E.F. Codd of IBM?
A.IDMS
B. DB2
C. dBase-II
D.R:base
23. The following are components of a database except ________ .
A.user data
B. metadata
C.reports
D.indexes
24. An application where only one user accesses the database at a given time is an example of
a(n) ________ .
A.single-user database application
B. multiuser database application
C. e-commerce database application
D.data mining database application
25. An on-line commercial site such as Amazon.com is an example of a(n) ________ .
A.single-user database application
B. multiuser database application
C.e-commerce database application
D.data mining database application
26. Which of the following products was the first to implement true relational algebra in a PC
DBMS?
A.IDMS
B. Oracle
C. dBase-II
D.R:base
27. SQL stands for ________ .
A.Structured Query Language
B. Sequential Query Language
C. Structured Question Language
D.Sequential Question Language
28. Because it contains a description of its own structure, a database is considered to be
________ .
A.described
B. metadata compatible
C.self-describing
D.an application program
29. The following are functions of a DBMS except ________ .
A.creating and processing forms
B. creating databases
C. processing data
D.administrating databases
30. Helping people keep track of things is the purpose of a(n) ________ .
B. table
A.database
C. instance
D.relationship
31. Which of the following products implemented the CODASYL DBTG model?
B. DB2
A.IDMS
C. dBase-II
D.R:base
An Enterprise Resource Planning application is an example of a(n) ________ .
32. A.single-user database application
B. multiuser database application
C. e-commerce database application
D.data mining database application
33. A DBMS that combines a DBMS and an application generator is ________ .
A.Microsoft's SQL Server
B. Microsoft's Access
C. IBM's DB2
D.Oracle Corporation's Oracle
34. You have run an SQL statement that asked the DBMS to display data in a table named
USER_TABLES. The results include columns of data labeled "TableName,"
"NumberOfColumns" and "PrimaryKey." You are looking at ________ .
A.user data.
B. metadata
C. A report
D.indexes
35. Which of the following is not considered to be a basic element of an enterprise-class database
system?
A.Users
B. Database applications
C. DBMS
D.COBOL programs
36. The DBMS that is most difficult to use is ________ .
A.Microsoft's SQL Server
B. Microsoft's Access
C. IBM's DB2
D.Oracle Corporation's Oracle
37. Every time attribute A appears, it is matched with the same value of attribute B, but not
the same value of attribute C. Therefore, it is true that:
A.A → B.
B. A → C.
C. A → (B,C).
D.(B,C) → A.
38. The different classes of relations created by the technique for preventing modification
anomalies are called:
A.normal forms.
B. referential integrity constraints.
C. functional dependencies.
D.None of the above is correct.
39. A relation is in this form if it is in BCNF and has no multivalued dependencies:
A.second normal form.
B. third normal form.
C. fourth normal form.
D.domain/key normal form.
40. Row is synonymous with the term:
A.record.
C. column.
B. relation.
D.field.
41. The primary key is selected from the:
A.composite keys.
B. determinants.
C. candidate keys.
D.foreign keys.
42. Which of the following is a group of one or more attributes that uniquely identifies a
row?
A.Key
C. Tuple
B. Determinant
D.Relation
43. When the values in one or more attributes being used as a foreign key must exist in
another set of one or more attributes in another table, we have created a(n):
A.transitive dependency.
B. insertion anomaly.
C. referential integrity constraint.
D.normal form.
44. A relation is considered a:
A.Column.
B. one-dimensional table.
C.two-dimensional table.
D.three-dimensional table.
45. In the relational model, relationships between relations or tables are created by using:
A.composite keys.
B. determinants.
C. candidate keys.
D.foreign keys.
46. A functional dependency is a relationship between or among:
A.tables.
C. relations.
B. rows.
D.attributes.
47. Table is synonymous with the term:
A.record.
C. column.
B. relation.
D.field.
48. For some relations, changing the data can have undesirable consequences called:
A.referential integrity constraints.
B. modification anomalies.
C. normal forms.
D.transitive dependencies.
49. A relation in this form is free of all modification anomalies.
A.First normal form
B. Second normal form
C. Third normal form
D.Domain/key normal form
50. If attributes A and B determine attribute C, then it is also true that:
A.A → C.
B. B → C.
C. (A,B) is a composite determinant.
D.C is a determinant.
Database ANSWER KEY
1.B
19.A
2.A
3.A
4.C
5.B
6.B
7.B
36.D
20.B
21.A
22.B
23.C
24. A
25. C
8.D
37.A
38.A
39.C
40.A
41.C
42.A
26.D
9.A
43.C
27.A
10.D
11.C
12.B
13.A
44.C
28.C
29.A
30.A
45.D
46.D
47.B
14.A
31.A
48.B
15.D
32.B
49.D
16.D
33.B
50.C
17.D
34.B
18.B
35.D
DBMS SET-2
1. A tuple is a(n):
A.column of a table.
B. two dimensional table.
C. row of a table.
D.key of a table.
2.If attribute A determines both attributes B and C, then it is also true that:
A.A → B.
B. B → A.
C. C → A.
D.(B,C) → A.
3.One solution to the multivalued dependency constraint problem is to:
A.split the relation into two relations, each with a single theme.
B. change the theme.
C. create a new theme.
D.add a composite key.
4.
Name
Annie
Bob
Callie
Derek
Which of these query will display the the table given above ?
a) Select employee from name
b) Select name
c) Select name from employee
d) Select employee
Answer:c
Explanation:The field to be displayed is included in select and the table is included in the from
clause.
5. Select ________ dept_name from instructor;
Here which of the following displays the unique values of the column ?
a) All
b) From
c) Distinct
d) Name
Answer:c
Explanation:Distinct keyword selects only the entries that are unique.
6. The ______ clause allows us to select only those rows in the result relation of the ____ clause
that satisfy a specified predicate.
a) Where, from
b) From, select
c) Select, from
d) From, where
Answer:a
Explanation:Where selects the rows on a particular condition.From gives the relation which
involves the operation.
7. Select ID, name, dept name, salary * 1.1 where instructor;
The query given below will not give an error. Which one of the following has to be replaced to
get the desired output?
a) Salary*1.1
b) ID
c) Where
d) Instructor
Answer:c
Explanation:Where selects the rows on a particular condition.From gives the relation which
involves the operation. Since Instructor is a relation it has to have from clause.
8. The ________ clause is used to list the attributes desired in the result of a query.
a) Where
b) Select
c) From
d) Distinct
Answer:b
9. Select name, course_id from instructor, teaches where instructor_ID= teaches_ID;
This Query can be replaced by which one of the following ?
a) Select name,course_id from teaches,instructor where instructor_id=course_id;
b) Select name, course_id from instructor natural join teaches;
c) Select name ,course_id from instructor;
d) Select course_id from instructor join teaches;
Answer:b
Explanation:Join clause joins two tables by matching the common column .
10. Select * from employee where salary>10000 and dept_id=101;
Which of the following fields are displayed as output?
a) Salary, dept_id
b) Employee
c) Salary
d) All the field of employee relation
Answer:d
Explanation:Here * is used to select all the fields of the relation .
11.
Employee_id Name Salary
1001
Annie 6000
1009
Ross 4500
1018
Zeith 7000
This is Employee table.
Select * from employee where employee_id>1009;
Which of the following employee_id will be displayed?
a) 1009, 1001, 1018
b) 1009, 1018
c) 1001
d) 1018
Answer:d
Explanation:Greater than symbol does not include the given value unlike >=.
12. Which of the following statements contains an error?
A) Select * from emp where empid = 10003;
B) Select empid from emp where empid = 10006;
C) Select empid from emp;
D) Select empid where empid = 1009 and lastname = ‘GELLER’;
Answer:d
Explanation:This query do not have from clause which specifies the relation from which the
values has to be selected .
13. Insert into employee _____ (1002,Joey,2000);
In the given query which of the keyword has to be inserted ?
a) Table
b) Values
c) Relation
d) Field
Answer:b
Explanation:Value keyword has to be used to insert the values into the table.
14)You want to retrieve all employees, whether or not they have matching departments in
the departments table. Which query would you use?
A) SELECT last_name, department_name
FROM employees e LEFT OUTER
JOIN departments d ON (e.department_id = d.department_id);
B) SELECT last_name, department_name
FROM employees e RIGHT OUTER
JOIN departments d ON (e.department_id = d.department_id);
C) SELECT last_name, department_name
FROM employees e FULL OUTER
JOIN departments d ON (e.department_id = d.department_id)
15)Which two statements about views are true?
A) A view can be created as read only.
B) A view cannot have an ORDER BY clause in the SELECT statement.
C) A view cannot be created with a GROUP BY clause in the SELECT statement.
D) A view must have aliases defined for the column names in the SELECT statement
16) Evaluate this SQL statement:
SELECT employee_id, e.department_id, department_name, salary FROM employees e,
departments d
WHERE e.department_id = d.department_id;
Which SQL statement is equivalent to the above SQL statement?
A) SELECT employee_id, department_id, department_name, salary
FROM employees
WHERE department_id IN (SELECT department_id
FROM departments);
B) SELECT employee_id, department_id, department_name, salary
FROM employees
NATURAL JOIN departments;
C) SELECT employee_id, d.department_id, department_name, salary
FROM employees e
JOIN departments d
ON e.department_id = d.department_id;
D) SELECT employee_id, department_id, department_name, salary
FROM employees
JOIN departments
USING (e.department_id, d.department_id);
17)In which case would you use a FULL OUTER JOIN?
A) Both tables have NULL values.
B) You want all unmatched data from one table.
C) You want all matched data from both tables.
D) You want all unmatched data from both tables.
E) One of the tables has more data than the other.
F) You want all matched and unmatched data from only one table.
18)Evaluate this SQL statement:
SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID,
d.DEPARTMENT_NAME
FROM EMP e, DEPARTMENT d WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID;
In the statement, which capabilities of a SELECT statement are performed?
A) Selection, projection, join
B) Difference, projection, join
C) Selection, intersection, join
D) Intersection, projection, join
E) Difference, projection, product
19) What is true about joining tables through an equijoin?
A) You can join a maximum of two tables through an equijoin.
B) You can join a maximum of two columns through an equijoin.
C) You specify an equijoin condition in the SELECT or FROM clauses of a SELECT statement.
D) You can join n tables (all having single column primary keys) in a SQL statement by
specifying a minimum of n-1 join conditions.
20) Which three are true regarding the use of outer joins?
A) You cannot use IN operator in a condition that involves an outerjoin.
B) You use (+) on both sides of the WHERE condition to perform an outerjoin.
C) You use (*) on both sides of the WHERE condition to perform an outerjoin.
D) You use an outerjoin to see only the rows that do not meet the join condition.
21) In which three cases would you use the USING clause?
A) You want to create a nonequijoin.
B) The tables to be joined have multiple NULL columns.
C) The tables to be joined have columns of the same name and different data types.
D) The tables to be joined have columns with the same name and compatible data types.
22) Examine the structure of the EMPLOYEES and DEPARTMENTS tables:
EMPLOYEES
EMPLOYEE_ID NUMBER
DEPARTMENT_ID NUMBER
MANAGER_ID NUMBER
LAST_NAME VARCHAR2(25)
DEPARTMENTS
DEPARTMENT_ID NUMBER
MANAGER_ID NUMBER
DEPARTMENT_NAME VARCHAR2(35)
LOCATION_ID NUMBER
You want to create a report displaying employee last names, department names, and locations.
Which query should you use to create an equi-join?
A) SELECT last_name, department_name, location_id FROM employees , departments ;
B) SELECT employees.last_name, departments.department_name, departments.location_id
FROM employees e, departments D WHERE e.department_id =d.department_id;
C) SELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D
WHERE manager_id =manager_id;
D) SELECT e.last_name, d.department_name, d.location_id FROM employees e,
departments D WHERE e.department_id =d.department_id;
23) In which two cases would you use an outer join?
A) The tables being joined have NOT NULL columns.
B) The tables being joined have only matched data.
C) The columns being joined have NULL values.
D) The tables being joined have only unmatched data.
24) A SELECT statement can be used to perform these three functions:
- Choose rows from a table.
- Choose columns from a table.
- Bring together data that is stored in different tables by creating a link between them.
Which set of keywords describes these capabilities?
A) difference, projection, join
B) selection, projection, join
C) selection, intersection, join
D) intersection, projection, join
E) difference, projection, product
25.What is the full form of SQL?
a. Structured Query Language
b. Structured Query List
c. Simple Query Language
d. None
26. Which is the subset of SQL commands used to manipulate Oracle Database structures,
including tables?
a. Data Definition Language(DDL)
b. Data Manipulation Language(DML)
c. Both of above
d. None
27. Which operator performs pattern matching?
a. BETWEEN operator
b. LIKE operator
c. EXISTS operator
d. None of these
28. What operator tests column for the absence of data?
a. EXISTS operator
b. NOT operator
c. IS NULL operator
d. None of these
29. In SQL, which command(s) is(are) used to change a table's storage characteristics?
a. ALTER TABLE
b. MODIFY TABLE
c. CHANGE TABLE
d. All of the above
30. In SQL, which of the following is not a data definition language commands?
a. RENAME
b. REVOKE
c. GRANT
d. UPDATE
31. In SQL, which command is used to SELECT only one copy of each set of duplicable
rows
a. SELECT DISTINCT
b. SELECT UNIQUE
c. SELECT DIFFERENT
d. All of the above
32. A command that lets you change one or more fields in a record is
a. Insert
b. Modify
c. Look-up
d. All of the above
33. Which of the SQL statements is correct?
a. SELECT Username AND Password FROM Users
b. SELECT Username, Password FROM Users
c. SELECT Username, Password WHERE Username = 'user1'
d. None of these
34. The FROM SQL clause is used to...
a. specify what table we are selecting or deleting data FROM
b. specify range for search condition
c. specify search condition
d. None of these
35. Which SQL keyword is used to retrieve only unique values?
a. DISTINCTIVE
b. UNIQUE
c. DISTINCT
d. DIFFERENT
36. Which SQL keyword is used to retrieve a maximum value?
a. TOP
b. MOST
c. UPPER
d. MAX
37. What is a view?
a. A view is a special stored procedure executed when certain event occurs.
b. A view is a virtual table which results of executing a pre-compiled query. A view is not
part of the physical database schema, while the regular tables are.
c. A view is a database diagram.
d. None of these
38. Which of the following SQL commands is used to retrieve data?
a. DELETE
b. INSERT
c. SELECT
d. JOIN
39. Which of the following is a SQL aggregate function?
a. LEFT
b. AVG
c. JOIN
d. LEN
40. Which SQL statement is used to update data in a database?
a. SAVE
b. UPDATE
c. SAVE AS
d. MODIFY
41. Which SQL statement is used to delete data FROM a database?
a. COLLAPSE
b. REMOVE
c. ALTER
d. DELETE
42. Which SQL keyword is used to sort the result-set?
a. SORT BY
b. ORDER
c. ORDER BY
d. SORT
43. The SQL statement SELECT SUBSTR('123456789', INSTR('abcabcabc', 'b'), 4)
FROM DUAL;
a. 6789
b. 2345
c. 1234
d. 456789
44. Which of the following group functions ignore NULL values?
a. MAX
b. COUNT
c. SUM
d. All of the above
45. Table Employee has 10 records. It has a non-NULL SALARY column which is also
UNIQUE. The SQL statement SELECT COUNT(*) FROM Employee WHERE SALARY
> ANY (SELECT SALARY FROM EMPLOYEE);
prints
a. 10
b. 9
c. 5
d. 0
46.The SQL statement SELECT SUBSTR('abcdefghij', INSTR('123321234', '2', 3, 2), 2)
FROM DUAL;prints
a. gh
b. 23
c. bc
d. ab
47. The SQL statement SELECT ROUND(45.926, -1) FROM DUAL;
a. is illegal
b. prints garbage
c. prints 045.926
d. prints 50
48. Which of the following must be enclosed in double quotes?
a. Dates
b. Column Alias
c. Strings
d. All of the Above
49. Which of the following command makes the updates performed by the transaction
permanent in the database?
a. ROLLBACK
b. COMMIT
c. TRUNCATE
d. DELETE
50. Which command undo all the updates performed by the SQL in the transaction?
a. ROLLBACK
b. COMMIT
c. TRUNCATE
d. DELETE
ANSWER KEY
51.C
75.A
99.B
52. A
76.A
100.A
53.A
77.B
54.C
78.C
55.C
79.A
56.A
80.D
57.C
81.A
58.B
82.B
59.B
83.B
60.D
84.A
61.D
85.C
62.D
86.D
63.B
87.B
64.A
88.C
65.A
89.B
66.C
90.B
67.D
91.D
68.A
92.C
69.D
93.C
70.D
94.D
71C.
95.B
72.D
96.A
73.C
97.D
74.B
98.B