Data Definition Language ( DDL )
DDL allows the DBA ( Database administrator ) or users to describe and name entities, attributes, and relationships required for the application plus any associated integrity and security constraints.
Database constraints are a key feature of database management systems. They ensure that rules defined at data model creation are enforced when the data is manipulated ( inserted, updated, or deleted) in a database.
Constraints allow us to rely on the database to ensure integrity, accuracy, and reliability of the data stored in it. They are different from validations or controls we define at application or presentation layers; nor do they depend on the experience or knowledge of the users interacting with the system.
The constraints used popularly are: NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, DEFAULT, CREATE INDEX.
Data Manipulation Language ( DML )
DML provides basic data manipulation operations ( SELECT, INSERT, UPDATE, DELETE, ... ) on data held in the database.
Data Control Language ( DCL )
DCL defines activities that are not in the categories of those for the DDL and DML, such as granting privileges to users, and defining when proposed changes to a databases should be irrevocably made.
Entity Relationship
Entity Relationship Model
- Popular high-level conceptual data model
- A logical organization of data within a database system
- ER model describes data as:
- Entities
- Attributes
- Simple attribute has a single atomic value
- Composite attribute may be composed of several components
- Multi-valued attribute has multiple values
- Derived attribute has a value that is derivable from values of related attributes
- Complex attribute is a combination of composite and multivalued attributes
- Relationships
- One to one
- One to many or many to one
- Many to many
Constraints allow us to rely on the database to ensure integrity, accuracy, and reliability of the data stored in it ? What it mean about rely on the database, you can explain more about this ?