Unique Identifier in a Database
Explore the Flashcards:
A value that uniquely identifies a record in a database table.
Relationships in Databases
Connections between tables in a database, typically defined by keys.
A One-to-many (Many-to-one) Relationship
A type of relationship in a database where a record in one table can be associated with one or more records in another table.
Many-to-one is the reverse of one-to-many.
A One-to-one Relationship
A type of relationship in a database where one record in a table is associated with one and only one record in another table.
A Many-to-many Relationship
A type of relationship in a database where multiple records in one table can be associated with multiple records in another table and vice versa.
Cardinality Constraints
Restrictions that define the number of instances that one entity can be associated with another entity in a relationship.
Primary Key
A column (or set of columns) in a table that uniquely identifies each row.
Foreign Key
A column (or set of columns) in a table whose values match the values of a column (or a set of columns) in another table from the database.
Unique Key
A field attribute ensuring no duplicate values within a column. Different from the primary key, a unique key can store a null value, but only one. A table can have multiple unique keys while it can have only one primary key. Unique keys allow modification and deletion of data, unlike primary keys.
Composite Key
A key that consists of two or more fields that are used together to uniquely identify a record in a table.
Null Value in Primary Key
A state that is not allowed in a primary key column, as primary keys must have a unique and non-null value for each row.
Base Tables
Tables in a database that physically store data, as opposed to views or derived tables which only refer to data physically stored in the base tables.
Child Table
A table in a database that has a foreign key referencing the primary key of another table.
Parent Table
A table in a database referenced by the foreign key in another table.
Referencing Table
A table in a database that includes a foreign key pointing to uniquely identified rows in another table.
Referenced Table
A table in a database containing uniquely identified rows to which another table's foreign key points.
Storage
The physical or virtual space used by a database to save data, with various mechanisms
in place to optimize performance and ensure data integrity.
Storage Size
The amount of disk space that a database object or an entire database occupies in SQL.
Precision
The number of digits in a number.
Scale
The number of digits to the right of the decimal point in a number.
Triggers
Database objects that automatically execute a predefined action when а certain data modification operation occurs.
BEFORE Trigger
A database trigger that executes before one or more specified data modification operations occur.
AFTER Trigger
A database trigger that executes after a specified data modification operation.
Query
A request for data from a database table or combination of tables. Information from the database can be retrieved and sorted in a variety of ways by writing the relevant queries.
Subquery (or nested query)
A query nested within another SQL query.
Query Optimization
The process of modifying a query to improve its efficiency and performance expressed in terms
of augmented speed of data retrieval and reduced resource consumption.
Query efficiency
A performance measure of a SQL query regarding speed and resource utilization.
Partitioning
Database partitioning (or data partitioning) is a database technique to divide a subset of the database data into separate chunks (or namely - partitions), that are yet being treated as a single data table. The idea behind using data partitions is that they can be stored, accessed, or managed one by one.
Variable
A placeholder used in programming and databases to store a value that can change
during the execution of a program or query.
Local Variables
Variables declared within a stored routine in SQL, accessible only within that routine.
Session Variables
Variables that are defined by the user and that can be accessed during a single session in a database.
Global Variables
Variables in a database that are accessible throughout the entirety of the server (i.e. that are available and maintained across different sessions).
DECLARE
Keyword used for creating local variables in MySQL.
SET Statement
A statement used for creating Session Variables in MySQL
Statement Terminator (in SQL)
A character or sequence of characters that indicate the end of an SQL statement.
Alphanumeric Data Types
Data types in SQL that can store both letters (alphabets) and numbers, but no other characters (such as punctuation marks or other symbols, for instance).
String
A sequence of characters used in programming and databases to represent text rather than numbers.
Length
In databases, "length" refers to the number of characters contained in a string.
Bytes
A unit of digital information in computing and telecommunications.
CHAR
A fixed-length character data type in SQL.
VARCHAR
A variable-length character data type in SQL.
ENUM
An SQL data type consisting of a set of named VALUES (NULL,ref. "enumeration").
Fixed-Storage Data Type
A data type in SQL having a fixed-space allocation.
Numeric Data Types
SQL data types representing numeric values.
Integer (INT)
An SQL data type for storing whole numbers.
TINYINT
An SQL data type for integers ranging from -128 to 127 inclusive.
SMALLINT
An SQL data type for small-range integers (i.e. integers ranging from -32,767 to 32,767 inclusive).
MEDIUMINT
An SQL data type for medium-range integers (i.e. integers ranging from -8388608 to 8388607 inclusive).
BIGINT
An SQL data type for large-range integers (i.e. integers ranging from approx. -9 to 9 quintillion).
Fixed-point Data Types
A numeric SQL data type with fixed decimal points.
DOUBLE
An SQL data type used for storing precise numeric values with floating point precision.
It can hold both very large and very small values.
DECIMAL
An SQL data type for fixed-point numbers.
DATE
An SQL data type for storing date and time as a number.
DATETIME
An SQL data type for storing dates only.
UNIX_TIMESTAMP()
An SQL data type for storing both dates and time.
BLOB (Binary Large Object)
An SQL data type for storing both date and time.
Boolean Value
A value for storing date and time as a number.
Constraints
A value that is either TRUE, FALSE, or NULL.
NOT NULL
A constraint ensuring that a column cannot have a NULL value.
Unique Constraint
A constraint ensuring that all values in a column are the same.
DEFAULT Constraint
Sets a default value for a row even when a value is specified.
Auto-increment
A property used in SQL to automatically generate a unique value for a column,
typically a primary key, with each new record insertion.
Keywords in SQL
Reserved words in SQL used to perform operations and define the structure of SQL commands.
Reserved Words
Words in SQL that don’t have a specific meaning and function, and can be used as identifiers like table or column names.
Reserved Words
Words in SQL that don’t have a specific meaning and function, and can be used as identifiers like table or column names.
Reserved Words
Words in SQL that have a specific meaning and function, and cannot be used as identifiers like table or column names.
Primary Key vs. Unique Key
SQL Data Types
Signed vs. Unsigned Values
In SQL, signed values can be positive or negative, whereas unsigned values can only be positive.
Keys vs. Constraint (SQL)
In the context of SQL, "keys" refer to creating relationships between separate tables or views within a database. "Constraints" refer to specifying the rules for the data in a given table.
Foreign Key Constraint