week 1 Flashcards

1
Q

What is the difference between a database schema and a database instance

A

A database schema represents the logical design of the database.
A database instance is a snapshot of the data in the database at a given point in time.

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

What is a superkey in a relational database

A

A superkey is a set of attributes that can uniquely identify a tuple in a relation.

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

What is a candidate key

A

A candidate key is a minimal superkey, meaning it uniquely identifies records without redundancy.

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

What is a primary key

A

A primary key is one of the candidate keys selected to uniquely identify records in a table.

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

What is a foreign key in a database

A

A foreign key is an attribute in one table that refers to the primary key of another table, establishing a link between them.

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

How are entity sets represented in an ER diagram

A

Entity sets are represented by rectangles in an ER diagram, with attributes listed inside and primary keys underlined.

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

What is a relationship set in a database model?

A

A relationship set represents the associations between entities in a database.

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

How are relationship sets represented in an ER diagram?

A

Relationship sets are represented by diamonds in an ER diagram.

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

What is a composite attribute in the ER model?

A

A composite attribute is an attribute that can be broken down into smaller subparts (e.g., an address having street, city, and zip)

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

What is a multivalued attribute?

A

A multivalued attribute is an attribute that can have multiple values (e.g., a person’s multiple phone numbers).

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

What are the different cardinality types in ER modeling

A

One-to-One
One-to-Many
Many-to-Many

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

What does one-to-one cardinality mean?

A

One-to-one cardinality means each entity in set A is related to exactly one entity in set B, and vice versa.

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

What is the one-to-many cardinality?

A

A: One-to-many cardinality means one entity in set A can be related to multiple entities in set B, but each entity in B is related to at most one entity in A.

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

What does many-to-many cardinality mean

A

Many-to-many cardinality means multiple entities in set A can be related to multiple entities in set B.

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

What is total participation in ER diagrams?

A

Total participation means that every entity in the set must participate in at least one relationship in the relationship set.

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

What is partial participation in ER diagrams

A

Partial participation means that some entities in the set may not participate in the relationship set.

17
Q

What is a primary key for an entity set?

A

A primary key for an entity set is a set of attributes that uniquely identifies each entity in that set.

18
Q

What is a weak entity set

A

A weak entity set is an entity that does not have enough attributes to form a primary key on its own and relies on a “strong” entity for identification.

19
Q

How are composite attributes represented in an ER diagram?

A

Composite attributes are flattened by creating separate attributes for each component (e.g., an address could be split into street, city, and zip).

20
Q

How are multivalued attributes represented in an ER diagram?

A

Multivalued attributes are represented by creating a separate schema for the attribute.

21
Q

What is an ER diagram used for

A

An ER diagram is used to visually represent the logical structure of a database, including entities, relationships, and their attributes.

22
Q

What is PostgreSQL

A

PostgreSQL is an open-source, object-relational database system that extends SQL with advanced features.

23
Q

What does PostgreSQL support

A

PostgreSQL supports advanced data types, ACID compliance, and full-text search, making it a powerful tool for database management.

24
Q

What is the importance of installation in PostgreSQL

A

Installing PostgreSQL sets up the database system on your machine, allowing you to create databases and execute SQL queries.

25
What is a relation schema in database design
A relation schema defines the structure of a table in a database, including the attributes and their domains.
26
What is redundancy in schemas?
Redundancy in schemas occurs when unnecessary duplication is present in the database design, which can be avoided by optimizing schema representation.
27
What is specialization in ER modeling
Specialization is a top-down design process that divides an entity set into subgroups with distinct attributes or relationships.
28
What is generalization in ER modeling
Generalization is a bottom-up process that combines multiple entity sets into a higher-level entity set.
29
How is inheritance used in specialization
In specialization, lower-level entities inherit attributes and relationships from higher-level entities.
30
What is an example of specialization?
An example is dividing an Instructor entity into subgroups like Full-time Instructor and Part-time Instructor.
31
What is PostgreSQL used for in this course?
PostgreSQL is used to create, manage, and query databases for course-related projects.