Showing posts with label uinix. Show all posts
Showing posts with label uinix. Show all posts

Friday, 22 July 2011

SQL Predicates


sql - predicates

SQL Predicates are found on the tail end of clauses, functions, and SQL expression inside of existing query statements. We've actually already covered a few SQL predicates already and most on this list should be familiar to you.

SQL Predicates:

AND
OR
LIKE
BETWEEN
AS
TOP(LIMIT)

sql - top

SQL Top is used to limit the number of results returned by a query. The top command is generally followed by a number that indicates the maximum number of results to return for a given query.

SQL Code:

use mydatabase;
 
SELECT TOP 2 *
FROM orders

SQL Results:

id
customer
day_of_order
product
quantity
1
Tizag
2008-08-01 00:00:00.000
Pen
4
2
Tizag
2008-08-01 00:00:00.000
Stapler
3

SQL Commands


sql - commands

SQL commands are lines of SQL code that ask the SQL application to perform simple tasks against with data inside of a database. Often we refer to commands as query statements or scripts; all of these terms are synonymous. Most of the commands and statements you will see in this tutorial are fairly standard and will work across multiple database applications despite the fact this tutorial is aimed for the SQL Server Express user.

SQL commands are declarative sentences or 'orders' executed against a SQL database. The typical command is comprised of several different components including clauses, functions, expressions, or objects but the only required components are a SQL Clause and the data object (a database or a database table).

sql - clauses

A SQL clause is the word or phrase that begins each SQL command statement and the single most important component to any SQL command. Looking at the clause of any given SQL command usually tells the SQL programmer what that particular command intends to do to the database. For instance, a SELECT command begins with the SELECT clause and any level of SQL programmer will recognize the SELECT query as a command selecting data from the database.
Other SQL clauses include:
  • Add
  • Drop
  • Create
  • Insert
  • Select
  • Update
  • Replace
  • Delete

sql - sample commands

SQL Code:

SELECT getdate(); -- Selects the current (server) date and time.
 
CREATE DATABASE MyDatabase; -- Creates a database named Mydatabase;
 
INSERT INTO orders 

 -- Inserts data into a database table
VALUES('A+Maintenance','8/16/08','Hanging Files',12);

SQL Platforms


sql - platforms applications


There are many, many different SQL applications in existence. A handful of platforms are available for free and are the preferred choice among individuals and small businesses. Other SQL platforms are designed with enterprise level customers in mind and are much more expensive


.

SQL Applications:

  • IBM's DB2
  • MySQL
  • PostgreSQL
  • Oracle
  • Microsoft's SQL Server



sql - mysql and postgresql


MySQL and PostgreSQL are open source database programs rich in functionality and flexibility. They are often the choice of web developers and small businesses simply because they are light-weight and are offered at the right price: free. Most open source software will also work across multiple different operating systems, which is yet another benefit to small businesses.


sql - sql server

Microsoft's SQL Server is steadily on the rise in the commercial world gaining popularity slowly. This platform is only available to Windows users at this time, but offers its users very user-friendly interface that is great for beginning SQL developers. A free trial version can be downloaded at the Microsoft website.


sql - db2 and oracle

By far the selection of choice for large corporations is either Oracle or DB2. Companies that have large ties to IBM stick to their DB2 software whereas others have made the switch to Oracle. These systems run on personal computers as well as large corporate mainframes and are ideal for processing vast amounts of data at the enterprise level.

Related Posts Plugin for WordPress, Blogger...