VisualBuilder
  Home > Database > Tutorials > Basic SQL Funtion - SQL tutorial
Tell a friend
Link to us
Total Members
      Members: 84648
     
Sitemap Forum Chat
Home
SQL Tutorial Tutorial Home
1 . History of SQL
2 . SQL Components: An Overview
3 . Data Types in SQL
4 . Planning a Database: An Example: -
5 . Creating Tables
6 . Inserting Data using Insert
7 . Getting Data with Select Statement
8 . Working with Operators
9 . Selecting Unique rows with Distinct
10 . Arraging Data with Order by
11 . Working with Strings
12 . SQL AND
13 . Basic SQL Funtion
14 . Sub-Queries, Nested Queries
15 . Constraints in the Table
16 . SQL UPDATE
17 . View
18 . Relationships in a RDBMS
19 . Structure Modification,Updation and Deletion
 
Database Group Home
Database Discussion
Database Members (506)
Database Resources
Database Source Code (0)
Database Articles (0)
Database Blogs
Database Jobs
Database Components (0)
Database Books
Database Websites (0)
Database News (0)
Database Q & A (14)
- Database Ask Question
- Database Questions
- Database Unanswered Questions
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Using Java Web Services Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (436 )
Source Code (3275 )
Articles (11 )
Components (1589 )
News (888 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise


Database sql Tutorial
 Basic SQL Funtion
  << Prev: SQL AND Next: Sub-Queries, Nested Queries >>

ABS: - It returns the absolute value of n.


Syntax:: - ABS ( n )


Example: - The following example returns the absolute value of -15:


SELECT ABS(-15) "Absolute" FROM DUAL;


Absolute


----------


15


ACOS: - It returns the arc cosine of n. The argument nmust be in the range of -1 to 1, and the function returns values in the range of 0 to p, expressed in radians.


Syntax: - ACOS ( n )


Example: - The following example returns the arc cosine of .3:


SELECT ACOS(.3) "Arc_Cosine" FROM DUAL;


Arc_Cosine


----------


1.26610367


ASIN: - It returns the arc sine of n. The argument n must be in the range of -1 to 1, and the function returns values in the range of -p/2 to p/2 and are expressed in radians.


Syntax: - ASIN ( n )


Example: - The following example returns the arc sine of .3:


SELECT ASIN(.3) "Arc_Sine" FROM DUAL;


Arc_Sine


---------- .


304692654


ATAN: - It returns the arc tangent of n. The argument n can be in an unbounded range, and the function returns values in the range of -p/2 to p/2 and are expressed in radians.


Syntax: - ATAN ( n )


Example: - The following example returns the arc tangent of .3:


SELECT ATAN(.3) "Arc_Tangent" FROM DUAL;


Arc_Tangent


---------- .


291456794


CEIL: - It returns smallest integer greater than or equal to n.


Syntax: - CEIL ( n )


Example: - The following example returns the smallest integer greater than or equal to 15.7:


SELECT CEIL(15.7) "Ceiling" FROM DUAL;


Ceiling


----------


16


COS: - It returns the cosine of n (an angle expressed in radians).


Syntax: - COS ( n )


Example: - The following example returns the cosine of 180 degrees:


SELECT COS(180 * 3.14159265359/180) "Cosine of 180 degrees" FROM DUAL;


Cosine of 180 degrees


---------------------


-1


EXP: - It returns e raised to the nth power, where e = 2.71828183 ...


Syntax: - EXP ( n )


Example: - The following example returns e to the 4th power:


SELECT EXP(4) "e to the 4th power" FROM DUAL;


e to the 4th power


------------------


54.59815


FLOOR: - It returns largest integer equal to or less than n.


Syntax: - FLOOR ( n )


Example: - The following example returns the largest integer equal to or less than 15.7:


SELECT FLOOR(15.7) "Floor" FROM DUAL;


Floor


----------


15


POWER: - It returns m raised to the nth power. The base m and the exponent n can be any numbers, but if m is negative, then n must be an integer.


Syntax: - POWER ( m , n )


Example: - The following example returns 3 squared:


SELECT POWER(3,2) "Raised" FROM DUAL;


Raised


----------


9


ROUND (number): - It returns number rounded to integer places right of the decimal point. If integer is omitted, then number is rounded to 0 places. integer can be negative to round off digits left of the decimal point. integer must be an integer.


Syntax: - ROUND ( number , integer )


Example: - The following example rounds a number to one decimal point:


SELECT ROUND(15.193,1) "Round" FROM DUAL;


Round


----------


15.2


The following example rounds a number one digit to the left of the decimal point:


SELECT ROUND(15.193,-1) "Round" FROM DUAL;


Round


----------


20


SIGN: - It returns -1 if n<0, then . If n=0, then the function returns 0. If n>0, then SIGN returns 1.


Syntax: - SIGN ( n )


Example: - The following example indicates that the function’s argument (-15) is <0:


SELECT SIGN(-15) "Sign" FROM DUAL;


Sign


----------


-1


SIN: - It returns the sine of n (an angle expressed in radians).


Syntax: - SIN ( n )


Example: - The following example returns the sin of 30 degrees:


SELECT SIN(30 * 3.14159265359/180) "Sine of 30 degrees" FROM DUAL;


Sine of 30 degrees


------------------


.5


SQRT: - It returns the square root of n. The value n cannot be negative. SQRT returns a real number.


Syntax: - SQRT ( n )


Example: - The following example returns the square root of 26:


SELECT SQRT(26) "Square root" FROM DUAL;


Square root


-----------


5.09901951


TAN: - It returns the tangent of n (an angle expressed in radians).


Syntax: - TAN ( n )


Example: - The following example returns the tangent of 135 degrees:


SELECT TAN(135 * 3.14159265359/180) "Tangent of 135 degrees" FROM DUAL;


Tangent of 135 degrees


----------------------


- 1


TRUNC (number): - The TRUNC (number) function returns n truncated to m decimal places. If m is omitted, then n is truncated to 0 places. m can be negative to truncate (make zero) m digits left of the decimal point.


Syntax: - TRUNC ( n , m )


Example: - The following example truncate numbers:


SELECT TRUNC(15.79,1) "Truncate" FROM DUAL;


Truncate


----------


15.7


SELECT TRUNC(15.79,-1) "Truncate" FROM DUAL;


Truncate


----------


10


  << Prev: SQL AND Next: Sub-Queries, Nested Queries >>
Database Sql Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
LINKS
Montignac Shop
motorola phone tools
online fax server
SSL
Video Surveillance
Gift to Pakistan
 
ADVERTISEMENT
 
PARTNER LIST

More
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising