Theoretical Flashcards
(42 cards)
SQL language basis
Relational model for querying and managing data based on ANSI and ISO standards
Imperative vs declarative programming
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.
SQL uses which paradigm
Declarative, that is, to specify, what I want to get not how I want to get something
What are the categories of statements in SQL
Data definition language (DDL), Data manipulation language (DML), and data control language (DCL)
DDL
Object definition- create, alter, drop.
DML
Data manipulation language- select, insert, delete, update, truncate, and merge
DCL
Data control language, Grant and revoke
T-sql subset or superset?
Both, hahaha
Set theory
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.
Set definition
Set and set definitions ‘ are
Not supported by proofs/ they are axioms
Whole
A set should be considered a single entity . Collection of objects as opposed to an individual object.
Distinct
Every element of a set must be unique, to have key in a row
“Our perception of one thought”
Definition of a set is subjective
Object
Abstract objects
No mention of order
Older is not important
Set of tuples
Rows in SQL
Predicate logic
Dr. Edgar F. Codd
Managements querying of data
A predicate
A property, or an expression that either holds or doesn’t hold true I false. Predicates as parameterized propositions.
The relational model
A semantic model day for - management and manipulation that is based on set theory and predicate logic
Relational model
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
Goals of an RDBMS
An RDBMS is supposed to implement the relational model and provide the means to store, manage, enforce the integrity of, and query data.
What does a relational model
The relational model involves concepts such as propositions, predicates, relations, tuples, attributes, and more
Propositions, predicates & relations
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).
First version of the relational model (Codd,1969, IBM)
“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,”