Week 1 practive quiz Flashcards

1
Q

Which of the following is a correctly formatted database query?

1) What will be the temperature in New York City tomorrow?
2) Is there a correlation between oil prices and temperature?
3) What is the name of the student with ID number 2357?
4) What is the best U.S. state for retirement?

A

3) What is the name of the student with ID number 2357?

his is a correctly formatted database query.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the role of a relationship in a database?

1) It connects two attributes.
2) It connects two entities.
3) It is part of a relation.
4) It helps users connect to a remote database.

A

2) It connects two entities.

Two entities are connected by one relationship.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  • Which of the following can be an entity name in a database?

1) Age
2) First Name
3) Gender
4) Student

A

4( Student

First Name cannot be an entity name because it is a characteristics with single value.

Entity = table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is required in order to use the cartesian product operator on two relations?

1) There must be at least one common attribute in the two relations.
2) The number of attributes in each relation must be the same.
3) The number of tuples in each relation must be the same.
4) It can be applied to any two relations without a requirement.

A

4) It can be applied to any two relations without a requirement.

The cartesian product does not require any condition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  • Consider two relations A and B in a database. Relation A has 5 rows and relation B has 3 rows. How many rows are produced if we apply the cartesian product operation to A and B?

1) 15
2) 8
3) 3
4) 5

A

1) 15

The number of rows created by the cartesian product is found by multiplying the number of rows in each relation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which mathematical operator must be used in order to display information about students who are majoring in Computer Science but not in Electrical Engineering?

1) Cartesian Product
2) Union
3) Intersection
4) Difference

A

4) Difference

The difference operator displays the requested information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  • Which statement about the selection operator is true?

1) It requires more than one database as its input.
2) It filters certain attributes in a relation based on given criteria.
3) It filters certain tuples in a relation based on given criteria.
4) It requires more than one relation as its input.

A

3) It filters certain tuples in a relation based on given criteria.

The selection operator specifies tuples in a relation, not its attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  • Which mathematical operator must be used in order to display information about students who are majoring in both Computer Science and Electrical Engineering?

1) Intersection
2) Cartesian Product
3) Difference
4) Union

A

1) Intersection

The union operator will display information about students who are majoring in either Computer Science or Electrical Engineering or both.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which mathematical operation must be completed before the ϴ-Join operation?

1) Multiplication
2) Intersection
3) Cartesian product
4) Union

A

3) Cartesian product

The ϴ-Join operation requires cartesian product.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

For which of the following functions require database management software because typical spreadsheet software cannot implement it?

1) Search data
2) Create multiple user types
3) Update data
4) Store data

A

2) Create multiple user typDatabase management software can create multiple user types, but spreadsheet software cannot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What connects two entities in a database?

1) Record
2) Relation
3) Table
4) Relationship

A

4) Relationship

Two entities are connected by a relationship.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the name of the operation used for joining two relations?

1) ⋈-Join
2) ϴ-Join
3) β-Join
4) α-Join

A

2) ϴ-Join

This is the name of the operation used for joining two relations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  • Which operator must be used to display information about students majoring in Mathematics or Physics

1) Union
2) Difference
3) Cartesian Product
4) Intersection

A

1) Union

The union operator displays information about students majoring in either Mathematics, Physics, or both.

The intersection operator displays information about students who are majoring in both areas.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following two operators must be used one after another?

1) Cartesian Product, ϴ-Join
2) B: Union, ϴ-Join
3) Multiplication, ϴ-Join
4) Cartesian Product, Multiplication

A

these two operators can be implemented independently.

NOT 2) B: Union, ϴ-Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What must be listed after the SELECT command in a SQL query?

1) Attributes
2) Tables
3) Records
4) Conditions

A

1) Attributes

The SELECT command requires one or more attributes to be listed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  • What must be listed after the FROM command in a SQL query?

1) Tables
2) Attributes
3) Records
4) Conditions

A

1) Tables

the FROM command does not need attributes to be listed

17
Q

What must be listed after the WHERE command in a SQL query?

1) Conditions
2) Tables
3) Attributes
4) Records

A

1) Conditions

The WHERE command requires one or more conditions to be listed.

18
Q

What is the function of the DISTINCT command in a SQL query?

1) To eliminate duplicate columns
2) To eliminate duplicate rows
3) To eliminate duplicate relations
4) To eliminate duplicate relationships

A

2) To eliminate duplicate rows

The DISTINCT command eliminates duplicate rows from query results.

19
Q

A particular query that pulls information from one or more tables is an example of a:

1) View
2) Conceptual Schema
3) Relation
4) Physical Schema

A

1) View

A view can combine data from two or more table, using joins, and also just contain a subset of information.

20
Q

Which of the following database types is most oriented toward storing well-structured data?

1) Relational Database
2) Hadoop
3) NoSQL Database
3) Spark

A

1) Relational Database

A relational database is based on the relational model of data, and is therefore well-structured.

21
Q
  • A participation constraint is indicated how in an ER diagram.

1) A line
2) A dotted line
3) A bold line
4) A dashed line

A

3) A bold line

A participation constraint defines the relationship of an attribute in a connected relation and is not represented by a dashed line.

22
Q

What does the relational algebra operator ‘x’ indicate?

1) All pairs from the two tables matched on a specified field.
2) The intersection of the two tables.
3) All possible pairs from the two tables.
4) The union of the two tables.

A

3) All possible pairs from the two tables.

Cartesian product of a set of n-tuples with a set of m-tuples yields a set of “flattened” (n * m) tuples

23
Q

The basic syntax for an SQL query is:

1) TARGET, RELATION, DISTINCT
2) SELECT, FROM, WHERE
3) DISTINCT FROM QUALIFICATION
4) DISTINCT, FIELD, ID

A

2) SELECT, FROM, WHERE

The basic syntax of a SQL query is SELECT, FROM, WHERE