Wednesday , October 17 2018
Home / DataBase (page 4)

DataBase

SUB QUERIES

Subqueries

Subqueries:- 1.A query inside another query is known as subquery. 2.First inner query is executed then result of inner query is input for outer query. 3.Outer can be insert/update/delete/select 4.inner query must be always select. Types of Subqueries:- 1.single row subquery 2.Multirow Subquery 3.Co-related Subquery [crayon-5bc6e9ef1d813372817886/] Sample Tables: Table 1:EMPLOYEE …

Read More »

Every Sql Server Developer Should know this Tips

Studyclues_shouldknow

Every SQL Server Developer Should Know this tips 1.Query Execution Order in Sql Query:- 1.From clause 2.Where clause 3.Group by clause 4.Having clause 5.Select clause 6.Order by clause 2. Find  Number of Tables In a Single DataBase   [crayon-5bc6e9ef1e227595664996/] 3.Find All Number of Columns In a DataBase [crayon-5bc6e9ef1e236482872975/] 4.Find Number of …

Read More »

Multirow Functions:-

Studyclues_MultiRow

Multirow Function:- These functions process group of Rows and Return one value. This functions are also called group functions or aggregate functions. 1.Max():- Returns Maximum value [crayon-5bc6e9ef1ebcd854858999/] [crayon-5bc6e9ef1ebd5148975645/] Maximum salary of managers? select Max(sal)from emp where Job=’MANAGER’ 2.Min():- Returns Minimum value [crayon-5bc6e9ef1ebd8433948965/] [crayon-5bc6e9ef1ebdb594923890/] 3.Sum():- Returns total [crayon-5bc6e9ef1ebdd843429197/] 4.Avg():- Returns average …

Read More »

View Classification

Studyclues_Viewes

Views:-  View Definition:- A View is nothing but an image table or virtual table, which is created for a base table. A view can be created by taking all values from the base table or by taking only selected values from base table. There are two types views available in …

Read More »

JOINS

Studyclues JOINS

JOINS: Joins in SQL Server explained bellow (one by one):- These are used for retrieving the data from one or more tables at a time.Joins can be used in any of the following ways. 1.Equi-joins 2.Non-equi-joins 3.Self join 4.Cross join 5.outer join Sample Tables: Table 1:EMPLOYEE [crayon-5bc6e9ef1f572208450670/]   Table 2: …

Read More »

Special Functions

sql server special functions

Special Functions:- below are the Special Functions in sql server. 1.IsNUll():- Used to convert Nulls [crayon-5bc6e9ef1fdb5759221527/] if expr1 is Null returns expr2 if expr1 is NotNull returns expr1 only [crayon-5bc6e9ef1fdbb473401988/] Sal+comm as total sal from enp 1.select empno,ename,sal,comm,sal+comm as totalsal from enp. In the above case if something sal+Null= Null 2.select …

Read More »

Rollup and Cube in sql server :-

roll up

Rollup and cube:- Both rollup and cube extends functionality groupby clause Rollup: The ROLLUP operator is useful in generating reports that contain subtotals and totals. The ROLLUP operator generates a result set that is similar to the result sets generated by the CUBE operator. ROLLUP in SQL Server is used to …

Read More »

Conversion Functions in sql server

Converion Functions

Conversion Functions in sql server:- Used to convert from one data type to another data type 1.cast 2.convert 1. cast:- [crayon-5bc6e9ef2057e619084045/] [crayon-5bc6e9ef20584179806123/] 2.convert:- [crayon-5bc6e9ef20588804701151/] [crayon-5bc6e9ef2058a265436673/] [crayon-5bc6e9ef2058d374866335/] using data functions we can display dates in different formats. [crayon-5bc6e9ef20590290114684/]  

Read More »

Sql Server Date Functions Part-2

Sql Server Date Functions

Sql Server Date Functions: In Previous Article we have seen some sql  server date functions now i am continues remaining date function in this article 9.DAY(): DAY() functions returns an integer that represents the day of the month of the specified year date. [crayon-5bc6e9ef20952739267320/] [crayon-5bc6e9ef20958739722008/] 10. MONTH(): MONTH() Functions Returns an …

Read More »

Sql Server Date Functions(One by One):

Sql Server Date Functions

Sql Server Date functions: SQL Server date functions are scalar functions that perform an operation on a date and time input value and returns either a string, numeric, or date and time value.  Some date and time functions are categorized as deterministic functions while others are non-deterministic. 1.GETDATE() 2.GETUTCDATE() 3.SYSDATETIME() …

Read More »
Page 4 of 6
1 2 3 4 5 6