DataBase Management System (DBMS)
The software used for the management, maintenance and retrieval of the data stored in a database is called DBMS.A database management system frees the programmer from the need to worry about the organization and location of data. The primary goal of a dbms is to provide an environment which is both convenient and efficient to use in retrieving and storing information.
A Database Storage Hierarchy
Database
A collection of data files integrated and organised into a simple comprehensive file system, which is arranged to minimize duplication of data and to provide convenient access to information within that system to satisfy a wide variety of user needs.Data files
A file is a number of related records that are treated as a unit.Ex: a collection of all employee records for one company would be an employee file.
Records
A collection of related items of data is treated as a unit.Ex: an employee record would be collection of all fields of one employee.
Record is sometimes referred as tuple.
Field
Individual element of data is called field.Ex: bank cheque consists of following field cheque no, date, payee, numeric amt, signature, bank, etc.
Field is sometimes referred as data item.
Basic DBMS Terms
Relation
A relationship is an association among several entitiesEx: a cusst_acct relationship associates a customer with each account that she or he has.
Redundancy
If same piece of information is stored in database for number of times the database is said to be redundant. We should check our database should not be redundant as it wastes make our disk space, reduced efficiency of database, require more processing time, and their chances of inconsistency due to it in our database.Ex: if we have two tables emp_details (contains details of employee) and payroll (contains payment details to employee), than if we include details of employee in payroll table, than it is said to be redundancy as same piece of information is repeated.
Inconsistency
Inconsistency is various copies of the same data may no longer agree. Inconsistency occurs due to redundancy, so redundancy should be reduced. Though we cannot eliminate the redundancy, but we can reduce it up to certain level.Ex: if we have details of employee stored in emp_details and payroll table than while updating information we should check that both tables are updated or not, if we update the address of one employee in emp_details and same details is not updated in payroll table, than database is said to be in inconsistent state.
Propagating updates
Propagating updates ensures users that any change made to record of one files, automatically made to other files. This process is known as propagating updates, where the term “updates” is used to cover all the operations of creation, deletion and modification.We can avoid inconsistency by using propagating update technique.
Instances
The collection of information stored in the database at a particular moment in time is called instances of the database.Schemas
The overall design of the database is called the database schemas. Schemas are changed infrequently, if at all.Users
There are four different types of database system users.Application programmers
A person who prepares application program are called application programmer. Application programs operate on the data in all the usual ways: retrieving information, creating new information, deleting or changing existing information.
Sophisticated users
Sophisticated users interact with the system without writing programs. Instead, they form their requests in a database query language. Each such query is submitted to a query processor whose function is to take a dml statement and break it down into instructions that the database manager understands.Specialized users
Some sophisticated users write specialized database application that does not fit into the traditional data processing framework. Among these applications are computer-aided design systems, knowledge-base and expert systems, systems that store data with complex data typesEx: For graphics and audio data.
End users
Unsophisticated users interact with the system by invoking one of the permanent application programs that have been written previously. Thus they are persons who use the information generated by a computer based system. Retrieval is the most common function for this class of user.Keys concept in DBMS
A key is a single attribute or combination of two or more attributes of an entity set that is used to identify one or more instances of the set.Primary key
A primary key is a field that uniquely identifies each record in a table. As it uniquely identifies each entity, it cannot contain null value and duplicate value.Ex: consider the customer table, which has field: customer_number, customer_socialsecurity_number, and customer_address.here customer_number of each entity in customer table is distinct so customer-number can be a primary key of customer-table.
Super key
If we add additional attributes to a primary key, the resulting combination would still uniquely identify an instance of the entity set. Such augmented keys are called superkey.A primary key is therefore a minimal superkey.
Candidate key
A nominee’s for primary key field are known as candidate key.Ex: from above example of customer table, customer_socialsecurity_number is candidate key as it has all characteristics of primary key.
Alternate key
A candidate key that is not the primary key is called an alternate key.Ex: in above example, customer_socialsecurity_number is a candidate key but not a primary key so it can be considered as alternate key.
Composite key
Creating more than one primary key are jointly known as composite key.Ex: in above example, if customer_number and customer_socialsecurity_number are made primary key then they will be jointly known as composite key.
Foreign key
Foreign key is a primary key of master table, which is reference in the current table, so it is known as foreign key in the current table. A foreign key is one or more columns whose value must exist in the primary key of another table.Ex: consider two tables emp(contains employees description) and emp_edu(contains details of employee’s education), so emp_id which is primary key in emp table will be referred as foreign key in emp_edu table.
Normalization
It is important to understand the concept of normalization before switch on to the creation of table and its manipulation.- Normalization is the process of grouping data into logical related groups.
- Normalization is the process of reducing the redundancy of data in a relational database.
- A database that is not normalized may include data that is contained in one or more different tables for no apparent reason. This could be bad for security reasons, disks space usage, speed of queries, efficiency of database updates, and may be most importantly, data integrity. A database before normalization is one that has not been broken down logically into smaller, more manageable tables.
Benefits of normalization:
Normalization provides numerous benefits to a database.Some of the major benefits include wider the overall database organization.
- The reduction of redundant data.
- Data inconsistency can be avoided.
- A much more flexible database design.
- A better handle on database security.
The demand for "all round" testers, i.e. being able to test the system’s functionality through traditional testing methods and being able to show some technical knowledge are growing.
Basics of Database testing contain the following:
Functional flow should be very well known!
Good knowledge on table level, column level constraints, ability to understand and execute complex queries related to joins is added advantage.
Basics of Database testing contain the following:
How to connect to the database?
Ability to write simple queries to retrieve data and manipulate the data using DML operations.Functional flow should be very well known!
Good knowledge on table level, column level constraints, ability to understand and execute complex queries related to joins is added advantage.
INTRODUCTION TO DATABASE TESTING
- Why back end testing is so important
- Characteristics of back end testing
- Back end testing phases
- Back end test methods
STRUCTURAL BACK END TESTS
- Database schema tests
- Databases and devices
- Tables, columns, column types, defaults, and rules
- Keys and Indexes
- Stored procedure tests
- Individual procedure tests
- Integration tests of procedures
- Trigger tests
- Update triggers
- Insert triggers
- Delete triggers
- Integration tests of SQL server
- Server setup scripts
- Common bugs
FUNCTIONAL BACK END TESTS
- Dividing back end based on functionality
- Checking data integrity and consistency
- Login and user security
- Stress Testing
- Test back end via front end
- Benchmark testing
- Common bugs
TESTING THE NIGHTLY DOWNLOADING AND DISTRIBUTION JOBS
- Batch jobs
- Data downloading
- Data conversion
- Data distribution
- Nightly time window
- Common bugs
TESTING THE INTERFACES TO TRANSACTION APIS
- APIs' queries to back end
- Outputs of back end to APIs
- Common bugs
OTHER DATABASE TESTING ISSUES
- Test tips
- Test tools
- Useful queries
What are the difference between DDL, DML and DCL commands?
- DDL is Data Definition Language statements. Some examples:
- CREATE - to create objects in the database
- ALTER - alters the structure of the database
- DROP - delete objects from the database
- TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
- COMMENT - add comments to the data dictionary
- GRANT - gives user's access privileges to database
- REVOKE - withdraw access privileges given with the GRANT command
- DML is Data Manipulation Language statements. Some examples:
- SELECT - retrieve data from the a database
- INSERT - insert data into a table
- UPDATE - updates existing data within a table
- DELETE - deletes all records from a table, the space for the records remain
- CALL - call a PL/SQL or Java subprogram
- EXPLAIN PLAN - explain access path to data
- LOCK TABLE - control concurrency.
- DCL is Data Control Language statements. Some examples:
- COMMIT - save work done
- SAVEPOINT - identify a point in a transaction to which you can later roll back
- ROLLBACK - restore database to original since the last COMMIT
- SET TRANSACTION - Change transaction options like what rollback segment to use
- Why database testing is necessary?
- Differences between backend testing and front end testing
- Backend testing phases / Database Testing Phases
- Backend test methodology / Database Testing methodology
- Basics of SQL
- Section 1
- Basics of the SELECT Statement
- Conditional Selection
- Relational Operators
- Compound Conditions
- IN & BETWEEN
- Using LIKE
- Section 2
- Joins
- Keys
- Performing a Join
- Eliminating Duplicates
- Aliases & In/Sub-queries
- Section 3
- Aggregate Functions
- Views
- Creating New Tables
- Altering Tables
- Adding Data
- Deleting Data
- Updating Data
- Section 4
- Indexes
- GROUP BY & HAVING
- More Sub-queries
- EXISTS & ALL
- UNION & Outer Joins
- Embedded SQL
- Common SQL Questions
- Nonstandard SQL
- Syntax Summary
0 comments:
Post a Comment