Database SQL Flashcards
(113 cards)
What is a database?
~a structured collection of records or data which are logically related
What is a Database Management System?
- is computer software designed for the purpose of managing databases
- typical examples of DBMSs include Oracle, Ms SQL Server and MySQL
What is a Relational Database Management System (RDBMS)?
~is a database management system (DBMS) that is based on the relational model
What is the standard language for interacting with an RDBMS?
Structured Query Language (SQL)
Give some background on SQL Server. (4)
- owned by Microsoft Corp
- first version released in 1988
- Microsoft’s philosophy of combining a high performance database with an easy-to-use interface proved to be very successful
- one of the most popular high-end relational database softwares
List the components of a relational database? (6)
Table
Row
Column
Field
Primary Key
Foreign Key
What is a table with regards to a relational database? (3)
- a basic storage structure of an RDBMS and consists of columns and rows
- represents an entity
- e.g. the employee table stores information about the employees of an organization
What is a row with regards to a relational database? (3)
- a combination of column values in a table
- identified by a primary key -also known as records
What is a column with regards to a relational database?
- a collection of one type of data in a table
- represent the attributes of an object
What is a field with regards to a relational database? (3)
- an intersection of a row and a column
- contains one data value
- there is no data in the field, the field is said to contain a NULL value
What is a primary key? (3)
- a column or a combination of columns that is used to uniquely identify each row (occurrence) in a table
- must contain a value
- cannot contain a NULL value
What is a foreign key?
- a column or set of columns that refers to a primary key in the same table or another table
- must either match a primary key or else be NULL
Give the properties of a relational database. (5)
- column values are of the same kind
- each row is unique
- the sequence of columns is insignificant
- the sequence of rows is insignificant
- each column must have a unique name
What is an ERD?
- Entity Relationship Diagram
- a design tool that graphically represents the logical relationships of entities (or objects) in order to create a database
What are the properties of an ERD?
- DBMS independent
- has many variants
- is composed of entities, attributes, and relationships
What is an entity of an ERD? (4)
- any object in the system that we want to model and store information about
- individual objects are called entities
- will become a Table in the database
- represented by rectangles (either with round or square corners)
What are ERD attributes? (3)
- property of an entity
- all data relating to an entity is held in its attributes
- appear inside ovals and are attached to their entity
How are primary keys identified in an ERD?
They are underlined.
What is a composite key?
~a key that consists of two or more attributes
What is a foreign key in an ERD and how is it represented?
- is an attribute (or group of attributes) that is the primary key to another relation
- usually shown in italics or with a wiggly underline
What is a relationship in an ERD and how is it shown?
- an association of entities
- represented on the ER diagram by a series of lines
What is cardinality?
Indicates the maximum number of relationships between the entities, therefore “many” can be explained as “one or many” or sometimes “zero, one, or many”.
What types of relationships exists in an ERD?
1 : 1 one to one relationship
1 : M one to many relationship
M : M many to many relationship
What are the steps to creating an ERD? (10)
- Identify Entities
- Find Relationships
- Draw Rough ERD
- Fill in Cardinality
- Define Primary Keys
- Draw Key-Based ERD
- Identify Attributes
- Map Attributes
- Draw fully attributed ERD
- Check Results



