LATEST UPDATE (ALREADY GRADED A+)
First normal form (1NF)
Table format, no repeating groups, and PK identified
Second normal form (2NF)
1NF and no partial dependencies
Third normal form (3NF)
2NF and no transitive dependencies
Functional dependence
Attribute A determines attribute B (that is, B is functionally dependent on A) if all (generalized definition)
of the rows in the table that agree in value for attribute A also agree in value for attribute B.
Fully functional dependence
If attribute B is functionally dependent on a composite key A but not on any subset of that composite
key, the attribute B is fully functionally dependent on A.
Partial dependency
functional dependence in which the determinant is only part of the primary key
• Assumption: one candidate key
• Straight forward
• Easy to identify
Transitive dependency
attribute is dependent on another attribute that is not part of the primary key
• More difficult to identify among a set of data
• Occur only when a functional dependence exists among nonprime attributes
Data definition language (DDL)
The language that allows a database administrator to define the database structure, schema, and
subschema.
Data manipulation language (DML)
, DBMS language that changes database content, including data element creations, updates, insertions,
and deletions
CREATE DATABASE
The CREATE DATABASE statement is used to create a database.
CREATE DATABASE dbname;
CREATE TABLE
A SQL command that creates a table's structures using the characteristics and attributes given.
CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... columnN
datatype, PRIMARY KEY( one or more columns ) );
ALTER TABLE
The SQL command used to make changes to table structure. When the command is followed by a
keyword (ADD or MODIFY), it adds a column or changes column characteristics.
ALTER TABLE CustomersADD Email varchar(255);
ALTER TABLE CustomersDROP COLUMN Email;
DROP TABLE
Removes a table from your database
DROP TABLE Shippers;
INSERT
statement is used to insert new records in a table.
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
UPDATE
statement is used to modify the existing records in a table.
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
DELETE
statement is used to delete existing records in a table.
DELETE FROM table_name WHERE condition;