Fundamentals of Databases Flashcards
What is a data model?
A data model is an abstract model that determines what things to store in a database and what information should be recorded about them.
What are entities and attributes in database design?
In database design, an entity is a thing about which data is stored, such as a customer. Attributes are characteristics or information about entities, like the customer’s name or address.
How are entities and their attributes stored in a database table?
Entities are stored as rows in a table, and the fields of each row hold the attributes of the entity.
What is an entity identifier?
An entity identifier is a unique attribute given to each entity in a table, typically used as a primary key to ensure uniqueness.
What is the primary key?
Customer (CustomerID, CustomerName, CustomerAddress, CustomerEmail)
CustomerID
What is an entity description?
An entity description is used to describe how information about an entity is stored in a database table. It lists the entity’s attributes, with the entity identifier typically underlined.
What are the three degrees of relationship between tables in a database?
The three degrees of relationship are one-to-one, one-to-many, and many-to-many.
What are primary and foreign keys in a database?
A primary key is an attribute that uniquely identifies an entity in a table. A foreign key is an attribute in one table that references the primary key of another table.
What is database normalization?
Database normalization is the process of organizing a database to eliminate redundancy and improve data integrity. It involves removing repeating or duplicated data.
What are the three levels of database normalization?
The three levels of normalization are first normal form (1NF), second normal form (2NF), and third normal form (3NF).
What are the main SQL commands?
The main SQL commands are SELECT, UPDATE, INSERT, and DELETE
What is the SELECT command used for in SQL?
The SELECT command is used to retrieve data from a database table based on specified condition
What is the UPDATE command used for in SQL?
The UPDATE command is used to modify the attributes of existing entities in a database table.
What is the DELETE command used for in SQL?
The DELETE command is used to remove entities from a database table based on specified conditions.
What is the INSERT command used for in SQL?
The INSERT command is used to add new records (entities) to an existing database table
What are wildcards in SQL?
Wildcards are used in SQL commands to specify any possible value. They are usually denoted with an asterisk (*) and can be used to select all attributes or entities.
What is the CREATE command used for in SQL?
The CREATE command is used to create a new database table with specified attributes and data types.
What are SQL data types?
Fixed-length string: CHAR(size)
Variable-length string: VARCHAR(size)
Integer: INT(size)
Number with fractional part: FLOAT(size, precision)
Date: DATE
What is the requirement for a database to conform to the first normal form (1NF)?
A database in 1NF contains no repeating attributes, and its data is atomic (no single column contains more than one value).
What does a database need to satisfy to meet the second normal form (2NF)?
To meet 2NF, a database must satisfy 1NF and remove partial key dependencies.
What is a partial key dependency?
A partial key dependency occurs in databases with composite primary keys when a non-key attribute depends on only a portion of the composite key.
What additional requirement does a database need to meet to achieve third normal form (3NF)?
In addition to 2NF, a database in 3NF must have no non-key dependencies.