You are here
Home > Posts tagged "sql"

SQL: Set Operators

SQL: Set Operators Set operators are used to combine same type of data from two or more tables. SQL supports following operators: a) Union b) Union all c) Intersect d) Except Rules on Set Operators: Column alias must be expressed in the first select statement. Each select statement must have the same number of

SQL JOIN (OUTER JOIN)

SQL JOIN Outer Join: Outer join returns all rows from one table and matching rows from second table. There are three types of Outer join: 1) Left Outer Join 2) Right Outer Join 3) Full Outer Join Syntax: select column_name(s) from table_name1 left | right | full [outer] join table_name2 on table_name1. column_name= table_name2. column_name Left Outer

SQL JOIN (INNER JOIN)

SQL JOIN Inner Join or Equi Join: Inner join selects data that have matching values in tables. Inner join is same as join, so we can use either inner join or join keyword. Syntax: select column_name(s) from table_name1 inner join table_name2 on  table_name1.column_name=  table_name2.column_name   OR   select column_name(s) from table_name1 join table_name2 on  table_name1.column_name=  table_name2.column_name Database Table: Customers Cust_id Name Age City 1 Prince 22 Anand 2 Komal 44 Pune 3 Khusi 30 Delhi 4 Anil 45 Mumbai 5 Abhi 27 Ahmedabad 6 Juhi 35 Baroda Here, Cust_id

SQL JOIN

SQL JOIN Sql join is used to combine data from two or more tables in a database. Join keyword is used to join one (self-table) or more tables in sql query. According to ANSI SQL-89 syntax for joining two tables: select [column-list] from table_name1,table_name2 where <where predicate> According to ANSI SQL-92 syntax

SQL Query (DELETE Statement)

SQL Query Delete Statement: Delete statement is used to delete data from table. Delete statement without where clause affects all rows of table. Syntax of Delete statement: delete from <table_name> where condition; Delete can be rolled back. Delete tables can have triggers. Delete is DML command. It does not reset identity

SQL Query (UPDATE Statement)

SQL Query       Update Statement: Update statement enables to update existing data in a table. Update statement without where clause affects all rows of table. It can update one or more records in a table. Syntax of Update Statement: update <table_name> set <column1>=<expression1>, <column2>=<expression2>,…., <columnN>=<expressionN> where condition; Here, column1, column2,…., columnN

SQL Query (INSERT Statement)

SQL Query       Insert Statement: Insert statement is used to insert data in to a table. There are two basic syntaxes of the insert statement. Syntax 1: insert into table_name values(value1, value2,….. ,valueN); If you are adding values for all columns, you do not specify the column names. Syntax 2:

SQL Query (SELECT Statement)

SQL Query SQL stands for structured query language. Query may retrieve data from database. SQL Queries are select, insert, update, delete etc. Select Statement: Select statement is used to retrieve data from one or more tables. If you want to select all columns available in the table, use following syntax. Syntax:

SQL QUIZ PART-3

Welcome to the SQL Quiz. This SQL Quiz is improve your SQL Server knowledge. There is no time limit in this quiz. This quiz contains all important topics.     Keep visiting my site ask2tech.com for upcoming top technical article Learn more about DBA at TechNet Consultancy

SQL QUIZ PART-2

Welcome to the SQL Quiz. This SQL Quiz is improve your SQL Server knowledge. There is no time limit in this quiz. This quiz contains all important topics.     Keep visiting my site ask2tech.com for upcoming top technical article Learn more about DBA at TechNet Consultancy

Top