Terms and Definition Flashcards
(33 cards)
What does it mean atomic data
in the database? (атомарные данные)
Atomic data is information that can’t be broken down into smaller parts.
Иными словами, это такие данные, разделение которых на составляющие приводит к потере их смысла с точки зрения решаемой задачи. Например, если атрибут «Цена» содержит значение 15, то попытка разделить его на 1 и 5 приведет к полной бессмыслице.
What does it mean normalized db
?
It’s a db without data duplication.
What does it mean the first normal form (1NF)?
1) Fields should be atomic
2) The table should include primary_key
What is CROSS JOIN?
Will create a new table each row with each row.
In SQL, the CROSS JOIN is used to combine each row of the first table with each row of the second table.
What is INNER JOIN?
The same as CROSS JOIN but with some conditions. It doesn’t take all values from the table but only values for which condition is true.
Inner Join clause in SQL Server creates a new table (not physical) by combining rows that have matching values in two or more tables. This join is based on a logical relationship (or a common field) between the tables and is used to retrieve data that appears in both tables.
What is NATURAL JOIN?
The same as INNER JOIN but we have to use the same column for 2 tables.
A NATURAL JOIN is a JOIN operation that creates an implicit join clause for you based on the common columns of the two tables that are being joined. Common columns are columns that have the same name in both the tables
What is SQL Correlated Subqueries?
When queries need data from outer query.
SQL Correlated Subqueries are used to select data from a table referenced in the outer query. The subquery is known as a correlated because the subquery is related to the outer query
What is Uncorrelated Sub-query?
An uncorrelated sub-query is a type of sub-query where inner query doesn’t depend upon the outer query for its execution. It can complete its execution as a standalone query.
What is LEFT OUTER JOIN?
The LEFT OUTER JOIN keyword returns all records from the left table (table1), and the matched records from the right table (table2). If there is no match from the right side then return NULL instead of the right value.
What is the difference between LEFT JOIN and INNER JOIN?
INNER JOIN does not return a row if condition doesn’t pass.
LEFT JOIN returns left row and NULL if the condition doesn’t pass
What is RIGHT OUTER JOIN?
The RIGHT JOIN keyword returns all records from the right table (table2), and the matched records from the left table (table1). The result is NULL from the left side, when there is no match.
What “Relational Database” means?
This is a database that stores data in tables ( fields and records).
You retrieve data by using SQL.
What is normalization?
Normalization is the process of decomposing large tables into smaller ones in order to eliminate redundant data and duplicate data.
What is the primary key?
Primary key - uniquely identifies records.
What is view?
A view is a “virtual” table composed of fields from one or more tables in the database; ( JOIN )
What is composite primary key?
Primary key composed of two or more fields is known as a composite primary key.
What is the foreign key?
You have 2 tables. The name “foreign key” is derived from the fact that the second table already has a
primary key of its own, and the primary key you are introducing from the first table is “foreign” to the second table.
The values of a foreign key must match existing values of the primary key to which it refers. ( If you remove record with primary key from they first table the record from the second table with foreign key will be broken)
What table types do you know ( to store something )?
- data ( to store data or events)
- linking ( to store association between tables )
- validation ( to store all countries for example )
What multipart field means?
A field that contains more than one entity. For example Address ( Belarus, Minsk, Street home )
What multivalue field means?
Multivalued field can potentially store two or more occurrences of the same value. ( for example category with values - AG, BF, CD - many via coma )
What ‘code smells’ can break your database design?
- One table represent characteristic for several subjects ( For example table that contains Company and Employee together )
- Multipart fields ( For example Address ( Belarus, Minsk, Street home ) )
- Multivalue fields ( for example category with values - AG, BF, CD - many via coma )
- Contains calculated or concatenated values
- It is not unique within the entire database structure (denormalized)
What is a candidate key?
This is a more common name for primary key. We can create more than one candidate key on the table.
What conditions should be present for primary/candidate key?
- It must contain unique values.
- It cannot contain null values.
- Its value cannot cause a breach of the organization’s security or privacy rules.
- It includes a minimum number of fields necessary to define uniqueness.
- Its value can be modified only in rare or extreme cases.
What is artificial ( surrogate) candidate key?
When your table doesn’t have any candidate key you can add a new field just for this purpose.