What We Are Learn On This Post
SQL Syntax For Manual And Automation Testers
As we know SQL is following some set of rules while writing the queries that called SQL syntax. So in this post, we are going to learn about:
- SQL tutorial
- SQL commands
- SQL syntax
- SQL statements
- basic SQL queries
When we Are going for any testing or an interview, SQL is one of the major parts. So we are trying to recall the SQL syntax of different statements like insert, update, delete.. etc. so we share the SQL syntax for you.
Check Also: SQL Join
SQL Syntax Commands
Select Statement
SELECT “column_name” FROM “table_name”;
Distinct
SELECT DISTINCT “column_name”
FROM “table_name”;
Where
SELECT “column_name”
FROM “table_name”
WHERE “condition”;
And/Or
SELECT “column_name”
FROM “table_name”
WHERE “simple condition”
{[AND|OR] “simple condition”}+;
In
SELECT “column_name”
FROM “table_name”
WHERE “column_name” IN (‘value1’, ‘value2’, …);
Between
SELECT “column_name”
FROM “table_name”
WHERE “column_name” BETWEEN ‘value1’ AND ‘value2’;
Like
SELECT “column_name”
FROM “table_name”
WHERE “column_name” LIKE {PATTERN};
Order By
SELECT “column_name”
FROM “table_name”
[WHERE “condition”]
ORDER BY “column_name” [ASC, DESC];
Count
SELECT COUNT(“column_name”)
FROM “table_name”;
Group By
SELECT “column_name1”, SUM(“column_name2”)
FROM “table_name”
GROUP BY “column_name1”;
Having
SELECT “column_name1”, [Function(“column_name2”)]
FROM “table_name”
[GROUP BY “column_name1”]
HAVING (arithematic function condition);
Create Table Statement
CREATE TABLE “table_name”
(“column 1” “data type for column 1” [column 1 constraint(s)],
“column 2” “data type for column 2” [column 2 constraint(s)],
…
[table constraint(s)]);
Drop Table Statement
DROP TABLE “table_name”;
Truncate Table Statement
TRUNCATE TABLE “table_name”;
Insert Into Statement
INSERT INTO “table_name” (“column1”, “column2”, …)
VALUES (“value1”, “value2”, …);
Read: Basic SQL Queries
Insert Into Select Statement
INSERT INTO “table1” (“column1”, “column2”, …)
SELECT “column3”, “column4”, …
FROM “table2”;
Update Statement
UPDATE “table_name”
SET “column_1” = [new value]
WHERE “condition”;
Delete From Statement
DELETE FROM “table_name”
WHERE “condition”;
More Searching Words: SQL syntax checker, SQL select statement, SQL commands with syntax and examples, SQL query list, SQL cheat sheet available for download, SQL statements start with any of the keywords like Select, Insert, Update, Delete, Alter, Drop, Create, Use & Show.
For more interview questions on Java, Manual Testing and automation testing interview questions. you can find more Java programs and more company Java Selenium automation interview questions. you can get all those things in www.SoftwareTestingo.com.
Also calculate what would be the pension of the employee if the age of the 3 employees is 21, 35, 59 respectively at the age of retirement ?