Quality Assurance /
Software Testing Training
DBMS, RDBMS and SQL
Page 2Classification: Restricted
Agenda
• DBMS
• RDBMS
• SQL
• Types of SQLs
• - DDL
• - DML
• - DCL
• Normalization
Page 3Classification: Restricted
• What is DBMS ?
The database management system is a collection of programs that enables
user to store, retrieve, update and delete information from a database.
• What is RDBMS ?
Relational Database Management system (RDBMS) is a database
management system (DBMS) that is based on the relational model. Data
from relational database can be accessed or reassembled in many different
ways without having to reorganize the database tables. Data from relational
database can be accessed using an API , Structured Query Language (SQL).
Ex: Oracle, My SQL, SQL Server, DB2 etc
• What is SQL?
Structured Query Language(SQL) is a language designed specifically for
communicating with databases. SQL is an ANSI (American National Standards
Institute) standard.
Page 4Classification: Restricted
Types of SQLs
a. DDL – Data Definition Language:
DDL is used to define the structure that holds the data. For example,
Create, Alter, Drop and Truncate table.
b. DML – Data Manipulation Language:
DML is used for manipulation of the data itself. Typical operations are
Insert, Delete, Update and retrieving the data from the table. The Select
statement is considered as a limited version of the DML, since it can't
change the data in the database. But it can perform operations on data
retrieved from the DBMS, before the results are returned to the calling
function.
c. DCL – Data Control Language:
DCL is used to control the visibility of data like granting database access
and set privileges to create tables, etc. Example - Grant, Revoke access
permission to the user to access data in the database.
Page 5Classification: Restricted
Advantages of SQL
1. SQL is not a proprietary language used by specific database vendors.
Almost every major DBMS supports SQL, so learning this one language will
enable programmers to interact with any database like ORACLE, SQL ,MYSQL
etc.
2. SQL is easy to learn. The statements are all made up of descriptive English
words, and there aren't that many of them.
3. SQL is actually a very powerful language and by using its language
elements you can perform very complex and sophisticated database
operations.
Page 6Classification: Restricted
Basics of SQL
a. What is a field?
A field is an area within a record reserved for a specific piece of data.
Examples: Employee Name, Employee ID, etc.
b. What is a record?
A record is the collection of values / fields of a specific entity: i.e. an
Employee, Salary etc.
c. What is a table?
A table is a collection of records of a specific type. For example, employee
table, salary table etc.
Page 7Classification: Restricted
Normalization
In database design, we start with one single table, with all possible columns.
A lot of redundant data would be present since it’s a single table. The process
of removing the redundant data, by splitting up the table in a well defined
fashion is called normalization.
1. First Normal Form (1NF)
A relation is said to be in first normal form if and only if all underlying
domains contain atomic values only. After 1NF, we can still have redundant
data.
2. Second Normal Form (2NF)
A relation is said to be in 2NF if and only if it is in 1NF and every non key
attribute is fully dependent on the primary key. After 2NF, we can still have
redundant data.
3. Third Normal Form (3NF)
A relation is said to be in 3NF, if and only if it is in 2NF and every non key
attribute is non-transitively dependent on the primary key.
Page 8Classification: Restricted
DBMS Keys and Constraints
What is Primary Key?
A primary key is a column whose values uniquely identify every row in a table. Primary key
values can never be reused. If a row is deleted from the table, its primary key may not be
assigned to any new rows in the future. To define a field as primary key, following conditions had
to be met :
1. No two rows can have the same primary key value.
2. Every row must have a primary key value.
3. The primary key field cannot be null.
4. Value in a primary key column can never be modified or updated, if any foreign key refers to
that primary key.
What is Foreign Key?
When a "one" table's primary key field is added to a related "many" table in order to create the
common field which relates the two tables, it is called a foreign key in the "many" table.
For example, the salary of an employee is stored in salary table. The relation is established via
foreign key column “Employee_ID_Ref” which refers “Employee_ID” field in the Employee table.
What is Unique Key?
Unique key is same as primary with the difference being the existence of null. Unique key field
allows one value as NULL value.
Page 9Classification: Restricted
Data Types:
• INT/ Number
• CHAR
• VARCHAR / VARCHAR(n)
• Decimal
• boolean
Page 10Classification: Restricted
Thank You

Introduction DBMS, RDBMS and SQL

  • 1.
    Quality Assurance / SoftwareTesting Training DBMS, RDBMS and SQL
  • 2.
    Page 2Classification: Restricted Agenda •DBMS • RDBMS • SQL • Types of SQLs • - DDL • - DML • - DCL • Normalization
  • 3.
    Page 3Classification: Restricted •What is DBMS ? The database management system is a collection of programs that enables user to store, retrieve, update and delete information from a database. • What is RDBMS ? Relational Database Management system (RDBMS) is a database management system (DBMS) that is based on the relational model. Data from relational database can be accessed or reassembled in many different ways without having to reorganize the database tables. Data from relational database can be accessed using an API , Structured Query Language (SQL). Ex: Oracle, My SQL, SQL Server, DB2 etc • What is SQL? Structured Query Language(SQL) is a language designed specifically for communicating with databases. SQL is an ANSI (American National Standards Institute) standard.
  • 4.
    Page 4Classification: Restricted Typesof SQLs a. DDL – Data Definition Language: DDL is used to define the structure that holds the data. For example, Create, Alter, Drop and Truncate table. b. DML – Data Manipulation Language: DML is used for manipulation of the data itself. Typical operations are Insert, Delete, Update and retrieving the data from the table. The Select statement is considered as a limited version of the DML, since it can't change the data in the database. But it can perform operations on data retrieved from the DBMS, before the results are returned to the calling function. c. DCL – Data Control Language: DCL is used to control the visibility of data like granting database access and set privileges to create tables, etc. Example - Grant, Revoke access permission to the user to access data in the database.
  • 5.
    Page 5Classification: Restricted Advantagesof SQL 1. SQL is not a proprietary language used by specific database vendors. Almost every major DBMS supports SQL, so learning this one language will enable programmers to interact with any database like ORACLE, SQL ,MYSQL etc. 2. SQL is easy to learn. The statements are all made up of descriptive English words, and there aren't that many of them. 3. SQL is actually a very powerful language and by using its language elements you can perform very complex and sophisticated database operations.
  • 6.
    Page 6Classification: Restricted Basicsof SQL a. What is a field? A field is an area within a record reserved for a specific piece of data. Examples: Employee Name, Employee ID, etc. b. What is a record? A record is the collection of values / fields of a specific entity: i.e. an Employee, Salary etc. c. What is a table? A table is a collection of records of a specific type. For example, employee table, salary table etc.
  • 7.
    Page 7Classification: Restricted Normalization Indatabase design, we start with one single table, with all possible columns. A lot of redundant data would be present since it’s a single table. The process of removing the redundant data, by splitting up the table in a well defined fashion is called normalization. 1. First Normal Form (1NF) A relation is said to be in first normal form if and only if all underlying domains contain atomic values only. After 1NF, we can still have redundant data. 2. Second Normal Form (2NF) A relation is said to be in 2NF if and only if it is in 1NF and every non key attribute is fully dependent on the primary key. After 2NF, we can still have redundant data. 3. Third Normal Form (3NF) A relation is said to be in 3NF, if and only if it is in 2NF and every non key attribute is non-transitively dependent on the primary key.
  • 8.
    Page 8Classification: Restricted DBMSKeys and Constraints What is Primary Key? A primary key is a column whose values uniquely identify every row in a table. Primary key values can never be reused. If a row is deleted from the table, its primary key may not be assigned to any new rows in the future. To define a field as primary key, following conditions had to be met : 1. No two rows can have the same primary key value. 2. Every row must have a primary key value. 3. The primary key field cannot be null. 4. Value in a primary key column can never be modified or updated, if any foreign key refers to that primary key. What is Foreign Key? When a "one" table's primary key field is added to a related "many" table in order to create the common field which relates the two tables, it is called a foreign key in the "many" table. For example, the salary of an employee is stored in salary table. The relation is established via foreign key column “Employee_ID_Ref” which refers “Employee_ID” field in the Employee table. What is Unique Key? Unique key is same as primary with the difference being the existence of null. Unique key field allows one value as NULL value.
  • 9.
    Page 9Classification: Restricted DataTypes: • INT/ Number • CHAR • VARCHAR / VARCHAR(n) • Decimal • boolean
  • 10.