Thẻ ghi nhớ: DBI202 FE | Quizlet

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/265

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:25 PM on 7/10/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

266 Terms

1
New cards

What data structure will be represented for the hierarchical data model?A. Array structure

B. Table structure

C. Tree structure

D. Pointers structure

C

2
New cards

What data structure will be represented for the hierarchical data model?

A. Array structure

B. Table structure

C. Tree structure

D. Pointers structure

C

3
New cards

The ACID Properties of transactions refer to

A. Atomicity, consistency, isolation, database

B. Atomicity, consistency, isolation, durability

C. Atomicity, consistency, inconsistent, durability

D. Atomicity, concurrency, isolation, durability

B

4
New cards

In SQL, what is a view?

A. A virtual table based on the result of a SELECT query

B. A physical table containing aggregated data

C. A temporary table used for transactions

D. A stored procedure with read-only access

A

5
New cards

In SQL, after grouping data using the GROUP BY clause, the __________ clause is used to filter the groups based on specific conditions. It allows the use of aggregate functions and selects only the groups that satisfy the given criteria.

A. Where

B. Having

C. Group by

D. With

B

6
New cards

How are many-to-many relationships typically represented in the relational model?

A. By adding attributes to one of the related tables

B. By creating a new table with foreign keys from both related tables

C. By denormalizing the database

D. By creating a new table for each related entity

B

7
New cards

QN=2 (6808) What is a database?

a. A database is a collection of information that is organized so that it can easily be accessed, managed, and updated

b. A database is a collection of data files

c. A database is a collection of records

d. A database is a collection of tuples

A

8
New cards

What is a database?

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

C

9
New cards

Which of the following describes an SQL cursor?

A. It allows you to traverse the result set of a query and process each row individually

B. is a precompiled collection of one or more SQL statements that can be executed as a single unit

C. A field within a database

D. Cursors are not related to SQL

A

10
New cards

Problems such as redundancy that occur when we try to cram too much into a single relation are called _____________

A. Normal Form

B. Anomalies

C. Decomposing Relations

D. None of the others

B

11
New cards

What is an index?

A. An index is a database table attribute, which speeds-up data search within a table.

B. An index is the same as alias.

C. An index is a special way to join 2 or more tables.

D. An index is a database row attribute, which speeds-up data search within a table.

A

12
New cards

________ returns a relation instance containing all tuples that occur in both R and S.

A. Intersection

B. Set-difference

C. Union

D. Cross-product

A

13
New cards

Which of the following statements is correct when converting from the ERD model to the relational model?

A. The order of the columns is not important

B. The order of both rows and columns is important

C. The order of the rows is important

D. The order of the columns is important

A

14
New cards

What does an RDBMS consist of?

A. Collection of Tables

B. Collection of Records

C. Collection of Keys

D. Collection of Fields

A

15
New cards

Select the most correct answer.

A. An index is not a data structure used to speed access to tuples of a relation, given values of one or more attributes.

B. The key to index cannot be any attribute or set of attributes, and need not be the key to the relation.

C. We can think of the index as a binary search tree of (key, locations) pairs in which a key a is not associated with a set of locations of the tulips.

D. An index is a data structure used to speed access to tuples of a relation, given values of one or more attributes.

D

16
New cards

In an ERD, what role does a primary key play?

A. It uniquely identifies each record in a table

B. It establishes relationships between tables

C. It determines the data type of attributes

D. It defines the cardinality of relationships

A

17
New cards

We can use these ______ in SQL queries and other statements to perform computations that cannot be done with SQL alone.

A. Trigger

B. View

C. Index

D. Stored-procedure

D

18
New cards

The ability to query data, as well as insert, delete, and alter tuples, is offered by___________

A. TCL (Transaction Control Language)

B. DCL (Data Control Language)

C. DDL (Data Definition Language)

D. DML (Data Manipulation Language)

D

19
New cards

What is the difference between a view and a table in SQL?

A. Tables can be updated, while the view is displaying data from the query

B. Views can store data permanently, while tables are temporary

C. Tables are created with the CREATE TABLE statement, while views use CREATE VIEW

D. Views and tables are functionally equivalent in SQL

C

20
New cards

When no specific join type between multiple tables in a query's FROM clause is specified, what type of JOIN is assumed?

A. INNER

B. RIGHT

C. LEFT

D. FULL

a

21
New cards

Which of the following is used to define code that is fired when certain actions or events occur?

A. You use an application Trigger to fire when certain actions or events occur.

B. You use an application Cursor to fire when certain actions or events occur.

C. You use an application Replace to fire when certain actions or events occur.

D. You use an application Keyword to fire when certain actions or events occur.

A

22
New cards

1. How can you delete a user-defined function in SQL?

A. DELETE FUNCTION function_name

B. REMOVE FUNCTION function_name

C. DROP FUNCTION function_name

D. ERASE FUNCTION function_name

C

23
New cards

2. What happens if an error occurs during a transaction and it is not explicitly handled or rolled back?

A. The transaction is automatically committed

B. The transaction is automatically rolled back

C. The database becomes read-only

D. The transaction remains in a pending state

B

24
New cards

3. What is the main disadvantage of having too many indexes on a table?

A. Improved query performance

B. Increased storage space

C. Enhanced data integrity

D. Fast data modification operations

B

25
New cards

4. What is NOT true about the cursor in SQL?

A. It is considered the best practice to use when we want to insert, update, or delete data in a table of SQL Server.

B. The cursor allows users to process data from a result set, one row at a time.

C. Cursors are an alternative to commands, which operate on all rows in a result set at the same time.

D. Unlike commands, cursors can be used to update data on a row-by-row basis.

A

26
New cards

5. Suppose that we have a relation: R(A,B,C,D) and FD : D->BC

Which of the following is equivalent to the given dependency function?

A. D->B and D->C

B. C->B and C->B

C. D->B and B->C

D. C->D and C->B

A

27
New cards

6. According to the technology deployed by the database management system, which of the following is correct?

A. Locks are used to maintain transactional integrity and consistency.

B. Cursors are used to maintain transactional integrity and consistency.

C. Procedures are used to maintain transactional integrity and consistency.

D. Functions are used to maintain transactional integrity and consistency.

A

28
New cards

7. The SQL keyword BETWEEN is used:

A. None of the above is correct.

B. As a wildcard.

C. To limit the columns displayed.

D. For ranges.

D

29
New cards

8. In which of the following is a single-entity instance of one type related to many entity instances of another type?

A. One-to-One Relationship

B. One-to-Many Relationship

C. Many-to-Many Relationship

D. Composite Relationship

B

30
New cards

9. Consider the relation:

OrderDetail(orderNumber, productCode, productName, quantity, dateOrdered, salesDiscount)

And FDs:

orderNumber, productCode -> quantity

orderNumber -> dateOrdered

productCode -> productName, salesDiscount

And the key of OrderDetail is {orderNumber, productCode}.

Which of the following is a full dependency on the key?

A. orderNumber, productCode -> quantity

B. orderNumber -> dateOrdered

C. productCode -> productName

D. productCode -> productName, salesDiscount

A

31
New cards

10. What are some benefits of normalization when converting an ERD to a relational model?

A. Increased storage space efficiency

B. Reduced update anomalies

C. Simplified database queries

D. Enhanced data security

B

32
New cards

11. A DELETE command operates on ______ relation.

A. One

B. Two

C. Several

D. Null

A

33
New cards

12. In SQL, ERD use three types of principle elements to form relationships:

A. Entity sets, Constraints and Relationships

B. Attributes, Constraints, and Relationships

C. Entity sets, Attributes, and Relationships

D. Entity sets, Attributes and Constraints

C

34
New cards

13. Which of the following represents Armstrong's Axiom of Transitivity?

A. If A → B, then AC → BC

B. If A → B and B → C, then A → C

C. If A → B, then B → A

D. If A → B, then A → BC

B

35
New cards

14. The DROP TABLE statement:

A. Deletes the table structure only.

B. Deletes the table structure along with the table data.

C. Works whether or not referential integrity constraints would be violated.

D. Is not an SQL statement.

B

36
New cards

15. In a functional dependency A —> B, what can be said about B?

A. B is also a superkey

B. B is a determinant

C. B is functionally dependent on A

D. B is a foreign key

C

37
New cards

16. Which of the following is expressed by an E-R diagram?

A. Relation between process and relationship

B. Relation between entity and process

C. Relation between processes

D. Relation between entities

D

38
New cards

17. What is the result of the below query: SELECT SUBSTRING('FPTUDN', 1, 3) AS 'Substring'

A. FPT

B. UDN

C. T

D. TUN

A

39
New cards

18. Consider a relation with schema R(A, B, C, D) and FD's (A-> B, B-> C, B -> D, D->A). Which of the following is the {A}+ ?

A. {A}

B. {A B C D}

C. {A B C}

D. {A B}

B

40
New cards

19. In SQL, Which of the following statements is correct?

A. All relations in 2NF are also in BCNF

B. All relations in 1NF are also in BCNF

C. All relations in 3NF are also in BCNF

D. For any relation schema, there is a dependency-preserving decomposition into 3NF

D

41
New cards

20. What data types can a user-defined function return?

A. Number type, string type, date and time type, table type

B. Number type, string type, date type, time type

C. Number type, string type, binary file type (binary), table type

A

42
New cards

21. If there is more than one key for a relation schema in DBMS, then each key relation schema is classified as?

A. Prime key

B. Super key

C. Candidate key

D. Primary key

C

43
New cards

22. Which of the following is NOT a binary operation in relational algebra?

A. Project

B. Cartesian product

C. Union

D. Set difference

A

44
New cards

23. In an employee table, to include the attributes whose value always has some value, which of the following constraints must be used?

A. Null

B. Not null

C. Unique

D. Distinct

B

45
New cards

24. In SQL query, choose the correct statement about the order of execution.

A. SELECT - FROM - WHERE - GROUP BY - HAVING - ORDER BY

B. SELECT - FROM - GROUP BY - WHERE - HAVING - ORDER BY

C. SELECT - FROM - HAVING - GROUP BY - WHERE - ORDER BY

D. SELECT - FROM - ORDER BY - WHERE - HAVING - GROUP BY

A

46
New cards

25. What is the full form of DBMS?

A. Data of Binary Management System

B. Database Management System

C. Database Management Service

D. Data Backup Management System

B

47
New cards

26. Which of the following belongs to DDL (data definition language)?

A. Create, alter, drop

B. Insert, update, delete, select

C. Truncate, select, invoke

D. Deny, create, drop

A

48
New cards

27. Which of the following is the appropriate characteristic of a database?

A. Because a database is created to suit the format of the data, it cannot respond flexibly to data format changes.

B. The procedure for making backups is complicated.

C. It is difficult to share data between operations due to an exclusive control function.

D. It can be accessed by multiple users at the same time due to an exclusive control function.

D

49
New cards

28. In MS-SQL Server, which of the following is true about join operator?

SELECT * FROM tblCUSTOMER, tblORDER

A. Cartesian join

B. Equi-join

C. Natural join

D. Outer join

A

50
New cards

29. Given R as a relation, which of the following statements is correct about normalizing data in 3NF form:

A. If R: Has a primary key, no repeating groups, no multivalued attributes/composite attributes

B. If R: Has a primary key, no repeating groups, no multivalued attributes/composite attributes, no partial functional dependencies.

C. If R: Has a primary key, no repeating groups, no multivalued/composite attributes, no transitive dependencies.

D. If R: Has a primary key, no repeating groups, no multivalued attributes/composite attributes, no transitive functional dependencies, no partial functional dependencies.

E. If R: has complete functional dependency.

D

51
New cards

30. An E/R diagram is a graphical representation of sets, ___________?

A. Entity

B. Attributes

C. Relationships

D. All of the others

D

52
New cards

31. Which is the SQL statement that creates an updatable view? In this question, all the tables in the SQL statements are updatable.

A. CREATE VIEW Ordered_Product(Product_No) AS SELECT DISTINCT Product_No FROM Order

B. CREATE VIEW Order_List(Order_No, Product_Name, Order_Quantity) AS SELECT Order_No, Product_Name, Order_Quantity FROM Order, Product WHERE Order.Product_No = Product.Product_No

C. CREATE VIEW Product_Order(Product_No, Order_Quantity) AS SELECT Product_No, SUM(Order_Quantity) FROM Order GROUP BY Product_No

D. CREATE VIEW Expensive_Product(Product_No, Product_Name) AS SELECT Product_No, Product_Name FROM Product WHERE Product_Unit_Price > 1000

D

53
New cards

32. To convert from ER Diagram to Relational Model, 1-M relationship:

A. Put key attribute of one-side to M-side

B. Put key attribute of M-side to one-side

C. Generate 1 relation, Primary key of this relation combined from two relations

D. Build a table with two columns, one column for each participating entity set's primary key

A

54
New cards

33. Which SQL statement selects all rows from table called Contest, with column ContestDate having values greater or equal to May 25, 2006?

A. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'

B. SELECT * FROM Contest GROUP BY ContestDate >= '05/25/2006'

C. SELECT * FROM Contest WHERE ContestDate < '05/25/2006'

D. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'

A

55
New cards

34. What are the disadvantages of the network data model?

A. Not support the high-level query language

B. Not support the relationships between nodes

C. Not support the database management system

D. Not support the storage method of very large amounts of data

A

56
New cards

35. How is User-defined function different from Store Procedure?

A. User-defined functions do not have input parameters, Store Procedures do

B. User-defined functions cannot contain transactions, Store Procedures can

C. Store Procedure does not have return results, User-defined function does

D. All of the mentioned answers are incorrect

B

57
New cards

36. Which of the following statements is true regarding Third Normal Form (3NF)?

A. It eliminates transitive dependencies

B. It allows for redundant data

C. It only considers partial dependencies

D. It doesn't address any anomalies in a database

A

58
New cards

37. In query compiler, which unit transforms the initial query plan into the best available sequence of operations on the actual data?

A. A query parser

B. A query preprocessor

C. A query optimizer

D. A query processor

C

59
New cards

38. In SQL, when does a BEFORE INSERT trigger fire?

A. Before the execution of a SELECT statement

B. Before a new record is inserted into a table

C. Before a transaction is committed

D. Before a table is dropped

B

60
New cards

39. 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. Referential

B. Primary

C. Referencing

D. Specific

A

61
New cards

40. A stored procedure in SQL is a __________

A. Block of functions

B. Group of Transact-SQL statements compiled into a single execution plan

C. Group of distinct SQL statements

D. None of the mentioned

B

62
New cards

41. How can you invoke a user-defined function in a SQL query?

A. Using the EXECUTE statement

B. Using the CALL statement

C. Using the SELECT statement

D. Using the RUN statement

C

63
New cards

42. What is a Relational Database?

A. A collection of two or more tables

B. A database that is able to process queries, forms, reports and macro

C. The same as an Excel file database

D. A collection of two or more tables that are joined using relationships

43. Which statement is used to disable a foreign key constraint named fk_name during INSERT and UPDATE transactions in table B?

A. ALTER TABLE B DROP CONSTRAINT fk_name

B. ALTER TABLE B DISABLE CONSTRAINT fk_name

C. ALTER TABLE B DISABLE fk_name

D. ALTER TABLE B NOCHECK CONSTRAINT fk_name

42-D

43-D

64
New cards

44. What is information?

A. A collection of unprocessed data

B. A collection of processed data

C. A collection of processed information

D. A collection of unprocessed information

B

65
New cards

45. Which key does not accept the null value?

A. Unique Key

B. Primary Key

C. Foreign Key

D. Candidate key

B

66
New cards

46. Which operation is commonly used to display all the properties derived from the original property?

A. Union

B. Intersection

C. Closure

D. Projection

C

67
New cards

47. In SQL, what is the purpose of the CLOSE statement in relation to cursors?

A. To close the database connection

B. To close the cursor and release associated resources

C. To close the transaction

D. To close the result set

B

68
New cards

48. In query compiler, which unit builds a tree structure from the text form of the query?

A. A query parser

B. A query preprocessor

C. A query optimizer

D. A query processor

A

69
New cards

49. A ____ is a relation name, together with the attributes of that relation.

A. Schemas

B. Instance

C. Database

D. Attributes

A

70
New cards

50. Regarding the difference between a primary key vs. unique key, which of the following is false?

A. There can be only one unique key for a table

B. A primary key is a key that uniquely identifies each record in a table but cannot store NULL values

C. A unique key prevents duplicate values in a column and can store NULL values

D. Only one primary key is allowed to use in a table

A

71
New cards

51. Insert into Students ____ (32, N'Iona Bush', N'Female');

In the given query which of the keyword has to be inserted?

A. Into

B. Set

C. Where

D. Values

D

72
New cards

52. If attribute A determines both attributes B and C, then it is also true that:

A. (B, C) → A

B. C → A

C. B → A

D. A → B

D

73
New cards

53. How to execute a procedure

A. execute name_sp

B. exe name_sp

C. call name_sp

D. All the answers above

E. a and b are correct

A

74
New cards

54. You have a column named TelephoneNumber that stores numbers as varchar(20). You need to write a query that returns the first three characters of a telephone number. Which expression should you use?

A. CHARINDEX('[0-9][0-9][0-9]', TelephoneNumber, 3)

B. SUBSTRING(TelephoneNumber, 3, 1)

C. SUBSTRING(TelephoneNumber, 3, 3)

D. LEFT(TelephoneNumber, 3)

D

75
New cards

55. UPDATE instructor____ salary = salary * 1.05;

Fill in with the correct keyword to update the instructor relation.

A. Where

B. Set

C. In

D. Select

B

76
New cards

56. Which of the following is not a data model in the database?

A. Conceptual data model

B. Object-Oriented data model

C. Network data model

D. Hierarchical data model

A

77
New cards

57. If a relation is in BCNF, then it is also in

A. 1 NF

B. 2 NF

C. 3 NF

D. All of the mentioned

D

78
New cards

58. What is Database Normalization?

A. A process whereby a limit is put on the number of fields a record can contain

B. The process of ensuring that each table has a key

C. The process of ensuring that a relational database has at least two tables in it

D. A process whereby the design of a table (relation) is decomposed into more tables that more precisely fit the relational model

D

79
New cards

59. The transaction methods used with the Connection object to save or cancel changes made to the data source are:

A. Begin Transaction, Rollback Transaction

B. Begin Transaction, Commit Transaction

C. Begin Transaction, Commit Transaction, Rollback Transaction

D. Commit Transaction, Rollback Transaction

C

80
New cards

60. Which of the following is correct?

A. SELECT datepart(DATE, '10-jan-24')

B. SELECT datepart('10-jan-24', DATE)

C. SELECT datepart('10-jan-24', DAY)

D. SELECT datepart(DAY, '10-jan-24')

D

81
New cards

61.Foreign key constraints are created by using the "____" keyword to refer to the primary key of another table

.A. Refer

B. References

C. Referential

D. All of the others

B

82
New cards

62. ______ has a right side that is a subset of its left side

A. A trivial FD

B. A non-trivial FD

C. A key of relation

D. A super key of relation

A

83
New cards

63. Which one of the following SQL statements returns the name of the employee (employeename, dept_code, salary) receiving the maximum salary in a particular department?

A. Select employeename, dept_code, salary

From employee Where employee.salary in (select (salary)

from Employee group by dept_code having Max(salary))

B. Select employeename, dept_code, salary

From employee Where employee.salary in (select Max(salary)

from Employee group by dept_code)

C. Select employeename, dept_code, salary

From employee Where employee.salary in (select Max(salary)

from Employee group by dept_code having Max(salary))

D. Select employeename, dept_code, salary

From employee Where employee.salary =(select Max(salary)

from Employee group by dept_code)

B

84
New cards

64. What is not the purpose of the index in MS-SQL Server?

A. To use less hardware resources

B. To enhance the query performance

C. To provide an index to a record

D. To perform fast in searching

A

85
New cards

65. When is it recommended to use a cursor in SQL?

A. Always, as cursors are the most efficient way to process data

B. When processing data row by row is necessary or unavoidable

C. Only when creating complex joins between tables

D. Never, as set-based operations are always more efficient

B

86
New cards

66. In relational database design, which of the following is known as a set of entities of the same type that share the same properties or attributes?

A. Entity Relation model

B. Entity set

C. Field set

D. Record set

B

87
New cards

67. ________ is a set of one or more attributes taken collectively to uniquely identify a record.

A. Primary Key

B. Foreign Key

C. Super Key

D. Candidate Key

C

88
New cards

68. Which SQL statement is used to declare a cursor?

A. OPEN

B. DECLARE

C. CREATE CURSOR

D. BEGIN CURSOR

B

89
New cards

69. The deadlock state can be changed back to stable state by using ____________ statement.

A. Delete

B. Deadlock

C. Commit

D. Rollback

D

90
New cards

70. A data model is a notation for describing data or information. The description generally consists ______?

A. Structure of the data

B. Operations on the data

C. Constraints on the data

D. All of the others

D

91
New cards

71. The latter clause consists of the keyword ____ followed by a condition about the group.

A. Having

B. Group-by

C. Order by

D. Where

A

92
New cards

72. Which one of the following is not true for a view?

A. View never contains derived columns.

B. A view definition is permanently stored as part of the database.

C. View is a virtual table.

D. View is derived from other tables.

A

93
New cards

73. Triggers are stored blocks of code that have to be called in order to operate.

A. True

B. False

B

94
New cards

74. What is the purpose of a foreign key in an ERD?

A. It defines the data type of attributes

B. It determines the cardinality of relationships

C. It serves as the primary identifier for a table

D. It establishes a link between two tables

D

95
New cards

75. Which of the following is false about database trigger?

A. It automatically runs when an event occurs in the database server

B. DML triggers are frequently used for enforcing business rules and data integrity.

C. The same trigger action cannot be defined for more than one user action (for example, INSERT and UPDATE) in the same CREATE TRIGGER statement

D. When a trigger fires, results are returned to the calling application, just like with stored procedures.

C

96
New cards

76. What are the different events in Triggers?

A. Select, Insert

B. Select, Update

C. Select, Commit

D. Insert, Update, Delete

D

97
New cards

77. Which of the following is not a feature of DBMS?

A. Minimum duplication of data

B. Redundancy of data

C. Single-user access only

D. Support ACID Property

C

98
New cards

78. A/An _____ is a statement gives the user a number of different options in the event, condition, and action parts

A. Trigger

B. Stored-function

C. Index

D. Stored-procedure

A

99
New cards

79. The transaction methods is used with the Connection object to save or cancel changes made to the data source.

A. Begin Transaction, Rollback Transaction

B. Begin Transaction, Commit Transaction

C. Begin Transaction, Commit Transaction, Rollback Transaction

D. Commit Transaction, Rollback Transaction

C

100
New cards

80. How are composite attributes represented in the relational model?

A. As individual attributes in the related tables

B. By creating a new table for each composite attribute

C. By using a single attribute in the related tables

D. By using a composite key in the related tables

A