Professor Materials Week 3 Flashcards

1
Q

What are the elements of ER Models?

A

Entity
Attribute
Relationship

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an entity class?

A

Something the user wants to track.
Typically nouns.
Represented by a rectangle with a singular name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an entity instance?

A

The actual occurrence of the data
Usually never shown

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an attribute?

A

data item that is used to describe an entity.
show by ovals and connected to the entity rectangle with a line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Simple vs Composite attributes

A

Simple – composed of one piece of data
composite – an attribute composed of other attributes (like an address)
Not shown in crow’s foot notation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Single vs mutli-valued attr

A

Single – one single piece of value
Multi (double circle) – an attribute that stores multiple data values (skills = carpentry, plumbing, painting)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Store vs derived attr

A

Stored – actually stored
Derived – the data value is calculated (dotted circle) age (calc by DOB)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is identifier?

A

Most entities will have one
One or more attributes that identify an entity instance
If two or more, composite identifier

Can be unique or non-unique

Denoted by underline in Chen Notation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the steps to transposing data mdoel into relations?

A

Transposing:
1. Name of hte entity becmes the name of the relation
2. Attributes become the attributes of the relation
3. The identifier of the entity becomes the proposed primary key of the relation, denoted by underlining

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Relational Schema notation?

A

RELATION(attr(underlined), attr2, att3)
A(2,3(both 2 and 3 underlined), 4,5)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is 1NF?

A

First normal form.
* Rows contain data about tuples or instances of the relation
* Cells of the relation hold a single value (no arrays)
* Columns are attributes of the relation
* All entries in a column are of the same domain (physical and logical)
* EAch column has a unique name
* The order of the attr is unimportant
* The orer of the tuples is unimportant
* No two tuples may be identical (must have primary key can be either) – natural primary key vs surrogate primary key (used only to guarantee uniqueness)
* No repeating groups – more than one attr from the same physical and logical domain (ex author1, author1email, author2, author2email)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you create a relational schema with DMBS?

A

Using SQL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Data Definition Language DDL

A

Primarily metadata, CREATE DROP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Data Manipulation Language DML

A

User data, INSERT, SELECT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Transaction Control Language TCL

A

Commit, rollback. Data Control Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Commands to create a database

A

CREATE DATABASE databaseName;

17
Q

Command to remove a databse

A

DROP DATABASE databaseName;
DROP DATABASE IF EXISTS databaseName;

18
Q

How do you open a database

A

USE databaseName;

19
Q

Attribute data types

A

CHAR(size) – fixed length
VARCHAR(size) – var length
Numeric – INT or INTEGER
Date - DATE

20
Q

What is a constraint?

A

a rule limiting the values allowed, primary key is an example

21
Q

How do you add to table?

A

INSERT INTO tableName
(fieldlist) VALUES (valuelist);

22
Q
A