Relational Databases Flashcards
Explain Relational Databases
• on of the most popular types of DBMS
• Def: A collective set of multiple sets of data that is carefully organised in tables, records & columns
• Table in a database communicate & share data that makes it possible for effective data search, organisation & reporting
• RDBs use STRUCTURED QUERY LANGUAGE (SQL) which is a STANDARD USER APPLICATION that provides an easy programming interface for data interaction
What does a RDB contain (Structure of a Database)
• A relational database contains tables; these tables are related to each other by the data they contain
• A table is organised by rows & columns. They are the primary form of data storage in a RDB
What is an Entity? (Structure of a Database)
- A group represented by a table/ Each table represents a group called an entity
What does a table contain? (Structure of a Database)
- A table contains RECORDS (a series of fields) & a TUPLE is a record (a single record). These contain ATTRIBUTES which are the field names
Explain What Keys in a RDB do & how they are used. & list the 3 main types of keys
- What they do in a RDB: keys are crucial to table structure. They ensure that each record in a table is uniquely identified
- How they are used: Keys are used to enforce integrity & identity the relationship between the tables
- Three main types of keys:
• Primary Key
• Candidate Key
• Foreign Key
Primary Key
- this is a special RDB table column (or a combination of columns) designed to uniquely identify each record
- A Primary Key:
• Must NOT contain a NULL value
• Must contain a UNIQUE VALUE for each row of data (record) eg. ID column
Candidate Key
- This is a column or a set of columns in a table that can uniquely identify any databases record without referring to any data
Foreign Key
- usually a Primary Key from one table that appears in another table where the first table has a relationship with the second table