Wednesday 13 November 2013

Palindrome


Palindrome Problem


A palindrome is a word that reads the same both forwards and backwards.
Examples: anna, nitalarbralatin, amanaplanacanalpanama.

Program -

#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
void main()
{char a[20],b[20];
cout<<"enter the string"<<endl;
gets(a);
strcpy(b,a);
strrev(b);
if(strcmpi(a,b)==0)
cout<<"palindrome"<<endl;
else
cout<<"nay"<<endl;
getch();
}

Tuesday 12 November 2013

SQL Select Command

SQL STATEMENT


SELECT Statement

The SELECT statement is used to select data from a database.
The result is stored in a result table, called the result-set.

 Syntax -

SELECT column_name(s)
FROM table_name
and
SELECT * FROM table_name
 Note: SQL is not case sensitive. SELECT is the same as select.

 SELECT DISTINCT Statement


In a table, some of the columns may contain duplicate values. This is not a problem, however, sometimes you will want to list only the different (distinct) values in a table.
The DISTINCT keyword can be used to return only distinct (different) values.

 Syntax -

SELECT DISTINCT column_name(s)
FROM table_name

The WHERE Clause

The WHERE clause is used to extract only those records that fulfill a specified criterion.

Syntax -

SELECT column_name(s)
FROM table_name
WHERE column_name operator value

The ORDER BY Keyword

The ORDER BY keyword is used to sort the result-set by a specified column.
The ORDER BY keyword sort the records in ascending order by default.
If you want to sort the records in a descending order, you can use the DESC keyword.

 Syntax -

SELECT column_name(s)
FROM table_name
ORDER BY column_name(s) ASC|DESC



Monday 11 November 2013

SQL

 SQL?

SQL  stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, Ingres, etc. Although most database systems use SQL, most of them also have their own additional proprietary extensions that are usually only used on their system. However, the standard SQL commands such as "Select", "Insert", "Update", "Delete", "Create", and "Drop" can be used to accomplish almost everything that one needs to do with a database. This tutorial will provide you with the instruction on the basics of each of these commands as well as allow you to put them to practice using the SQL Interpreter.

 SQL queries

The SQL queries are the most common and essential SQL operations. Via an SQL query, one can search the database for the information needed. SQL queries are executed with the “SELECT” statement. An SQL query can be more specific, with the help of several clauses:
  • FROM - it indicates the table where the search will be made.
  • WHERE - it's used to define the rows, in which the search will be carried. All rows, for which the WHERE clause is not true, will be excluded.
  • ORDER BY - this is the only way to sort the results in SQL. Otherwise, they will be returned in a random order.  
 Simple Exampl Of SQL  Sql Example

Artificial Intelligence (AI)

  Artificial Intelligence (AI) The Power and Potential of Artificial Intelligence Artificial Intelligence (AI) is revolutionizing the world ...