2. What is DBMS?
Database is a collection of interrelated data which helps in the efficient retrieval,
insertion, and deletion of data from the database and organizes the data in the
form of tables, views, schemas, reports, etc. For Example, a university database
organizes the data about students, faculty, admin staff, etc. which helps in the
efficient retrieval, insertion, and deletion of data from it.
3. Advantages of DBMS
• Controlling Data Redundancy: Data is recorded in only one
place in the database and it is not duplicated
• Data consistency: Data item appears only once, and the
updated value is immediately available to all users.
• Control over concurrency: In a computer file-based system
in updating, one may overwrite the values recorded by the
order.
• Backup and Recovery procedures: Automatically create
the backup of data and restore data if required.
• Data independence: Separation of data structure of
database from application program that uses the data is
called data independence.
4. Various sql commands
• Structure Query Language(SQL) is database query language used for sorting and
managing data in relation DBMS. SQL was the first commercial language
introduced for E.F codd’s relation model of database.
• Types of SQL statements-
1. DML (data manipulation language)
2. DDL (data definition language)
3. DCL (data control language)
4. TCL (transaction control language)
5. Key constraints
• Constraints ensure that entered by the user into columns must be within the
criteria specified by the condition
• For example, if you want to maintain only unique IDs in the employee table or
if you want to enter only age under 18 in the student table etc.
• We have 6 types of key constraints in DBMS
o Not null: ensures that the specified column doesn’t contain a NULL value.
o Unique: provides a unique values to specified columns.
o Default: provides a default values to a column if none is specified.
o Check: checks for the predefined conditions before inserting the data inside
the table.
o Primary key: it uniquely identifies a row in a table.
o Foreign key: ensures referential integrity of the relationship.