Skip to main content

Database Knowledge for a Tester - Part I

1. Database concepts

1.1 Codd’s Rule for RDBMS – 12 Rule

Rule 1: The Information RuleAll data should be presented in a table form
Rule 2: Guaranteed Access RuleAll data should be accessible without ambiguity.
Rule 3: Systematic Treatment of Null ValuesSupport for Null values which is distinct from an empty string or a number with a value of zero.
Rule 4: Dynamic Online Catalog based on the Relational modelA relational database must provide access to its structure through the same tools that are used to access the data.
Rule 5: Comprehensive Data Sublanguage RuleThe DB must support at least one clearly defined language that includes functionality for Data Definition, Data Manipulation, Data Integrity, and Database Transaction Control.
Rule 6: View Updating RuleEach view in the database should support the same full range of data manipulation that has direct access to a table available. In reality, providing update and delete access to logical views is difficult and is not fully supported by any current database.
Rule 7: High-level Insert, Update, and DeleteInsert, Update and Delete operations should be supported for any retrievable set rather than just for a single row in a single table.
Rule 8: Physical Data IndependenceThe user is isolated from the physical method of storing and retrieving information from the database.
Rule 9: Logical Data IndependenceHow data is viewed should not be changed when the logical structure of the database changes. This rule is particularly difficult to satisfy.
Rule 10: Integrity IndependenceThe database language should support constraints on user input that maintain database integrity.
Rule 11: Distribution IndependenceA user should be totally unaware of whether or not the database is distributed.
Rule 12: Non Subversion RuleThere should be no way to modify the db structure other than through the multiple row database language.

1.2 DBMS Vs RDBMS

DBMS – Database Management System.The relationship between 2 tables or files is maintained programmatically.

  • Does not support Client/Server Architecture
  • Does not support distributed databases
  • There is no security of data
RDBMS – Relational Database Management SystemThe relationship between 2 tables or files can be specified at the time of table creation
  • Support Client/Server Architecture
  • Support distributed databases
  • There are multiple levels of security
  • Logging in at O/S level
  • Command level
  • Object Level

1.3 Normalization

It is a process that helps in designing the table structure for an application.
Normalization is technique that:
  • Decomposes data into two dimensional tables.
  • Eliminates any relationship in which table data does fully depend upon the primary key of a record.
  • Eliminates any relationship that contains transitive dependencies.

1.3.1 First Normal Form

A table is in 1st Normal Form if:
  • There are no repeating group
  • All the key attributes are defined.
  • All attributes are dependent on a primary key
1.3.2 Second Normal Form
A Table is in 2nd Normal form if:
  • Its in 1st Normal Form
  • It includes no partial dependencies i.e. an attribute is dependent on only a part of a primary key.

1.3.3 3rd Normal Form

A table is in 3rd Normal form if:
  • Its in 2nd Normal Form
  • It contains no transitive dependencies.
Note: A general case of transitive dependencies is as follows:
X, Y, Z are 3 columns in table.
If Z is related to Y
If Y is related to X
Then Z is indirectly related to X
This is when Transitive dependencies exist.
Note: Normalization slow down the database query for fetching records. So sometime to make the query faster denormalization is deliberately done on the table.

1.4 Illustration of Normalization






2 Components of SQL

2.1 DDL, DML & DCL Commands

DDL – Data Definition Language – No Rollback is possible – Commit is issued implicitly.Examples are:
· CREATE
· ALTER
· DROP
· TRUNCATE – Remove all the records from a table, including all spaces allocated for the records are removed
· GRANT
· REVOKE
DML – Data Manipulation LanguageExamples are:
· INSERT
· UPDATE
· DELETE – Deletes all records from a table, the space for the records remain.
· SELECT – more specifically a DQL – data query language.
DCL – Data Control Language
Examples are:
· COMMIT
· ROLLBACK

References

SQL, PL/SQL Third Edition by Ivan Bayross.

Download

Click here to download a PDF copy of this article.

Comments

Popular posts from this blog

Revolutionize software testing with AI! 🤖💻 Share your thoughts on ethical implications in the comments.

  As technology evolves, so too does the field of software testing. One exciting development in recent years is the use of AI (Artificial Intelligence) to automate repetitive tasks and improve testing accuracy. Through analyzing large amounts of data and identifying patterns, AI can help identify potential defects or vulnerabilities in software. AI-powered tools can also generate test cases and scenarios by simulating user behavior and input, allowing for more efficient and effective testing. In addition, machine learning algorithms can analyze and learn from past testing data, leading to better predictions and more streamlined testing. AI-powered tools can also help identify and prioritize critical bugs and defects, saving valuable time and effort in manual testing. But it's important to note that AI-powered testing is not a replacement for human testers. While AI can automate certain tasks and help identify potential issues, it's still necessary for human testers to provide a

Is AI taking over your job in software development and testing? 😱"

Are you a software developer or tester feeling threatened by the rise of AI in your industry? 😰 You're not alone. Many professionals in the field are concerned about the potential consequences of AI's integration into software development and testing. While some experts believe that AI can bring significant benefits to the industry, others worry that it could replace human expertise altogether. 🤔 AI algorithms can analyze massive amounts of data and automate many tasks, but they cannot replace the critical thinking and creativity of human beings. Additionally, there are ethical concerns associated with the use of AI in software development and testing. So, what can you do to ensure that you're not replaced by AI in your job? 💪 First, it's essential to recognize that AI is not a replacement for human expertise but rather a tool to augment it. Therefore, it's essential to learn how to work with AI-powered systems to increase your efficiency and productivity. Additi

HP Quality Center - Best Practices

1.Introduction Quality Center is a test management tool which provides very good features for managing both your manual and automated test cases. This paper highlights the best practices for managing your test cases. When you open Quality center, depending on your rights it display the below mentioned option in the sidebar: 1. Requirements 2. Test Plan 3. Test Lab 4. Defects 5. Dashboard 2.Requirements When you have assigned with the responsibility of developing your test cases in the quality center then you must be wondering where to start with. I am going to share my experience to overcome such a situation. You need to find the solution of some question before you start writing your test cases. 1. Is your requirement developed and available? 2. Is your requirement organized in a logical sequence? If answer to both of the above question is Yes, then you can start with Requirement option in the side bar. In case your requirement is under development, then you keep your