Theoretical Flashcards

1
Q

SQL language basis

A

Relational model for querying and managing data based on ANSI and ISO standards

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

Imperative vs declarative programming

A

The easiest way to explain the difference between declarative and imperative code, would be that imperative code focuses on writing an explicit sequence of commands to describe how you want the computer to do things, and declarative code focuses on specifying the result of what you want.

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

SQL uses which paradigm

A

Declarative, that is, to specify, what I want to get not how I want to get something

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

What are the categories of statements in SQL

A

Data definition language (DDL), Data manipulation language (DML), and data control language (DCL)

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

DDL

A

Object definition- create, alter, drop.

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

DML

A

Data manipulation language- select, insert, delete, update, truncate, and merge

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

DCL

A

Data control language, Grant and revoke

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

T-sql subset or superset?

A

Both, hahaha

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

Set theory

A

Georg cantor, By a “set” we mean any collection M into a whole of definite, distinct objects m (which are called the “elements” of M) of our perception or of our thought.

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

Set definition

A

Set and set definitions ‘ are
Not supported by proofs/ they are axioms

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

Whole

A

A set should be considered a single entity . Collection of objects as opposed to an individual object.

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

Distinct

A

Every element of a set must be unique, to have key in a row

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

“Our perception of one thought”

A

Definition of a set is subjective

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

Object

A

Abstract objects

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

No mention of order

A

Older is not important

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

Set of tuples

A

Rows in SQL

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

Predicate logic

A

Dr. Edgar F. Codd
Managements querying of data

18
Q

A predicate

A

A property, or an expression that either holds or doesn’t hold true I false. Predicates as parameterized propositions.

19
Q

The relational model

A

A semantic model day for - management and manipulation that is based on set theory and predicate logic

20
Q

Relational model

A

The goal of the relational model is to enable consistent representation of data with minimal or no redundancy and without sacrificing completeness, and to define data integrity (enforcement of data consistency) as part of the model

21
Q

Goals of an RDBMS

A

An RDBMS is supposed to implement the relational model and provide the means to store, manage, enforce the integrity of, and query data.

22
Q

What does a relational model

A

The relational model involves concepts such as propositions, predicates, relations, tuples, attributes, and more

23
Q

Propositions, predicates & relations

A

A key point in the relational model is that a single relation should represent a single set (for example, Customers). Note that operations on relations (based on relational algebra) result in a relation (for example, a join between two relations).

24
Q

First version of the relational model (Codd,1969, IBM)

A

“Derivability, Redundancy, and Consistency of Relations Stored in Large Data Banks.” A revised version was proposed by Codd in 1970 in a paper called “A Relational Model of Data for Large Shared Data Banks,”

25
Q

What are the goals of a relational model ?

A

The goal of the relational model is to enable consistent representation of data with minimal or no redundancy and without sacrificing completeness, and to define data integrity (enforcement of data consistency) as part of the model. An RDBMS is supposed to implement the relational model and provide the means to store, manage, enforce the integrity of, and query data.

26
Q

Propositions, predicates and relations

“Relational” true meaning

A

“Relational” actually pertains to the mathematical term relation. In set theory, a relation is a representation of a set. In the relational model, a relation is a set of related information, with the counterpart in SQL being a table—albeit not an exact counterpart. A key point in the relational model is that a single relation should represent a single set (for example, Customers). Note that operations on relations (based on relational algebra) result in a relation (for example, a join between two relations).

27
Q

Proposition

A

A proposition is an assertion or a statement that must be true or false.

28
Q

Closed-world assumption

A

If a proposition is true, it will manifest itself as a row in a table of Employees. A false proposition simply won’t manifest itself.

29
Q

A type (predicate)

A

A type is one of the most fundamental building blocks for relations. A type constrains an attribute to a certain set of possible or valid values.

30
Q

Missing values

A

True, False, Unknown (NULL)

Null marker

31
Q

Constraints

A

Data integrity is achieved through rules called constraints that are defined in the data model and enforced by the RDBMS. The simplest methods of enforcing integrity are assigning an attribute type with its attendant “nullability” (whether it supports or doesn’t support NULLs). Constraints include candidate keys, which provide entity integrity, and foreign keys, which provide referential integrity

32
Q

Candidate key

A

A candidate key is a key defined on one or more attributes that prevents more than one occurrence of the same tuple (row in SQL) in a relation.

A predicate based on a candidate key can uniquely identify a row (such a

33
Q

Foreign key

A

Foreign keys are used to enforce referential integrity. A foreign key is defined on one or more attributes of a relation (known as the referencing relation) and references a candidate key in another (or possibly the same) relation.

34
Q

Normalization

A

The relational model defines normalization rules (also known as normal forms). Normalization is a formal mathematical process to guarantee that each entity will be represented by a single relation.

35
Q

ERM

Entity relationship modelling

A

https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model

36
Q

1NF

A

The first normal form says that the tuples (rows) in the relation (table) must be unique and attributes should be atomic. This is a redundant definition of a relation; in other words, if a table truly represents a relation, it is already in first normal form.

37
Q

3NF

A
  1. The data must meet the second normal form,
  2. All monkey attributes must be dependent on candidate Keys nontransitively
    That is, all non key attributes must be mutually independent
38
Q

2NF

A
  1. Data must meet the 1 nf
  2. The relationship between non- key and candidate key. For every candidate key, every non-key alleibute has to be fully functionally dependent on the entire candidate key.in other words.
39
Q

Two main types of systems, or workloads, use SQL server as their database . Uses t-sol to manage and manipulate the data

A

Online transactional processing (OLTP) and data warehouse (DWs)

40
Q

Entity relationship model [ definition]

A

Describes inter-related things of interest in a specific domain of knowledge,. In software engineering, used to represent things a business needs to perform business processes. - it is also used as an abstract data model, that defines a data or information structure which can be implemented in a database typically a relational database.

41
Q

Classes of database systems.

A

OLTP: online transactional processing

DSA: data-staging area

DW: data warehouse

ETL: extract, transform, and load

42
Q

ERM - schema

A