My Addition Flashcards
In refernce of ALTER TABLE statements
What is the syntax for ADD
ALTER TABLE TableName ADD ColumnName DataType;
In refernce of ALTER TABLE statements
What is the syntax for CHANGE
ALTER TABLE TableName CHANGE CurrentColumnName NewColumnName NewDataType;
In refernce of ALTER TABLE statements
What is the syntax for DROP
ALTER TABLE TableName DROP ColumnName;
What is the definition of tables in relational databases?
Tables are the core structure in relational databases containing a fixed sequence of columns and a varying set of rows.
Each column has a name and a specific data type, while each row consists of values that correspond to the column’s data types.
What are the components of a table?
A table must have at least one column and can have multiple rows, but it can also be empty (having no rows).
Each column has a name and a specific data type.
How do databases handle duplicate rows?
Some databases may allow duplicate rows temporarily, particularly when loading external data into a temporary table.
What SQL statement is used to define a new table?
CREATE TABLE
This statement specifies table names and data types.
What does the DROP TABLE statement do?
Deletes a table and all its data.
What is the purpose of the ALTER TABLE statement?
Used to modify an existing table by adding, changing, or deleting columns.
List common data types used in tables.
- integers (INT)
- values with 0 to N characters (VARCHAR(N))
- dates (DATE)
- decimals (DECIMAL)
What rule governs the values in a cell of a table?
Exactly one value per cell.
Are duplicate column names allowed in a table?
No duplicate column names are allowed within the same table but are allowed in different tables.
What principle allows for optimization of storage in tables?
No significant row order, supporting the principle of data independence.
What does it mean that there can be no duplicate rows in a table?
No two rows in a table may have identical values across all columns.
What is a NULL value in a table?
Represents the absence of data in a cell.