Introduction to Relational Model Flashcards
What are various attribute types in the Relational Model?
- char(n). Fixed length character string, with user-specified length n
- varchar(n). Variable length character strings, with user-specified maximum length n
- int. Integer (a finite subset of the integers that is machine-dependent)
- smallint(n). Small integer (a machine-dependent subset of the integer domain type)
- numeric(p, d). Fixed point number, with user-specified precision of p digits, with d
digits to the right of decimal point. (ex., numeric(3, 1), allows 44.5 to be stores
exactly, but not 444.5 or 0.32) - real, double precision. Floating point and double-precision floating point numbers,
with machine-dependent precision - float(n). Floating point number, with user-specified precision of at least n digits
What is a Super Key?
What is a Candidate Key?
What is a Primary Key?
What is a Surrogate Key?
What is a Composite Key?
What is a Secondary Key?
What is a Foreign Key?
What is a Compound Key?
What is Procedural Programming? vs Declarative Programming?
What is the domain of an attribute?
What are atomic attributes?
What is “Select” Relational Operation ?
What is “Project” Relational Operation ?
What is “Union” Relational Operation ?
What is “Difference” Relational Operation ?
What is “Intersection” Relational Operation ?
What is “Cartesian Product” Relational Operation ?
What is “Natural Join” Relational Operation ?
What are aggregate operations?
◦ SUM
◦ AVG
◦ MAX
◦ MIN
What are the basic properties of relations?
Relation is a set, so, no ordering, no duplicates.
What is a composition of relational operations?
How to create a table in SQL?
create table instructor (
ID char(5),
name varchar(20)
dept name varchar(20)
salary numeric(8, 2));