week 1 Flashcards
What is the difference between a database schema and a database instance
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.
What is a superkey in a relational database
A superkey is a set of attributes that can uniquely identify a tuple in a relation.
What is a candidate key
A candidate key is a minimal superkey, meaning it uniquely identifies records without redundancy.
What is a primary key
A primary key is one of the candidate keys selected to uniquely identify records in a table.
What is a foreign key in a database
A foreign key is an attribute in one table that refers to the primary key of another table, establishing a link between them.
How are entity sets represented in an ER diagram
Entity sets are represented by rectangles in an ER diagram, with attributes listed inside and primary keys underlined.
What is a relationship set in a database model?
A relationship set represents the associations between entities in a database.
How are relationship sets represented in an ER diagram?
Relationship sets are represented by diamonds in an ER diagram.
What is a composite attribute in the ER model?
A composite attribute is an attribute that can be broken down into smaller subparts (e.g., an address having street, city, and zip)
What is a multivalued attribute?
A multivalued attribute is an attribute that can have multiple values (e.g., a person’s multiple phone numbers).
What are the different cardinality types in ER modeling
One-to-One
One-to-Many
Many-to-Many
What does one-to-one cardinality mean?
One-to-one cardinality means each entity in set A is related to exactly one entity in set B, and vice versa.
What is the one-to-many cardinality?
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.
What does many-to-many cardinality mean
Many-to-many cardinality means multiple entities in set A can be related to multiple entities in set B.
What is total participation in ER diagrams?
Total participation means that every entity in the set must participate in at least one relationship in the relationship set.
What is partial participation in ER diagrams
Partial participation means that some entities in the set may not participate in the relationship set.
What is a primary key for an entity set?
A primary key for an entity set is a set of attributes that uniquely identifies each entity in that set.
What is a weak entity set
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.
How are composite attributes represented in an ER diagram?
Composite attributes are flattened by creating separate attributes for each component (e.g., an address could be split into street, city, and zip).
How are multivalued attributes represented in an ER diagram?
Multivalued attributes are represented by creating a separate schema for the attribute.
What is an ER diagram used for
An ER diagram is used to visually represent the logical structure of a database, including entities, relationships, and their attributes.
What is PostgreSQL
PostgreSQL is an open-source, object-relational database system that extends SQL with advanced features.
What does PostgreSQL support
PostgreSQL supports advanced data types, ACID compliance, and full-text search, making it a powerful tool for database management.
What is the importance of installation in PostgreSQL
Installing PostgreSQL sets up the database system on your machine, allowing you to create databases and execute SQL queries.