What is Data?
Data is information converted into binary digital form.
A bit is the smallest unit of data.
Data can be stored in file formats.
Data is represented as video,images, sounds,text etc.
What is Database?
A database is an organized collection of data.
Allows data to be easily accessed, manipulated and updated.
A method of sorting,managing and retriving information.
Modern databases are managed using a database management system (DBMS)
RDMS
RDBMS is a type of DBMS.
Mainitain the security, accuracy, integrity and consistency.
CRUD
Provide data dictionaries and metadata collections
Data storage management
Structured Query Language(SQL)
Normalization
Process of organizing a database.
Reduce redundancy
Improve data integrity
Simplify database design.
Data in tables and columns
Only related data
Benefits of Normalization
Minimize data redundancy
Minimize null values
Minimize data modification issues
Simplify queries
Cleaner and easier to understand
Speed ,accuracy, and efficiency of the database.
Levels of Normaliation - 1
UNF(Unnormalized Form)
A database is in UNF if it has not been normalized at all.
1NF(First Normal Form)
A releation(table) is in 1NF if (and only if) the domain of each attribute contains only atomic(indivisible) values, and the value of each attribute contains only a single value from that domain.
Levels of Normaliation - 2
2NF(Second Normal Form)
A relation is in 2NF if it is in 1NF and every non-prime attribute of the relation is dependent on the whole of every candidate key.
3NF(Third Normal Form)
A relation is in 3NF if it is in 2NF and every non-prime attribute of the relation is non-transitively dependent on every key of the relation.
Who Needs a Database User
DBA(Database Administrators)
Security Officers
Network Administrator
Application Developers
Application Adminitrators
Users of Application
Responsibilites of DBA
- Install and upgrade
- Allocating system storage
- Creating primary database storage structures
- Creating primary database objects
- Modifying the database structure
- System security
- Backup and Recovery
- User access to the database
Database Objects(Tables)
Attribute/Column
A tupple /Record/ Row
Database Objects(Constraints)
- Not null constraint
- Unique constraint
- Primary key constraint
- Foreigin key constraint
- Check constraint
- REF constraint
Database Objects(Data Types)
Database Objects(Index)
Data structure defined on columns
Speed up data retrieval operations
Small copy of a database table sorted by key values.
Privileges
System privileges
Object privileges
Privilege hierarchy
The PUBLIC role
Summary
Data
Database
RDMS
Normalization
Database User
Database Objects
Privileges
What is DDL ?
Define the database
Specify data types,structures and constraints
CREATE,ALTER and DROP
Implicitly COMMIT
Connect to Database