ERP QA Quality Assurance testing
As a software tester, you're required to perform database testing that calls for information on various SQLand database principles. similarly, you are required to write down square queries to retrieve, update and insert information in the databases. therefore, similar to the DBAs and SQLdevelopers, studying this skill is similarly important for software program testing professionals as well
This blog post is for complete beginners without a or minimal previous expertise in SQL. we can start with the database fundamentals. After that, we can pass to the SQLstandards. eventually, we’ll take a look at a number of the extensively used square commands.
So, let’s start this SQL for testerswith the database fundamentals first.
Content
Also, Read Automated Tools For Software Testing
A database is a prepared and systematic series of records that are saved and accessed in/from a computer system. corporations use databases as a method to store, control, and retrieve statistics in actual time.
DBMS -DBMS is a software system this is designed to keep and get admission to the database. It allows the consumer to access, create, delete, and replace data in a database.
DBMS defines the policies for the manipulation and validation of these statistics. We use a database when there is a huge amount of statistics, the security of the information is vital, or whilst multiple users must have to get entry to the information concurrently.
RDBMS -RDBMS is an advanced model of the fundamental DBMS. This databases management gadget makes use of the relational version for its databases i.e. RDBMS allows the user to create relational databases.
A relational database is a database that permits the consumer to store associated facts within the form of multiple tables, which are connected by using setting up a courting among the specific tables, subsequently supplying an efficient manner to access the database.
Tables -A RDBMS database uses tables for storing the records. A desk is not anything but a collection of data that is related to one another, in the form of rows and columns.
Rows -A Row represents a collection of fields that end up making a record in the database.
Column -In a database, a column represents those values that are of the same type. A column is also known as an attribute.
SQLstands for established Query Language. it's far a programming language that is used to request facts from a database. square can be used to manage and share statistics in a relational database control system. furthermore, users can perform moves like insertion, deletion, selection, etc on the database.
square programming is widely used as the use of this language we are able to create, save as well as manipulate the records in the database. furthermore, SQLmay be embedded within other languages via square libraries and modules.
Various data types in SQL are-
Data type: Description
VARCHAR(size): Variable length character data
CHAR (size): Fixed-length character data
BINARY (size): Binary byte strings
NUMBER(a,b) : Variable-length numeric data
DATE: Date and time values
LONG: Variable-length character data up to 2 gigabytes
CLUB: Character data up to 4 gigabytes
RAW: Raw binary data
BLOB: Binary data up to 4 gigabytes
B FILE: Binary data stored that is stored in external files up to 4 gigabytes
ROWID:64 base number system for the unique address of a particular row in the table
Also, Read Mobile Testing Using Appium Tool
Arithmetic operators
Operator : Description
+ : Add values of operands
– : Subtract values of operands
* : Multiply the operand’s values
/ : Divide values of operands
% : Modulus operation on operands
In the table below, if the condition gets satisfied then the “True” Boolean value is returned.
Operator : Description
= : Determine if the values of operands are equal.
!= : Check if the values of operands are not equal.
> : Determine if the left operand is more than the right operand.
< : Check if the right operand is more than the left operand.
>= : Determine if the left operand is more than or equal to the right operand.
<= : Check if the right operand is more than or equal to the left operand.
!> : Determine if the right operand is not more than the left operand.
!< : Check if the left operand is not more than the right operand.
Operator : Description
OR : Returns true if either operand is true. Else it returns false if both the operands are false.
AND : Returns true if both operands are true. Else it returns false if either or both the operands are false
NOT : Returns true if the condition is false and returns false if the condition is true.
Create Database
The CREATE DATABASEassertionis used to create acleannewSQL database. Following is the syntax-
Drop Database
The DROP DATABASEqueryis used to drop or delete anexistingsq.database. Syntax-
Rename Database
The RENAME DATABASEqueryis used to rename apresentdatabase. Following is the syntax-
Select Database
The select DATABASE query is used to choose all the fields inside an existing database. Syntax-
Create Database
The CREATE table question is used to create a brand-new table. Following is the syntax for SQLcreate desk utilization-
Drop table
The DROP table query is used to drop an existing desk. Syntax-
Rename table
The RENAME query is used to alternate the call of a current desk. Following is the syntax-
Truncate table
The TRUNCATE table question is used to delete all rows from a desk, maintaining its structure. Following is the syntax-
choose * Into
This question is used to duplicate a desk into any other table in the equal database. Syntax-
Alter table
ALTER command may be used to carry out diverse manipulations on our database. these are as listed beneath-
a. Following is the syntax to feature a column on the desk.
Alter table add <(width)>;
b. Following is the syntax to modify the attributes of statistics in a discipline of the table.
Alter table alter ( < new_data_type>);
c. Following is the syntax to drop or delete adisciplineof thedesk.
Alter table DROP COLUMN < column_name>;
d. Following is the syntax to rename a column-
ALTER TABLE <table_name> RENAME COLUMN <old_column_name> TO
<new_column_name>;
e. Drop a table – Deletes a Table and along with it all its contents. Following is the syntax-
DROP TABLE <Table_name>;
f. Truncate a table – Deletes all rows from a table but it retains its structure.Following is the syntaxfor the truncate operation-
TRUNCATE TABLE <table_name>
g. Following is the syntax to rename a table.
RENAME <old_tablename> TO <new_table_name>
Constraint : Description
NOT NULL: It specifies that a column must have some value
UNIQUE : It specifies that columns must have unique values
PRIMARY KEY : It specifies a column or a set of columns that uniquely identify a row, it does not allow null values
FOREIGN KEY : It is a column(s) that references a column(s) of a table
CHECK : It specifies a condition that must be satisfied by all the rows in a table
Insert commands
The square insert instructions are used to insert information into the database. this could be completed via the following-
a. Inserting values given by the user –This is used to insert certain values given by the user into the table. Following is the syntax-
INSERT INTO <table_name> VALUES ( val1,val2 …);
b. Inserting values into a specific column of the table– This query is used to insert values into some specific column inside the table. Following is the syntax-
INSERT INTO <Table_Name> (column_name1, column_name2, column_name3,..) VALUES (val1, val2, val3,…..);