wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DBI202

Total questions: 136

Worksheet time: 1hrs 8mins

Name
Class
Date
1.

In the context of a DBMS, what is meant by "data integrity"?

a)

A. The ability to perform multiple queries simultaneously

b)

B. Ensuring data is consistent, accurate, and reliable

c)

C. The ability to recover data after a failure

d)

D. Encrypting data to protect it from unauthorized access

2.

A person or persons responsible for the structure or schema of the database is

a)

A. A User

b)

B. A Coder

c)

C. A Customer

d)

D. A database administrator

3.

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

a)

A. Array structure

b)

B. Table structure.

c)

C. Tree structure

d)

D. Pointers structure

4.

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

a)

A. A query parser

b)

B. A query preprocessor

c)

C. A query optimizer

d)

D. A query processor

5.

If there is more than one key for relation schema in DBMS then each key relation schema is classified as

a)

A. Prime key

b)

B. Super key

c)

C. Candidate key

d)

D. Primary key

6.

In a network data model, a child node can be linked to multiple parent nodes. What is this relationship called?

a)

A. many-to-one

b)

B. one-to-many

c)

C. many-to-many

d)

D. one-to-one

7.

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

a)

A. Intersection

b)

B. Set-difference

c)

C. Union

d)

D. Cross-product

8.

The primary key is selected from the:

a)

A. foreign keys.

b)

B. candidate keys

c)

C. determinants.

d)

D. composite keys.

9.

What is Database Normalization?

a)

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

b)

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

c)

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

d)

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

10.

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 (A)

b)

B. (ABCD)

c)

C. (ABC)

d)

D. (AB)

11.

Given following schema R(A, B, C, D) and S=(A-B, B-C, C-D) Compute (A)+?

a)

A. AB

b)

B. ABC

c)

C. ABCD

d)

D. BCD

12.

In relational database design, which normal form of a relation eliminates multi-valued attributes and ensures that data is organized at a fundamental level?

a)

A. 1NF

b)

B. 2NF

c)

C. 3NF

d)

D. 4NF

13.

Which normalization level ensures that there are no repeating groups in tables?

a)

A. First Normal Form (1NF)

b)

B Second Normal Form (2NF)

c)

C. Third Normal Form (3NF)

d)

D. Boyce-Codd Normal Form (BCNF)

14.

Relationships in the E/R model are also represented by relations. The relation for a given relationship R has the following attributes: If the relationship has attributes, then these are also attributes of relation R.

a)

A. True

b)

B. False

15.

Which type of relationship connects two entities where one entity can have multiple associations with another entity, but the second entity can only have one association with the first entity?

a)

A. One-to-One

b)

В. One-to-Many

c)

C. Many-to-Many

d)

D. Many-to-One

16.

In an ERD, what does a line connecting two entities represent?

a)

A. An attribute

b)

B. A relationship

c)

C. A primary key

d)

D. A foreign key

17.

What is a derived attribute in an ERD?

a)

A. An attribute that is calculated from other attributes

b)

B. An attribute that cannot be calculated

c)

C. An attribute that is the primary key of an entity

d)

D. An attribute that represents a relationship

18.

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

a)

A. It uniquely identifies each record in a table

b)

B. It establishes relationships between tables

c)

C. It determines the data type of attributes

d)

D. It defines the cardinality of relationships

19.

_________ Real-world thing, distinguishable from other objects, in ERD

a)

A. Entity

b)

B. Diagram

c)

C. Relationship

d)

D. Primary entity

20.

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)

A. Entity Relation model

b)

B. Entity set

c)

C. Field set

d)

D. Record set

21.

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

a)

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

b)

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

c)

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

d)

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

22.

In the relational model, how are relationships represented between tables

a)

A. By adding attributes to each table

b)

B. By creating a new table for each relationship

c)

C. By adding foreign keys to related tables

d)

D. By creating a primary key in each table

23.
a)

A. Unknown, unknown, false

b)

B. True, false, unknown

c)

C. True, unknown, unknown

d)

D. Unknown, false, unknown

24.

Which of the following is correct?

a)

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

b)

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

c)

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

d)

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

25.

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

a)

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

b)

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

c)

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

d)

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

26.

You have a table named Books that has columns named Book Title and Description. There is a full-text index on these columns. You need to return rows from the table in which the word 'computer' exists in either column. Which code segment should you use?

a)

A. SELECT FROM Books WHERE FREETEXT(", 'computer')

b)

B. SELECT FROM Books WHERE Book Title LIKE '%computer%'

c)

C. SELECT FROM Books WHERE Book Title = '%computer%' OR Description = "%computer%'

d)

D. SELECT FROM Books WHERE FREETEXT (Book Title, 'computer')

27.

Given the table Student(Studld, StudName), table Subject(Subld, SubName) and test score table (Studld, SubName, MarkExam). Suppose we need to query: "Find students who have never taken the Arithmetic exam", Which of the following operations can we use in SQL statements?

a)

A. not in

b)

B. not exists

c)

C. not in or not exists

d)

D. not in and not exists at the same time

e)

E. None of the mentioned answers

28.

UPDATE
-------------- instructor salary salary 1.05,
Fill in with correct keyword to update the instructor relation.

a)

A. Where

b)

B. Set

c)

C. In

d)

D. Select

29.

Your database contains a table named Purchases. The table includes a DATETIME column named Purchase Time that stores the date and time each purchase is made. There is a non-clustered index on the Purchase Time column. The business team wants a report that displays the total number of purchases made on the current day. You need to write a query that will return the correct results in the most efficient manner. Which Transact-SQL query should you use

a)

A SELECT COUNT(*) FROM Purchases WHERE PurchaseTime = CONVERT(DATE, GETDATE())

b)

B. SELECT COUNT(*) FROM Purchases WHERE PurchaseTime = GETDATE()

c)

C. SELECT COUNT(*) FROM Purchases WHERE CONVERT(VARCHAR, Purchase Time, 112) = CONVERT(VARCHAR, GETDATE(), 112)

d)

D. SELECT COUNT(*) FROM Purchases WHERE Purchase Time >= CONVERT(DATE, GETDATE()) AND PurchaseTime < DATEADD(DAY, 1, CONVERT(DATE, GETDATE()))

30.

In an UPDATE statement, what does the WHERE clause determine?

a)

A. The order of update

b)

B. The columns to be updated

c)

C. The condition for selecting rows to be updated

d)

D. The table to be updated

31.

Let ParamountMovies be the VIEW defined from the Movies table: CREATE VIEW ParamountMovies AS SELECT title, year FROM Movies WHERE studioName = 'Paramount If you execute the statement: DROP VIEW ParamountMovies choose the correct statement for the Movies table.

a)

A. Dropping the VIEW does not affect any tuples in the Movies table.

b)

B. Dropping the VIEW affects some tuples in the Movies table that belong to the VIEW ParamountMovies

c)

C. Dropping the VIEW ParamountMovies that was created from the Movies table, so we can no longer query the Movies table

d)

D. The Movies table will be drop out the database.

32.

What is the most useful index we can put on a relation?

a)

A. Index on a unique attribute

b)

B. Index not on the key

c)

C. Index on its key

d)

D. Index on a numeric attribute

33.

What is a database trigger in SQL Server?

a)

A. A stored procedure that runs automatically in response to certain events on a table or view

b)

B. A scheduled job that runs at specific times

c)

C. A function that can be called by other stored procedures

d)

D. A query that retrieves data from the database

34.

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

a)

A. Refer

b)

B. References

c)

C. Referential

d)

D. All of the others

35.

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

a)

A. Begin Transaction, Rollback Transaction

b)

B. Begin Transaction, Commit Transaction

c)

C. Begin Transaction, Commit Transaction, Rollback Transaction

d)

D. Commit Transaction, Rollback Transaction

36.

Transaction processing is associated with everything below except.

a)

A. Producing detail, summery, or exception reports

b)

B. Recording a business activity

c)

C. Confirming an action or triggering a response

d)

D. Maintaining data

37.

Two concurrent executing transactions T1 and T2 are allowed to update the same record in an uncontrolled manner. In such a scenario. The following problem may not occur if database system has no concurrency module and allows concurrent execution of above two transactions. Which of the following is correct in this case?

a)

A. Transaction failure

b)

B. Dirty read problem

c)

C. Lost update problem

d)

D. Inconsistent database state

38.

What is an SQL virtual table that is constructed from other tables?

a)

A. Just another table

b)

B. A view

c)

C. A relation

d)

C. A relation

39.

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

a)

A View never contains derived columns.

b)

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

c)

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

d)

C. View is a virtual table,

40.

Create a stored procedure named GetEmployeeByID that accepts an EmployeeID as a parameter and returns the corresponding employee's details

a)

A. CREATE PROCEDURE GetEmployeeByID @EmployeeID INT AS BEGIN SELECT FROM Employees WHERE EmployeeID = @EmployeelD; END:

b)

B. CREATE PROCEDURE GetEmployeeByID Declare @EmployeeID INT AS BEGIN SELECT FROM Employees WHERE EmployeeID = @EmployeeID: END

c)

C. CREATE PROCEDURE GetEmployeeByID @EmployeeID INT AS BEGIN SELECT FROM Employees; END

d)

C. CREATE PROCEDURE GetEmployeeByID @EmployeeID INT AS BEGIN SELECT FROM Employees; END

41.

Which of the commands below undoes the current transaction?

a)

A SAVEPOINT

b)

B. ALTER

c)

C. ROLLBACK

d)

D. COMMIT

42.

Which command is used to remove a relation from an SQL?

a)

A. Drop table

b)

B Delete

c)

C. Purge

d)

D. Remove

43.

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

a)

A. Using the EXECUTE statement

b)

B. Using the CALL statement

c)

C. Using the SELECT statement

d)

D. Using the RUN statement

44.

Which of the following describes an SQL cursor?

a)

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

b)

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

c)

C. A field within a database

d)

D. Cursors are not related to SQL

45.

Which of the following is not a typical trigger action?

a)

A. Insert

b)

B. Select

c)

C. Update

d)

D. Delete

46.

Which of the following is true about stored procedure in MS-SQL Server?

a)

A. They include procedural and SQL statements

b)

B. They are stored in Rules folder

c)

C. They do not need to have a unique name

d)

D. They are same as void function

47.

We can use these --------- in SQL queries and other statements to perform compu-tations that cannot be done with SQL alone.

a)

A. Trigger

b)

B. View

c)

C. Index

d)

D. Stored-procedure

48.

Which key does not accept the null value?

a)

A. Unique Key

b)

B. Primary Key

c)

C. Foreign Key

d)

D. Candidate key

49.

What is a weak entity in an ERD?

a)

A. An entity with no attributes

b)

B. An entity that participates in a one-to-many relationship

c)

C. An entity that cannot exist without being related to another entity

d)

D. An entity with a composite key

50.

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

a)

A. A query parser

b)

B. A query preprocessor

c)

C. A query optimizer

d)

D. A query processor

51.

Which of the following is not a feature of DBMS?

a)

A. Minimum duplication of data

b)

B. Redundancy of data

c)

C. Single-user access only

d)

D. Support ACID Property

52.

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

a)

A. Array structure

b)

B. Table structure

c)

C. Tree structure

d)

D. Pointers structure

53.

What is a database?

a)

A. Organized collection of information that cannot be accessed, updated, and managed

b)

B. Collection of data or information without organizing

c)

C. Organized collection of data or information that can be accessed, updated, and managed

d)

D. Organized collection of data that cannot be updated

54.

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

a)

A. A query parser

b)

B. A query preprocessor

c)

C. A query optimizer

d)

D. A query processor

55.

What is a database?

a)

A. A collection of information that exists over a long period of time. A collection of related data and managed by a database management system.

b)

B. The database is built based on the relational data model.

c)

C. Database used to create, update and exploit relational databases.

d)

D. The database is built based on the relational data model and exploits the relational database.

56.

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

a)

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

b)

B. The procedure for making backups is complicated.

c)

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

d)

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

57.

Database data models usually have a way to go describe limitations on what the data can be, is called

a)

A. Constraints on the data

b)

B. Operations on the data

c)

C. Structure of the data

d)

D. definition of data

58.

In the relational DBMS, what is the difference between PRIMARY KEY and UNIQUE KEY?

a)

A. UNIQUE KEY dosen't accept the NULL value but PRIMARY KEY does

b)

B. UNIQUE KEY and PRIMARY KEY are the same

c)

C. A table can have more than one PRIMARY KEY constraint but only one UNIQUE KEY

d)

D. A table can have more than one UNIQUE KEY constraint but only one PRIMARY KEY

59.

For the following relations and a Set operation: Employee Name | City | Gender Nguyen Trung Truc | HCM | Male Le Hong Son | HCM | Male Customer Name | City | Gender Nguyen Trung Truc | HCM | Male Tran Tuyet Nhi | HN | Female and Employee Customer What is the result of the difference operation?

a)

A. Name | City | Gender Le Hong Son | HCM | Male

b)

B. Name | City | Gender Nguyen Trung Truc | HCM | Male Tran Tuyet Nhi | HN | Female

c)

C. Name | City | Gender Nguyen Trung Truc | HCM | Male Le Hong Son | HCM | Male

d)

D. Name | City | Gender Nguyen Trung Truc | HCM | Male Le Hong Son | HCM | Male Tran HN | Female

60.

What is relational algebra?

a)

A. Relational algebra is a set of operations on relations.

b)

B. Relational algebra is the decomposition of relations.

c)

C. Relational algebra is eliminated from relations.

d)

D. Relational algebra is gone from relations.

61.

What is the full form of DBMS?

a)

A. Data of Binary Management System

b)

B. Database Management System

c)

C. Database Management Service

d)

D. Data Backup Management System

62.

What is information?

a)

A. A collection of unprocessed data

b)

B. A collection of processed data

c)

C. A collection of processed information

d)

D. A collection of unprocessed information

63.

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

a)

A. TCL (Transaction Control Language)

b)

B. DCL (Data Control Language)

c)

C. DDL (Data Definition Language)

d)

D. DML (Data Manipulation Language)

64.

What are the disadvantages of network data model?

a)

A. Not support the high-level query language

b)

B. Not support the relationships between nodes

c)

C. Not support the database management system

d)

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

65.

What does an RDBMS consist of?

a)

A. Collection of Tables

b)

B. Collection of Records

c)

C. Collection of Keys

d)

D. Collection of Fields

66.

What does an RDBMS consist of?

a)

A. Collection of Tables

b)

B. Collection of Records

c)

C. Collection of Keys

d)

D. Collection of Fields

67.

Select the most correct answer

a)

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)

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

c)

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)

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

68.

In the relational model of data, what is the result of an algebraic query language?

a)

A. Data series

b)

B. Data file

c)

C. Relation

d)

D. database

69.

For the following relations and a Set operation: Employee Name | City | Gender Nguyen Trung Truc | HCM | Male Le Hong Son | HCM | Male Customer Name | City | Gender Nguyen Trung Truc | HCM | Male Tran Tuyet Nhi | HN | Female and Employee Customer What is the result of the Union operation?

a)

A. Name | City | Gender Nguyen Trung Truc | HCM | Male Le Hong Son | HCM | Male

b)

B. Name | City | Gender Nguyen Trung Truc | HCM | Male Tran Tuyet Nhi | HN | Female

c)

C. Name | City | Gender Nguyen Trung Truc | HCM | Male Le Hong Son | HCM | Male Nguyen Trung Truc | HCM | Male Tran Tuyet Nhi | HN | Female

d)

DN FUD Gender Nguyen fruc HCM | Male | Male

70.

The result which operation contains all pairs of tuples from the two relations, regardless of whether their attribute values match.

a)

A. Join

b)

B. Cartesian product

c)

C. Intersection

d)

D. Set difference

71.

To modify the schema of an existing relation use_______

a)

A. Create table

b)

B. Modify table

c)

C. Alter table

d)

D. Drop table

72.

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

a)

A. Union

b)

B. Intersection

c)

C. Closure

d)

D. Projection

73.

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

a)

A. 1 NF

b)

B. 2 NF

c)

C. 3 NF

d)

D. All of the mentioned

74.

Which of the following statements is true about data normalization:

a)

A. INF is a relationship with a primary key and no repeating groups

b)

B. 2NF is 1NF without transitive functional dependencies

c)

C. 3NF is 1NF without partial functional dependencies

d)

D. All of the above answers are wrong

75.

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

a)

A. It eliminates transitive dependencies

b)

B. It allows for redundant data

c)

C. It only considers partial dependencies

d)

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

76.

Suppose that we have a relation: R(ID, full name, address) and FDs (ID->full name, ID->address) What is the highest normal form of R in relational database design? Choose correct answers?

a)

A. 2NF

b)

B. 1NF

c)

C. 3NF

d)

D. BCNF

77.

Which of the following statements about relational databases is true?

a)

A. The database is built on a relational data model.

b)

B. The database is created from excel software.

c)

C. Relational databases are only relations with attributes that are not primary keys.

d)

D. Relational database is the relationship between rows and columns in a data table.

78.

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

a)

A. The order of the columns is not important

b)

B. The order of both rows and columns is important

c)

C. The order of the rows is important

d)

D. The order of the columns is important

79.

In the entity-relationship model, what is the entity?

a)

A. Relationships

b)

B. Relationships between objects

c)

C. Objects and relationships between objects

d)

D. Data objects

80.

How are weak entity sets represented in an Entity Relationship Diagram (ERD)?

a)

A. With rectangle

b)

B. With diamond shape

c)

C. With a double-line rectangle

d)

D. With a dashed oval

81.

What does the attribute domain define in the relational model?

a)

A. The primary key of the table

b)

B. The foreign key references.

c)

C. The cardinality of relationships

d)

D. The data type and range of values that an attribute can hold

82.

Which statement is used to remove a column named E into the relation R?

a)

A. ALTER TABLE R DROP COLUMN E [DataType]

b)

B. ALTER TABLE R DROP COLUMN E

c)

C. ALTER TABLE R DELETE COLUMN E

d)

D. ALTER TABLE R DELETE COLUMN E [DataType]

83.

Which of the following is NOT the binary operation in the relational Algebra?

a)

A. Project

b)

B. Cartesian product

c)

C. Union

d)

D. Set difference

84.

Which of the following is NOT a standard aggregation operator?

a)

A. Sum

b)

B. Max

c)

C. Count

d)

D. Group

85.

A Delete command operates on _________ relation.

a)

A. One

b)

B. Two

c)

C. Several

d)

D. Null

86.

In order to undo the work of transaction after last commit which one should be used?

a)

A. View

b)

B. Commit

c)

C. Rollback

d)

D. Flashback

87.

Which of the following SQL statement remove all of the content from a table name "employees" but keep the schema?

a)

A. DELETE FROM employees;

b)

B. TRUNCATE FROM employees;

c)

C. DROP TABLE employees;

d)

D. REMOVE FROM employees;

88.

Foreign key is the one in which the___________ of one relation is referenced in another relation.

a)

A. Foreign key

b)

B. Primary key

c)

C. References

d)

D. Check constraint

89.

In which objects can Transaction be used?

a)

A. View, User-defined function

b)

B. User-defined function, Store Procedure

c)

C. Store Procedure, Trigger, View

d)

D. User-defined function, Store Procedure, Trigger

e)

E. All of the mentioned answers are wrong

90.

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

a)

A. The transaction is automatically committed

b)

B. The transaction is automatically rolled back

c)

C. The database becomes read-only

d)

D. The transaction remains in a pending state

91.

Which of the following is not mentioned how does a local variable is defined using T-SQL?

a)

A. The name of the local variable should begin with "@@" sign as the first character of its name.

b)

B. A local variable is defined using T-SQL by using statement "DECLARE".

c)

C. When a variable is first declared, its value is set to NULL. To assign a value to a variable, use the SET statement.

d)

D. The data type of local variable is declared after its name and assigned a system-supplied or user-defined data type and a length.

92.

What are the different events in Triggers?

a)

A. Select, Insert

b)

B. Select, Update

c)

C. Select, Commit

d)

D. Insert, Update, Delete

93.

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

a)

A. To close the database connection

b)

B. To close the cursor and release associated resources

c)

C. To close the transaction

d)

D. To close the result set

94.

Which of the following methods fetch data from cursor to access data?

a)

A. First, last, next, prior, absolute, relative

b)

B. First, last, next

c)

C. First, last, next, prior

d)

D. First, absolute, relative

95.

Which of the following is false about database trigger?

a)

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

b)

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

c)

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)

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

96.

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

a)

A. If A B, then AC BC

b)

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

c)

C. If A B, then BA

d)

D. If A B, then A BC

97.

A database administrator: a person or persons responsible for the struc-ture or schema of the database.

a)

A. True

b)

B. False

98.

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

a)

A Locks are used to maintain transactional integrity and consistency.

b)

B. Cursors are used to maintain transactional integrity and consistency

c)

C. Procedures are used to maintain transactional integrity and consistency

d)

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

99.

Queries and other DML actions are grouped into________ which are units that must be executed atomically and in isolation from one another

a)

A. Transactions

b)

B. Query compiler

c)

C. Data files

d)

D. Buffer manager

100.

Consider the two relations from our running movie database: Movies(title, year, length, genre, studioName, producerC#) MovieExec(name, address, cert#, netWorth) The producerC# component of each Movies tuple must also appear in the cert# component of some MovieExec tuple How can we express this integrity constraint in relational algebra?

a)

A. n_(producerC#) (Movies)=n_(cert#) (MovieExec)

b)

B. n (producerC#) (Movies)n_(cert#) (MovieExec)

c)

C. n_(cert#) (MovieExec)n_(producerC#) (Movies)

d)

D. n_(producerC#) (Movies)=n_(cert#) (MovieExec)

101.

What is the foreign key?

a)

A. It is a relational constraint that enforces referential integrity between two tables

b)

B. It is a relational constraint that that ensures the values in a specific column or set of columns are unique across all the rows in a table

c)

C. The key that need to make a data in another table

d)

D A collection of data that allows to access and use of that data

102.

The rows of a relation, other than the header row containing the attribute names, are called____

a)

A. Schemas

b)

B. Tuples

c)

C. Domains

d)

D. Attributes

103.

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____ constraint integrity

a)

A. Referential

b)

B. Primary

c)

C. Referencing

d)

D. Specific

104.

What are logical constraints?

a)

A. The relationships between attributes are represented by relational operations.

b)

B. The relationships between attributes are represented by comparisons operator.

c)

C. The relationships between attributes are represented by mathematical expressions.

d)

D. The relationships between attributes are represented by functional dependencies.

105.

The relations are constructed by the SQL language processor when it performs its job of executing queries and data modifications, and then thrown away and not stored, are called____________

a)

A. Stored relations

b)

B. Temporary tables

c)

C. Relationships

d)

D. Procedures

106.

____________is a set of one or more attributes taken collectively to uniquely identify a record.

a)

A. Primary Key

b)

B. Foreign key

c)

C. Super key

d)

D. Candidate key

107.

A(n)_____ is a property of the entire relation, rather than of the individual tuples in which each tuple is unique.

a)

A. Row

b)

B. Key

c)

C. Attribute

d)

D. Field

108.

Consider the relation: OrderDetail (orderNumber, productCode, productName, quantity, dateOrdered, sales Discount) And FDs{ orderNumber, productCode->quantity orderNumber->dateOrdered, productCode->productName, sales Discount) And the key of OrderDetail is (orderNumber, productCode} Which of the following is full dependency on the key?

a)

A. orderNumber, productCode->quantity

b)

B. orderNumber->dateOrdered

c)

C. productCode->productName

d)

D. productCode->productName, sales Discount

109.

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

a)

A. Normal Form

b)

B. Anomalies

c)

C. Decomposing Relations

d)

D. None of the others

110.

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

a)

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

b)

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

c)

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

d)

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

e)

E. If R. has complete functional dependency

111.

What is the primary goal of normalization in database design?

a)

A. To increase data redundancy

b)

B. To simplify data retrieval

c)

C. To introduce duplicate data

d)

D. To violate functional dependencies

112.

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

a)

A Increased storage space efficiency

b)

B. Reduced update anomalies

c)

C. Simplified database queries

d)

D. Enhanced data security

113.

Given that Cartoons and Murder Mysteries are special Movie genres, what is the relationship between entities Cartoons, Murder Mysteries and Movie?

a)

A. isa relationship

b)

B. ais relationship

c)

C. supporting relationship

d)

D. referential integrity relationship

114.

Let E1 and E2 be two entities in an E/R diagram with simple single-valued attributes. R1 and R2 are two relationships between E1 and E2, where R1 is one-to-many and R2 is many-to-many. R1 and R2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?

a)

A. 2

b)

B. 3

c)

C. 4

d)

D. 5

115.

How are composite attributes represented in the relational model?

a)

A. As individual attributes in the related tables

b)

B. By creating a new table for each composite attribute

c)

C. By using a single attribute in the related tables

d)

D. By using a composite key in the related tables

116.

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

a)

A. By adding attributes to one of the related tables

b)

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

c)

C. By denormalizing the database

d)

D. By creating a new table for each related entity

117.

Which of the following wildcard characters matches any sequence of zero or more characters in a string comparison?

a)

A. &

b)

B. S

c)

C. _

d)

D. %

118.

Which 2 of the following are not aggregate functions in SQL Server?

a)

A. Sum, Count

b)

B. Diff, Mult

c)

C. Sum, Avg

d)

D. Count, avg

e)

E. Min, max

119.

Identify the correct query for viewing only those records wherein the customers have a phone number?

a)

A SELECT from customers where phone IS NOT NULL

b)

B. SELECT from customers where phone = NOT NULL

c)

C. SELECT from customers where phone NOT NULL

d)

D. SELECT from customers where HAVING phone NOT NULL

120.

Which SQL clause is used to add a new column to an existing table?

a)

A. ADD COLUMN

b)

B. ALTER TABLE ADD COLUMN

c)

C. INSERT INTO

d)

D. CREATE COLUMN

121.

Which of the following is false about a foreign key?

a)

A. Whereas only one foreign key is allowed in a table.

b)

B. It refers to the field in a table which is the primary key of another table

c)

C. It can contain duplicate values and a table in a relational database.

d)

D. It can also contain NULL values.

122.

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

a)

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

b)

B. SELECT FROM Contest GROUPBY ContestDate >= '05/25/2006'

c)

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

d)

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

123.

In MS-SQL Server, which of the following is true about join operator? SELECT FROM BICUSTOMER, tblORDER

a)

A. Cartesian join

b)

B. Equi-join

c)

C. Natural join

d)

D. Outer join

124.

Suppose relation R 1(A, B) has the following tuples: AB 1 a 2 b 3 c 4 d 5 e and the relation R 2(C, A) has the following tuples CA 101 1 1022 103 3 104 1 105 1 Which tuple is contained in the result of the following query: SELECT R1 B, R2 C FROM R1 RIGHT JOIN R2 ON R1. A = R2A ;

a)

A. (a, ,101), (a, 104); (a, 105); (b, 102); (c, 103); (d, NULL); (e, NULL)

b)

B. (a,10 1); (b, 102) ;(c,103);(a,104);(a,105)

c)

C. (a, 101) / (b, 102); (c, 103)

d)

D. (a, 101); (a, 104); (b, 102); (c, 103); (e, NULL)

125.

Which of the following is true about A UNION query?

a)

A. Combines the output from multiple queries and must include the same number of columns and data types.

b)

B. Combines the output from no more than two queries and must include the same number of columns and data types.

c)

C. Combines the output from no more than two queries and does not include the same number of columns and data types.

d)

D. Combines the output from multiple queries and does not include the same number of columns and data types

126.

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

a)

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

b)

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

c)

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

d)

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

127.

Which of the following statement removes dbsale and dbsupplier database by using data definition language (DDL)?

a)

A. DROP DATABASE dbSale, dbsupplier

b)

B. DROP DATABASE dbSale and dbsupplier

c)

C. DROP DATABASE dbSale; dbsupplier

d)

D. DROP DATABASE dbSale + dbsupplier

128.

Which property of a transaction ensures that the execution of a transaction should not be interfered with by any other transactions executing concurrently?

a)

A. Atomicity

b)

B. Durability

c)

C. Isolation

d)

D. Consistency

129.

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

a)

A. Improved query performance

b)

B. Increased storage space

c)

C. Enhanced data integrity

d)

D. Fast data modification operations

130.

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

a)

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

b)

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)

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

d)

D. CREATE VIEW Expensive Product(Product No, Product Name) AS SELECT Product No, Product_Name FROM Product WHERE Product_Unit_Price>1000

131.

In SQL, to update a relation's schema, which one of the following statements can be used?

a)

A. Insert

b)

B. Update

c)

C. Alter

d)

D. Alter table

132.

A__________is a stored program that is attached to a table or a view.

a)

A. pseudofile

b)

B. embedded SELECT statement

c)

C. trigger

d)

D. None of the mentioned is correct.

133.

Which type of user-defined function in SQL returns a single value?

a)

A Scalar function

b)

B Table-valued function

c)

C. Inline function

d)

D. Aggregate function

134.

What is NOT true about the cursor in SQL?

a)

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

b)

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

c)

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

d)

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

135.

How many types of variables are there in Stored Procedure

a)

A. Default variable and input variable

b)

B. Default variable and output variable

c)

C. Input variable and output variable

d)

D. Local variables and global variables

136.

The following SQL statement creates a stored procedure that count number of customers in each City from the "Customers" table: CREATE PROCEDURE CountOfCustomers @City nvarchar(30), @CountCus int OUTPUT AS SET @CountCus = ( SELECT COUNT(CustomerID) FROM Customers WHERE City = @City GROUP BY City ) GO, Which of the following is the way to execute a procedure?

a)

A. DECLARE @CountCustomers int EXEC CountOfCustomers @City = 'Berlin', @CountCus= @CountCustomers;

b)

B. DECLARE @CountCustomers int EXEC CountOfCustomers @City = 'Berlin', @CountCus= @CountCustomers OUTPUT:

c)

C. EXECUTE CountOfCustomers 'Berlin', @CountCus= @CountCustomers OUTPUT,

d)

D. DECLARE @CountCustomers int EXEC CountOfCustomers @CountCus= @CountCustomers OUTPUT: