Thursday , 22 October 2020
Stackode
Home > Tag Archives: SQL

Tag Archives: SQL

RDBMS Concepts – SQL

What is RDBMS? RDBMS stands for Relational Database Management System. RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd. What is ...

Read More »

Delete Query – SQL

Delete Query – SQL is used to delete the existing records from a table. You can use WHERE clause with DELETE query to delete selected rows, otherwise all the records would be deleted. Syntax: The basic syntax of DELETE query with WHERE clause is as follows: DELETE FROM table_name WHERE [condition]; You can combine N number of conditions using AND ...

Read More »

Having Clause – SQL

Having Clause – SQL enables you to specify conditions that filter which group results appear in the final results. The WHERE clause places conditions on the selected columns, whereas the HAVING clause places conditions on groups created by the GROUP BY clause. Syntax: The following is the position of the HAVING clause in a query: SELECT FROM WHERE GROUP BY ...

Read More »

SQRT Function SQL

SQRT Function SQL is used to find out the square root of any number. You can Use SELECT statement to find out square root of any number as follows: SQL> select SQRT(16); +----------+ | SQRT(16) | +----------+ | 4.000000 | +----------+ 1 row in set (0.00 sec) You are seeing float value here because internally SQL will manipulate square root ...

Read More »

Databases – SQL

Databases – SQL There are many popular RDBMS available to work with. This tutorial gives a brief overview of few most popular RDBMS. This would help you to compare their basic features. MySQL MySQL is an open source SQL database, which is developed by Swedish company MySQL AB. MySQL is pronounced “my ess-que-ell,” in contrast with SQL, pronounced “sequel.” MySQL ...

Read More »

LIKE Clause – SQL

LIKE Clause – SQL is used to compare a value to similar values using wildcard operators. There are two wildcards used in conjunction with the LIKE operator: The percent sign (%) The underscore (_) The percent sign represents zero, one, or multiple characters. The underscore represents a single number or character. The symbols can be used in combinations. Syntax: The ...

Read More »

Transactions – SQL

Transactions – SQL is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order, whether in a manual fashion by a user or automatically by some sort of a database program. A transaction is the propagation of one or more changes to the database. For example, if you ...

Read More »

RAND Function SQL

RAND Function SQL that can be invoked to produce random numbers between 0 and 1: SQL> SELECT RAND( ), RAND( ), RAND( ); +------------------+-----------------+------------------+ | RAND( ) | RAND( ) | RAND( ) | +------------------+-----------------+------------------+ | 0.45464584925645 | 0.1824410643265 | 0.54826780459682 | +------------------+-----------------+------------------+ 1 row in set (0.00 sec) When invoked with an integer argument, RAND( ) uses that value ...

Read More »

Syntax – SQL

Syntax – SQL is followed by unique set of rules and guidelines called Syntax. This tutorial gives you a quick start with SQL by listing all the basic SQL Syntax: All the SQL statements start with any of the keywords like SELECT, INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, USE, SHOW and all the statements end with a semicolon (;). Important ...

Read More »

TOP, LIMIT or ROWNUM Clause – SQL

TOP, LIMIT or ROWNUM Clause – SQL is used to fetch a TOP N number or X percent records from a table. Note: All the databases do not support TOP clause. For example MySQL supports LIMIT clause to fetch limited number of records and Oracle uses ROWNUM to fetch limited number of records. Syntax: The basic syntax of TOP clause ...

Read More »