Unit - 1 Database Concepts - RDBMS Tools
Unit - 1 Database Concepts - RDBMS Tools
Unit - 1
Database Concepts – RDBMS Tools
Database
Collection of tables is known as database. It is collection of interrelated data.
DBMS
It stands for Data Base Management System. It is an application software which
provides several commands to work on database such as to create, to modify, to
delete the database etc. Example : MS Excel, Foxpro etc.
RDBMS
It stands for Relational Data Base Management System. It has all the features of
DBMS as well as it provides features to work on multiple tables together. Example-
Oracle, MySQL, MS SQL Server etc.
Advantages of DBMS
(i) It reduces data redundancy (duplication of data)
(ii) It reduces data inconsistency (mismatch of data)
(iii) It allows sharing of data.
(iv) It provides high security to data.
(v) It is user friendly.
SQL Constraint
A condition or rules which are applied on field of a table is known as constraint. It
validates entry during entering values in the table. It can be applied during or after
creation of a table. These are the following constraints :
NOT NULL : If we do not want to allow null values in the field then we use NOT
NULL constraint.
SQL>> CREATE TABLE Student(sname VARCHAR(20) NOT NULL, roll INT);
We can not leave blank sname field in Student table.
UNIQUE : It ensures unique entry in the column, but it can be left blank.
SQL>> CREATE TABLE Student(sname VARCHAR(20), roll INT UNIQUE, sec
CHAR(1));
Here sname field of Student table will accept only unique entry but we can leave it
blank.
Referential Integrity
The rules which allow us to ensure relationships between records of related tables
are valid are known as referential integrity. It restricts the accidental deletion or
modification in related data
MySQL
It is the most popular Open Source RDBMS. It was developed, distributed, and
supported by Oracle Corporation. It is easy to use. It is free to download and use. It
supports SQL to work on database. It was developed in Sweden by David Axmark,
Allan Larsson and Michael Widenius in 1908. It was named on the name of Michael
Widenius’s daughter “My”.
SQL
SQL stands for Structured Query Language. It allows us to perform the following :
(i) Creating or modifying database structure
(ii) Changing security settings for system
(iii) Permitting users for working on database or tables
(iv) Query
(v) Inserting, modifying and deleting records etc
Data Types
The concept to specify type of values for entering in a table is known as data types.
MySQL provides the following data types :
Data Type Range Data Type Range
SQL Commands
SHOW DATABASES;
It is used to display list of existing databases of current user.
SQL>> SHOW DATABASES;
USE <databasename>
It is used to open an existing database.
SQL>> USE demo;
SHOW TABLES;
This command is used to display all tables of current database.
SQL>> SHOW TABLES;
SQL>> SELECT sname FROM Student WHERE sname LIKE “R_ _”;
It will display all names of 3 characters starting with R . eg Ram, Raj etc.
Questions/Answers
1. Differentiate between DBMS and RDMS.
Ans
(i) DBMS stands for Data Base Management System but RDBMS stands
for Relational Data Base Management System.
(ii) DBMS stores data in the form of files but RDBMS stores data in the
form of table.
(iii) DBMS is capable to handle small amount of data but RDBMS can
handle huge amount of data.