5.6 ERDs and Query Flashcards
A relational database is a collection of interrelated two-dimensional tables, consisting of rows and columns. Each row represents a record, and each column (or field) represents an attribute (or characteristic) of that record.
word
Every record in the database must contain at least one field that uniquely identifies that record so that it can be retrieved, updated, and sorted.
worddd
what is the identifier field called
primary key
when can related tables (Erds) be joined
when they contain common columns
how do you find info in a database?
use a query language (SQL or QBE)S
SQL example
Typical key words are SELECT (to choose a desired attribute), FROM (to specify the table or tables to be used), and WHERE (to specify conditions to apply in the query).
How does QBE work
user fills out a form to construct a samplle of data desired!! then use drag and drop
how to make erd
1) identify the business rules (how does the business operate? what is the info)
2) label the PK
3) find relevant attributes
4) connect to other tables with apporporiate connectivity and cardinality
how to find different attributes of tables
use data dictionary
unary relationship
associaiton with one entityy
binary relationshoip
relationship where two entities are associated
ternary relationship
exist when three entities are assocaited
cardinality
max number of time one entity can be associated with another
cardinality ex: mandatory single
two straight lines
cardinality ex: optional single
circle straight line
cardinality ex: mandatory many
staight line then 3 way fork
cardinality ex: optional manu
circle than many
how to figure out appropraite cardinality
use logic!! can one student have many phone numbers, can one phone number have many students
joint table
result of a many ot many relationship!!!
put a mandatory single on the end connected to erd, and optional many connected to the end associated with joint table
normalization
method for analyzing and reducing a relational database to the most streamlined form to reduce REDUNDANCY, increase integrity, and optimize processing performance!!
Data normalization is a methodology for organizing attributes into tables so that redundancy among the non-key attributes is eliminated. The result of the data normalization process is a properly structured relational database.
this!!
Data normalization requires a list of all the attributes that must be incorporated into the database and a list of all of the defining associations, or functional dependencies, among the attributes. Functional dependencies are a means of expressing that the value of one particular attribute is associated with a specific single value of another attribute. For example, for a Student Number 05345 at a university, there is exactly one Student Name, John C. Jones, associated with it. That is, Student Number is referred to as the determinant because its value determines the value of the other attribute. We can also say that Student Name is functionally dependent on Student Number.
Data normalization requires a list of all the attributes that must be incorporated into the database and a list of all of the defining associations, or functional dependencies, among the attributes. Functional dependencies are a means of expressing that the value of one particular attribute is associated with a specific single value of another attribute. For example, for a Student Number 05345 at a university, there is exactly one Student Name, John C. Jones, associated with it. That is, Student Number is referred to as the determinant because its value determines the value of the other attribute. We can also say that Student Name is functionally dependent on Student Number.
first normal form
-attributes under consideration are listed in one table, and PKs are established
-contians repeating groups and describes multiple entitites
-data redundancy
-lack of data integrity
-uses a flat file
-REPEATING groups!
second normal form
- break first normal form into smaller tables to reduce data redundancy
-does not allow partial functional dependnacies
-EVERY non key attribute must be functionally dependant on the entire pk of the table