Home / Database / SQL Server

SQL Server

Sub queries In SQL Server

query

What is Query ? A statement that request data from database is called as query. e.g. Select statement request data to the database so select statement is a query statement. What is Sub Query ?Definition ? A select statement used inside another select statement is called subquery statement. Subquery must ...

Read More »

Inner Join in SQL Server

inner

Joins are used to combine the data of two or more tables using single select statement. Joins are classified into Inner Joins, Outer Join & Cross Join. The Inner & Outer join again classified into several subtypes as Equi Join, Non-Equi Join, Natural join & Self join. Syntax : SELECT ...

Read More »

Union , Intersect and Except Set Operators

operator

Set Operators : Definition : Set operators are useful in performing the mathematical operations on the data present in the table. There must be at least two select statement so that the operations can be performed on the data by comparing the data from each select statement. Rules to be ...

Read More »

Database level Queries & Identity functions

Database

Get list of tables in the Database: We can get all the tables in the database by using one of the following queries. SELECT * FROM SYS.OBJECTS WHERE TYPE=’u’ SELECT * FROM INFORMATION_SCHEMA.TABLES Get list of columns of a Table: To get the list of columns present in the table, ...

Read More »

Difference between Delete and Truncate command

Delete Command

Difference between Delete and Truncate command Delete Command 1. It allows to delete all rows as well as specific rows from table. 2. It deletes rows one by one. 3. Delete command is comes under DML & it does not deallocate the memory after deleting rows. 4. Id delete command is used to ...

Read More »

Predicates in SQL Server 2008

sql

Predicates in SQL Server 2008 Any operator that is used within the select clause condition in where clause is a predicate. SQL provides several of these predicates to simplify the conditions used in where clause. IN In predicate can be used to check the specific value is present in the ...

Read More »

How to Modify table information in SQL database?

Modify Table

Modify Table Structure: We can modify table structure by adding/altering the table using following commands. Add Columns: While adding columns constraints can be applied to the columns. If tables contains data then it won’t be possible to apply “Not Null” & “Primary Key” constraint on the column. Syntax is : ...

Read More »

How to create table in SQL database?

create table

Create table in SQL Database. In below article we will see how to create table , delete table, update table and select table in qul database .It is easy to create table in sql. Create Table Command: To create table in the database following syntax is used. Create Table < ...

Read More »

Guide about Database Constraints

Constraints

Database Constraints: Constraint is the rules/conditions imposed on the columns & tables to maintain the data integrity of the database. Constraints are of 2 types, Declarative Integrity Constraint: These constraints can be imposed at the time of table or column creation. Procedural Integrity Constraint: These constraints cannot be imposed at ...

Read More »

Database Creation In SQL (Structured Query Language)

database creation in SQL

Database Creation  In SQL : In SQL (Structured Query Language) Management Studio we can create the database using commands like below. Database Creation In SQL Database can be created using simple command. Create Database < Database Name > E.g. Create DatabaseMyDatabase Above command will create the “Data File” (i.e. .mdf ...

Read More »