CSCI 4402: Database Systems - ALL Quizzes 1-6

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/90

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

91 Terms

1
New cards

A row of a table in relational model terminology is classified as _________

a. domain

b. relation

c. tuple

d. range

tuple

2
New cards

If two or more constraints are violated by using insert operation then by default the ________

a. insert is rejected

b. insert is accepted

c. insertion permanently blocked

d. insertion done for a default value

insert is rejected

3
New cards

In a relation schema, each key of schema having more than one key is classified as _________

a. foreign key

b. parallel key

c. simple key

d. candidate key

candidate key

4
New cards

In formal relational model, a set of indivisible values that could be a value for certain attribute is called ______________

a. tuple

b. relation

c. range

d. domain

domain

5
New cards

In relational model terminology, the table is considered as ____________

a. domain

b. relation

c. tuple

d. range

relation

6
New cards

In the data model schemas, the constraints that are expressed directly are classified as _________

a. parallel constraints

b. explicit constraints

c. flat constraints

d. implicit constraints

explicit constraints

7
New cards

In the data model, the inherent constraints are classified as ______________

a. implicit constraints

b. flat constraints

c. parallel constraints

d. explicit constraints

implicit constraints

8
New cards

The basic operations that can be performed on relations are _________

a. deletion

b. modification

c. all of the above

d. insertion

all of the above

9
New cards

The key which specifies that two different tuples cannot have the same value is classified as __________

a. simple key

b. conceptual key

c. parallel key

d. super key

super key

10
New cards

The number of the attributes of the relation is considered as the ___________ of the relation

a. domain

b. degree

c. cardinality

d. state

degree

11
New cards

The number of tuples in a relation is considered as the ____________ of a relation

a. cardinality

b. degree

c. domain

d. arity

cardinality

12
New cards

The operation which violates only one constraint called referential integrity when it is performed is called ______________

a. update operation

b. modify operation

c. insert operation

d. delete operation

delete operation

13
New cards

The state in which the database does not follow integrity constraints is classified as ___________

a. invalid state

b. candidate state

c. valid state

d. parallel state

invalid state

14
New cards

The state in which the database follows all the integrity constraints is classified as _______

a. parallel state

b. valid state

c. candidate state

d. invalid state

valid state

15
New cards

The type of constraint in which the value of each attribute (X) must be an indivisible value from domain(X) is classified as _________

a. atomic constraint

b. implicit constraint

c. domain constraint

d. explicit constraint

domain constraint

16
New cards

When the foreign key refers to a tuple which does not exists in subjected relation then the constraint violated is __________

a. insert integrity

b. modify integrity

c. inferential integrity

d. referential integrity

referential integrity

17
New cards

When the primary key is null of the new tuple then the constraint violated is __________

a. secondary integrity constraint

b. null integrity constraint

c. entity integrity constraint

d. primary integrity constraint

entity integrity constraint

18
New cards

Which of the following statement is not true about the attributes in a relation?

a. The relation attribute is unordered

b. The names of the attributes are unique inside a database

c. The names of the attributes are unique inside a relation

d. Attributes names are used to help interpreting the meaning of their values

The names of the attributes are unique inside a database

19
New cards

Suppose we want to list all students ids and names, but do not care about their addresses. Which of the following operations allows us to produce this relation?

a. Union

b. Set difference

c. Cross Product

d. Project

Project

20
New cards

Which of the following operations that is equivalent to combine certain selections and a cross product?

a. Intersection operation

b. Union operation

c. Join operation

d. Division operation

Join operation

21
New cards

Which of the following are the binary operations?

a. Rename, union, and set difference

b. Set difference, union, and project

c. Cartesian product, union, and set difference

d. Cartesian product, set difference, and project

Cartesian product, union, and set difference

22
New cards

If we have two relation R and S that are union compatible, the number of tuples in the output of their union equal __________

a. Number of the common tuples between R and S

b. Number of tuples in R +Number of tuples in S - Number of the common tuples between R and S

c. Number of tuples in R +Number of tuples in S

d. Could not be determined

Number of tuples in R + Number of tuples in S - Number of the common tuples between R and S

23
New cards

Which of the following relational algebra expression do?

σsalary>1200Employeeσsalary>1200Employee

a. Finds all the salaries in Employee where the number of values is greater than 1200

b. Finds the tuples in Employee where the salary is greater than 12000

c. Finds all the tuples in Employee

d. Finds all the tuples in Employee where the salary is greater than 1200

Finds all the tuples in Employee where the salary is greater than 1200

24
New cards

In relational algebra, the term relation is equivalent to ________

a. Column

b. Attribute

c. Row

d. Table

Table

25
New cards

The select, project, and rename operations are called________

a. Unary operations

b. Binary operations

c. Ternary operations

d. None of them

Unary operations

26
New cards

What does the following relational operation perform?

ρA1,A2,A3,...RρA1,A2,A3,...R

a. It rename the table R

b. It returns the results of table R renaming the attributes A1,A2,A3,...A1,A2,A3,...

c. It returns the results of table R with the previous attribute names

d. None of the mentioned

It returns the results of table R renaming the attributes A1, A2, A3, ...

27
New cards

In relational algebra, the term tuple is equivalent to ______

a. Row

b. Table

c. Attribute

d. Column

Row

28
New cards

The binary operation union, denoted as in the set theory by ___________

a. σ

b. ∩

c. π

d. ∪

29
New cards

The output table schema always match the input table schema when we use the __________ operation

a. Select

b. Cross product

c. Project

d. Join

Select

30
New cards

The select operation selects tuples that satisfy a given predicate. We use the lower case __________ to denote selection

a. Greek letter pi (π)

b. Greek letter sigma (σ)

c. Greek letter rho (ρ)

d. Greek letter sigma (ρ)

Greek letter sigma (σ)

31
New cards

The project operation selects tuples with some attributes that we wish to include but some attributes we do not want to include in the final relation. We use the lowercase ______ to denote project operation.

a. Greek letter sigma (σ)

b. Greek letter pi (π)

c. Greek letter rho (ρ)

d. Greek letter sigma (ρ)

Greek letter pi (π)

32
New cards

Which of the following operations allows us to find the tuples that are in one relation but are not in another relation?

a. Set difference

b. Set intersection

c. Union

d. Cross product

Set difference

33
New cards

The expression R∩SR∩S is equivalent the expression ______________

a. (R∪S)−R

b. (R∪S)−S

c. R−(R−S)

d. R−(R∪S)

R−(R−S)

34
New cards

Which of the following is not a relational algebra operation?

a. Union

b. Project

c. Select

d. Manipulate

Manipulate

35
New cards

With SQL, how can you insert a new record into the "Student" table?Note: Student table has only two attributes, which are Fname and Lname.

a. INSERT VALUES (Fname, Lname) INTO Student

b. INSERT INTO Student VALUES ('Peter', 'Jackson')

c. INSERT VALUES ('Peter', 'Jackson') INTO Student

d. INSERT ('Peter', 'Jackson') INTO Student

INSERT INTO Student VALUES ('Peter', 'Jackson')

36
New cards

Which SQL keyword is used to sort the result-set?

a. ORDER BY

b. ORDER

c. SORT BY

d. SORT

ORDER BY

37
New cards

What is the difference between the CHAR(n) and VARCHAR(n) data types?

a. Both of them are string data types but CHAR has fixed length while VARCHAR is variable.

b. They are the same because both of them are string data types.

c. CHAR is for characters and VARCHAR is for strings data types

d. There is no data type called CHAR it is just VARCHAR for strings

Both of them are string data types, but CHAR has a fixed length while VARCHAR is variable.

38
New cards

With SQL, how do you select all the records from a table named "Student" where the value of the column "FirstName" ends with an "a"?

a. SELECT * FROM Student WHERE FirstName LIKE '%a%'

b. SELECT * FROM Student WHERE FirstName LIKE '_ a'

c. SELECT * FROM Student WHERE FirstName LIKE '%a'

d. SELECT * FROM Student WHERE FirstName LIKE 'a%'

SELECT * FROM Student WHERE FirstName LIKE '%a'

39
New cards

Which of the following is the full form of DDL?

a. Detailed Data Language

b. Data Definition Language

c. Data Derivation Language

d. Dynamic Data Language

Data Definition Language

40
New cards

With SQL, how can you insert "Salah" as the "LastName" in the "Student" table?

The Student table has two attributes FirstName and LastName.

a. INSERT ('Salah') INTO Student (LastName)

b. INSERT INTO Student VALUES ('Salah')

c. INSERT INTO Student (Salah) INTO LastName

d. INSERT INTO Student (LastName) VALUES ('Salah')

INSERT INTO Student (LastName) VALUES ('Salah')

41
New cards

With SQL, how do you select all the records from a table named "Student" where the value of the column "FirstName" is "Adam"?

a. SELECT * FROM Student WHERE FirstName='Adam'

b. SELECT * FROM Student WHERE FirstName<>'Adam'

c. SELECT All FROM Student WHERE FirstName LIKE 'Adam'

d. SELECT ALL FROM Student WHERE FirstName='Adam'

SELECT * FROM Student WHERE FirstName='Adam'

42
New cards

Which SQL constraint do we use to set some value to a field whose value has not been added explicitly?

a. DEFAULT

b. UNIQUE

c. CHECK

d. NOT NULL

DEFAULT

43
New cards

What command is used to create a new table in SQL?

a. BUILD Table

b. CREATE Table

c. CREATE Shema

d. GENERATE Table

CREATE Table

44
New cards

What does the following statement in SQL do?

DELETE FROM student;

a. Will do nothing because there is no where clause.

b. Delete all tuples in table student

c. Delete the table student and all its tuples

d. Delete the table student from the schema

Delete all tuples in table student

45
New cards

With SQL, how do you select all the columns from a table named "Products"?

a. SELECT all FROM Products

b. SELECT Products

c. SELECT *.Products

d. SELECT * FROM Products

SELECT * FROM Products

46
New cards

Which SQL statement is used to update data in a database?

a. MODIFY

b. SAVE AS

c. UPDATE

d. SAVE

UPDATE

47
New cards

With SQL, how do you select all the records from a table named "Student" where the "FirstName" is "Robin" and the "LastName" is "Williams"?

a. SELECT * FROM Student WHERE FirstName<>'Robin' AND LastName<>'Williams'

b. SELECT FirstName='Robin' , LastName='Williams' FROM Student

c. SELECT * FROM Student WHERE FirstName='Robin' OR LastName='Williams'

d. SELECT * FROM Student WHERE FirstName='Robin' AND LastName='Williams'

SELECT * FROM Student WHERE FirstName='Robin' AND LastName='Williams'

48
New cards

Which SQL statement is used to return only different values?

a. SELECT UNIQUE

b. SELECT DISTINCT

c. SELECT ALL

d. SELECT DIFFERENT

SELECT DISTINCT

49
New cards

What are rows of a relation known as?

a. Relation

b. Tuple

c. Entity

d. Degree

Tuple

50
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p>SELECT Did FROM Movies;</p><p>a. Five tuples</p><p>b. Three tuples</p><p>c. Four tuples</p><p>d. empty (zero tuples)</p>

How many tuples does the following SQL statement retrieve?

SELECT Did FROM Movies;

a. Five tuples

b. Three tuples

c. Four tuples

d. empty (zero tuples)

Five tuples

51
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p>SELECT Dname FROM Directors;</p><p>a. Three tuples</p><p>b. Four tuples</p><p>c. Five tuples</p><p>d. empty (zero tuples)</p>

How many tuples does the following SQL statement retrieve?

SELECT Dname FROM Directors;

a. Three tuples

b. Four tuples

c. Five tuples

d. empty (zero tuples)

Five tuples

52
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p>SELECT Mname, Dname FROM Movies, Directors</p><p>a. Five tuples</p><p>b. Three tuples</p><p>c. Four tuples</p><p>d. 25 Tuples</p>

How many tuples does the following SQL statement retrieve?

SELECT Mname, Dname FROM Movies, Directors

a. Five tuples

b. Three tuples

c. Four tuples

d. 25 Tuples

25 Tuples

53
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p>SELECT DISTINCT Did FROM Movies;</p><p>a. Five tuples</p><p>b. empty (zero tuples)</p><p>c. Three tuples</p><p>d. Four tuples</p>

How many tuples does the following SQL statement retrieve?

SELECT DISTINCT Did FROM Movies;

a. Five tuples

b. empty (zero tuples)

c. Three tuples

d. Four tuples

Three tuples

54
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p>SELECT Mname, Dname FROM Movies, Directors WHERE Movies.Did=Director.Did;</p><p>a. Three tuples</p><p>b. 25 Tuples</p><p>c. Four tuples</p><p>d. Five tuples</p>

How many tuples does the following SQL statement retrieve?

SELECT Mname, Dname FROM Movies, Directors WHERE Movies.Did=Director.Did;

a. Three tuples

b. 25 Tuples

c. Four tuples

d. Five tuples

Five tuples

55
New cards

Suppose that we have the following table schema: Movies (id, name, director)

Which of the following queries could retrieve the movies names that doesn't have director in the database (the director attribute equal to NULL)?

a. SELECT * FROM Movies WHERE director=NULL

b. SELECT name FROM Movies WHERE director IS NULL

c. SELECT name FROM Movies WHERE director = NULL

d. SELECT * FROM Movies WHERE director IS NULL

SELECT name FROM Movies WHERE director IS NULL

56
New cards

With MySQL, how can you return the number of records in the "Student" table?

a. SELECT LEN(*) FROM Student;

b. SELECT NO(*) FROM Student;

c. SELECT COLUMNS(*) FROM Student;

d. SELECT COUNT(*) FROM Student;

SELECT COUNT(*) FROM Student;

57
New cards

The system execute the rest of the trigger body that is satisfying the condition only for the ___________

a. Tuples

b. Relation

c. Instances

d. Attributes

Tuples

58
New cards

What is the clause that is responsible for adding a condition to an aggregate function?

a. HAVING Clause

b. GROUP Clause

c. ORDER Clause

d. WHERE Clause

HAVING Clause

59
New cards

What is the name of the function that is used to check whether the query result is empty or not?

a. EXIST

b. UNIQUE

c. AS

d. DISTINCT

EXIST

60
New cards

Which of the following is not from the typical trigger components?

a. Condition

b. Events

c. Action

d. Manipulation

Manipulation

61
New cards

Which of the operation are not specifies in triggers?

a. INSERT

b. ALTER

c. DELETE

d. UPDATE

ALTER

62
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p></p><p>SELECT Dname, sum(salary)</p><p>FROM Department,Employee</p><p>WHERE Department.Did=Employee.Did</p><p>GROUP BY Dname;</p><p></p><p>a. Four Tuples</p><p>b. One Tuple</p><p>c. Five Tuples</p><p>d. Three Tuples</p>

How many tuples does the following SQL statement retrieve?

SELECT Dname, sum(salary)

FROM Department,Employee

WHERE Department.Did=Employee.Did

GROUP BY Dname;

a. Four Tuples

b. One Tuple

c. Five Tuples

d. Three Tuples

Three Tuples

63
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p></p><p>SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Mgr=Eid;</p><p></p><p>a. Three Tuples</p><p>b. Five Tuples</p><p>c. Four Tuples</p><p>d. One Tuple</p>

How many tuples does the following SQL statement retrieve?

SELECT sum(salary)

FROM Department, Employee

WHERE Mgr=Eid;

a. Three Tuples

b. Five Tuples

c. Four Tuples

d. One Tuple

One Tuple

64
New cards
<p>Suppose that the following SQL statement will retrieve one values. What is this value?</p><p></p><p>SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Mgr=Eid;</p><p></p><p>a. 9700</p><p>b. 7000</p><p>c. 4200</p><p>d. 13400</p>

Suppose that the following SQL statement will retrieve one values. What is this value?

SELECT sum(salary)

FROM Department, Employee

WHERE Mgr=Eid;

a. 9700

b. 7000

c. 4200

d. 13400

7000

65
New cards
<p>Suppose that the following SQL statement will retrieve one values. What is this value?</p><p></p><p>SELECT sum(salary)</p><p>FROM Employee</p><p>WHERE Eid in (SELECT DISTINCT Mgr FROM Department);</p><p></p><p>a. 7000</p><p>b. 9700</p><p>c. 4200</p><p>d. 13400</p>

Suppose that the following SQL statement will retrieve one values. What is this value?

SELECT sum(salary)

FROM Employee

WHERE Eid in (SELECT DISTINCT Mgr FROM Department);

a. 7000

b. 9700

c. 4200

d. 13400

4200

66
New cards
<p>Which of the following SQL statements will retrieve the total salaries of all department</p><p>managers?</p><p></p><p>a. SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Department.Mgr=Employee.Eid;</p><p></p><p>b. SELECT sum(salary) FROM Employee</p><p>WHERE Eid in (SELECT DISTINCT Mgr FROM Department);</p><p></p><p>c. SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Mgr=Eid;</p><p></p><p>d. SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Mgr=Eid</p><p>GROUP BY Department.Did;</p>

Which of the following SQL statements will retrieve the total salaries of all department

managers?

a. SELECT sum(salary)

FROM Department, Employee

WHERE Department.Mgr=Employee.Eid;

b. SELECT sum(salary) FROM Employee

WHERE Eid in (SELECT DISTINCT Mgr FROM Department);

c. SELECT sum(salary)

FROM Department, Employee

WHERE Mgr=Eid;

d. SELECT sum(salary)

FROM Department, Employee

WHERE Mgr=Eid

GROUP BY Department.Did;

SELECT sum(salary) FROM Employee

WHERE Eid in (SELECT DISTINCT Mgr FROM Department);

67
New cards

An entity set that does not have sufficient attributes to form a primary key is termed a __________

a. Variable set

b. Variant set

c. Strong entity set

d. Weak entity set

Weak entity set

68
New cards

For a weak entity set to be meaningful, it must be associated with another entity set, called the______________

a. Strong entity

b. Identifying entity

c. Owner entity

d. Neighbor entity

Identifying entity

69
New cards

If two entities have many to many relationships mostly results in how many tables.

a. Two

b. Four

c. One

d. Three

Three

70
New cards

If you were collecting and storing information about your music collection, an album would be considered a/an ___________

a. Relation

b. Instance

c. Entity

d. Attribute

Entity

71
New cards

Select from the following the multi-valued attribute.

a. Phone_number

b. All of the mentioned

c. Name

d. Date_of_birth

Phone_number

72
New cards

Select the attributes which made up of more than one single attribute.

a. Single value attribute

b. Composite attribute

c. Derived attribute

d. Multi-value attribute

Composite attribute

73
New cards

The attribute AGE is?

a. Single valued

b. Composite

c. Derived

d. Multi-valued

Derived

74
New cards

The number of entities to which another entity can be related through a relationship set is called?

a. Entity

b. Attributes

c. Cardinality

d. Schema

Cardinality

75
New cards

The primary key in a many to one relationship, acts as a foreign key on which side?

a. On both the sides

b. On the side where many relationships are defined

c. On the side where a single (one) relationship is defined

d. Neither of them

On the side where many relationships are defined

76
New cards

The Rectangles in ERD represents __________

a. Primary key

b. Attributes of a relationship

c. Entity

d. Relationship

Entity

77
New cards

The relationship is represented in E-R diagram as________________

a. Dashed lines

b. Diamond

c. Double diamonds

d. Undivided rectangles

Diamond

78
New cards

Weak entity set is represented as____________

a. Double diamond

b. Double rectangle

c. Underline

d. Double line

Double rectangle

79
New cards

Which of the following gives a conceptual structure of the database graphically?

a. Entity-relationship diagram

b. Architectural representation

c. Entity diagram

d. Database diagram

Entity-relationship diagram

80
New cards

Consider the relation R={A,B,C,D,E,F} and the set of functional dependencies {A→DE, B→C, DE→F, F→AB}.

How many different keys for the relation R?

a. one

b. Four

c. Three

d. Two

Three

81
New cards

Which forms simplifies and ensures that there are minimal data aggregates and repetitive groups?

a. 1NF

b. 2NF

c. 3NF

d. Normal forms do not reduce the redundancy

3NF

82
New cards

If the attribute of relation schema R is not a member of some candidate key then this type of attributes is classified as ______________

a. atomic attribute

b. candidate attribute

c. nonprime attribute

d. prime attribute

nonprime attribute

83
New cards

Considering the relational database, the functional dependency between two attributes A and B is denoted by ______

a. B←AB←A

b. R←ABR←AB

c. AB→RAB→R

d. A→B

A→B

84
New cards

The joining property which guarantees that spurious tuple generation problem is not created after decomposition is called _______________

a. lossless join property

b. outer join property

c. inner join property

d. additive join property

lossless join property

85
New cards

In the functional dependency between two sets of attributes A and B then the set of attributes A of database is classified as _________________

a. down left side

b. left hand side

c. right hand side

d. top right side

left hand side

86
New cards

In the __________ normal form, a composite attribute is converted to individual attributes.

a. BCNF

b. First

c. Third

d. Second

First

87
New cards

In the tuples, the interpretation of the values of the attribute is considered as __________

a. semantics of relation

b. clauses of relation

c. schema of relation

d. commands of relation

semantics of relation

88
New cards

The normalization form which is based on the transitive dependency is classified as _______________

a. third normal form

b. second normal form

c. first normal form

d. no relation between normalization and transitive dependency

third normal form

89
New cards

The normal form which only includes indivisible values or single atomic values is classified as __________

a. BCNF

b. third normal form

c. first normal form

d. second normal form

first normal form

90
New cards

Considering the functional dependency, the one in which removal from some attributes must affect dependency is called __________________

a. partial dependency

b. prime functional dependency

c. transitive dependency

d. full functional dependency

full functional dependency

91
New cards

Consider the relation R={A,B,C,D,E,F} and the set of functional dependencies {A→DE, B→C, DE→F, F→AB}.

Which one of the following is not considered a key for the relation R?

a. FF

b. AA

c. DEDE

d. AC

AC