Saturday, March 30, 2013

How to Send Email From Localhost to Gmail with PHP - Sending Email from Wamp Server to any other email account


Sending Email from Localhost Wamp Server to Gmail account with PHP script.




The PHP mail() function is not sufficient to send email from localhost and we have to purchase an email server to send email from php mail() function and we need to change some parameter in php.ini file, but if you want to check your email form on localhost and do not want to purchase any email server then here is a good tutorial for sending email with php code without changing any SMTP port and parameter values.

You just only be provide your gmail account and password in it and you can easily send email to any other account.


Here is a complete code for sending Email Download Code





Friday, March 29, 2013

Python Tutorials - Python Standard Types, Data Types in Python, How to Cast a type to another type in Python, Type casting in Python


Python Standard Types

Python Standard Types, Data Types in Python, How to Cast a type to another type in Python, Type casting in Python



The Python is a loosely typed language and there are no special name for data types like other programming languages like java, In Java, if we want to create a variable we must provide that a data type like int, double, String etc,but in python the variable automatically cast to assigned value type but we can say the python also categorize the variables into types. We now introduce you to the standard data types in Python.They include numbers and strings, or they are “containers,” or data structures, used to group together multiple Python objects. Before we introduce you to the main data types, it is worth first noting all Python objects have some inherent Boolean value.

Object Boolean Values


Like most other languages like java, c# etc, exactly two Boolean values can be expressed: True and False. All Python values can be represented as a Boolean value, regardless of their data values. For example, any numeric type equal to 0 is considered False while all nonzero (negative and positive) numeric values are True. Similarly, empty containers(like bool("")) are False while nonempty (bool(["hello",0]))containers are True. You can use the bool function to determine the Boolean value of any Python object; furthermore, True and False are legitimate values of their own and can be explicitly assigned as a variable’s value.


>>> process_executed = False
>>> bool(process_executed)
False
>>> bool(-3.78)
True
>>> bool(0.0)
False
>>> bool("")
False
>>> bool([None, 0])
True

The ABOVE examples and the output of bool should all make sense.In the Last example the bool() method have a container which has two values in it so it gives a True value as a result.

Numbers

Python has two primary numeric types: int (for integer) and float (for real number). Python has only one integer type, int, as compare to many other languages that have multiple integer types. floats are double-precision real numbers as like other programming languages.The following are some examples of ints and floats as well as


>>> 2.56 + 3.45
6.01
>>> -5 - 2
-7
>>> 2.1
2.1000000000000001

As like other programming languages the addition in above example the result is as expected but what about in the last example?
in C the range of float is only 6 charector but in python it range increase to 16 characters.
Python Built-in Numeric Types


TypeDescriptionExamples
intsigned integer(no size limit)-4, 0, 0xA2E2, 0453, 67
floatDouble precision floating point numbers3.45, 2.3e+5, -9., -4.6e, 0.894 
complexComplex (Real + Imaginary Numbers)4+1j, .5-j, -34.3e+2-40j


Numeric Built-in and Factory Functions(Conversion or Casting)


Each of the numeric types in Python has a factory function that are used  to convert from one numeric type to another. In other words we can say it “conversion” and “casting,” but we don’t use those terms in Python because we are not changing the type of an existing object.We are returning a new object based on the original object. It is very simple to convert as telling int(12.34) to create a new integer object with value 12 and the fraction will terminate while float(12) returns 12.0.

Python also provides the range of  built-in functions that apply to numbers, such as round() to round () floats to a specified number of digits or abs() for the absolute value of a number.The following are a few examples of these and other built-ins functions:


>>> int(63.89)
63

>>> int('256')
256
>>> float(45)
45.0

>>> round(4.25, 1)
4.3

>>> ord('A')
65

>>> divmod(21, 4)
(5, 1)

>>> chr(97)
'a'

Python Tutorials - Operators in Python, how to use operators in Python


Operators in Python, how to use operators in Python


As Like other programming Languages like C, C++, Java, C# etc the Python also supports the series of Operators, These include arithmetic operators, such as +, -, and *, and so on, assignment operators, +=, -=, *=, and so forth.This just means instead of z = z + 1, you can use z += 1.Absent are the increment/decrements operators (++ and --) you may have used in other programming languages. The standard comparison operators, such as <, >=, ==, !=, and so on, are also available,
and you can group clauses together with Boolean AND and OR with and & or, respectively.

There is also a not(!) operator that negates the Boolean value of a comparison.The
following example show you how its use.

display_output = True if display_output and shoo == 1:

print 'Django and %s are used to developed websites %d' % ('Python', shoo)

I assume you are familiar to programming with other programming languages and you know how to separates the one block of code to other block of code with curly braces({}) and terminate a statement with semi colon (;) but, in python there are no need to these symbols each block of code is separated with indentation

Python has an absence of symbols in general.

  • There are no delimiting braces({}) for separation of blocks of codes.
  • No trailing semicolon (;) to end lines of code
  • No dollar signs ($) for declaring variables like PHP,
  • No required parentheses (( )) for conditional statements (such as the preceding if , loops).
num1=10
num2=14
num3=num1+num2
for lettor in "Welcome in Python"
     print "current lettor :",lettor
print num3

output
current lettor :W
current lettor :e
current lettor l
current lettor :c
current lettor :o
current lettor :m
current lettor :e
current lettor :i
current lettor :n
current lettor :P
current lettor :y
current lettor :t
current lettor :h
current lettor :o
current lettor :n
24


Python Tutorials - Variables and assignments in Python, How to create a variable in Python, How to assign a value to a variable in Python


Variables and assignments in Python, How to create a variable in Python, How to assign a value to a variable in Python


Python is a loosely typed(loosely coupled) programming language it means Python’s variables do not need to be “declared” as holding a specific type of value, as in some other programming languages like C, C++, Java etc we must need to declare a variable with its specific type like int, float,double etc. Python is a “dynamically typed” language.Value assigned to the variable to convert implicitly to the its type and any range we can give it.
>>> shoo = 'Restaurant'
>>> shoo
'Restaurant'
>>> shoo = 4
>>> shoo
4

in above example, the variable shoo is mapped to a string object, 'Restaurant', but is then
remapped to an integer object, 4. Note the string that shoo used to refer to disappears, unless other variables are also referring to it (which is entirely possible!). Because you can remap variable names like this, you are never really 100 percent sure what type of object a variable is pointing to at any given time, unless you ask the interpreter for more information.

Python Tutorials - Comments in Python, How to Create Comments in Python, How to create Multiline Comments in Python


Comments in Python, How to Create Comments in Python, How to create Multiline Comments in Python


The Comments are the very important part of a programming language to give the explanation of a particular code for future reference and the Python is one of them, Comments in Python are denoted with the pound or hash mark (#).When that is the first character of a line of code, the entire line is deemed a comment.The # can also appear in the middle of the line; this means from the point where it is found, the rest of the same line is a comment. For example:

single line Comments

# this entire line is a comment

shoo = 1

# short comment: assign int 1 to 'shoo'

print 'Python and %s are used to develop the web applications these are number %d' % ('Django', shoo)



Multiline Commets

The multiline comments achieved in python with the help of """ for example

"""This is ..

Multiline....

Comments.... """

Comments are not only used to explain nearby code, but also to prevent what would otherwise be working code from executing. and these are also used to help in maintenance of the software in future. 
Monday, March 25, 2013

Python Tutorials - How to Run Python Program, How to run Python Program on Windows, Linux and other platform


How to Run Python Program, How to run Python Program on Windows, Linux and other platform

The Interactive Prompt


The Python is simply run on an interactive prompt which is provided by the python interprator for execute a python script. The interactive Prompt look like as >>> and each of code written after this is simply execute after press enter key.
The All operating system provide the facility to run the python programs with command prompts or terminals, The Python software comes with the interpretor name is python and the Linux comes with built in python interpretor and python interpretor also comes in exe for windows platform.
if you want to start interactive prompt just type python and the below screen comes

% python
Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] ...
Type "help", "copyright", "credits" or "license" for more information.
>>>

now you can type your code and press enter then you can see your output

• On Windows, you can type python in a Command Prompt console window. go to Start→Run... dialog box and type cmd and press enter, the command prompt window will appear now type the python and hit enter.
Note- To do this your python path should be set in environment variables.

• On Unix, Linux, and Mac OS X, you might type this command in a shell or terminal window (e.g., in an xterm or console running a shell such as ksh or csh).

• Other systems may use similar or platform-specific devices. On handheld devices, for example, you generally click the Python icon in the home or application window to launch an interactive session. If you have not set your shell’s PATH environment variable to include Python’s install
directory, you may need to replace the word “python” with the full path to the Python executable on your machine. On Unix, Linux, and similar,

Running Code Interactively

When the >>> has come, it’s started, the Python interactive session begins by printing two lines of informational text, then prompts for input with >>> when it’s waiting for you to type a new Python statement or expression. When we are working with interective prompt the results of your code are displayed after the >>> lines after you hit the Enter key.
For instance, here are the results of two Python print statements (print is really a function call in Python 3.0, but not in 2.6, so the parentheses here are required in 3.0 only): % python

>>> print('Hello Python World!')
Hello Python world!
>>> print(3 ** 4)
81

In above example the print function print the message which is passed into it, first print function print a string and second print the power of 3^4.

>>> status = 'okay'
>>> status
'okay'
>>> 3 ** 4
81
>>>

% <== Use Ctrl-D (on Unix) or Ctrl-Z (on Windows) to exit

Here, the fist line saves a value by assigning it to a variable, and the last two lines typed are expressions (status and 3 ** 4)—their results are displayed automatically. The main thing to notice is that the interpreter executes the code entered on each line immediately, when the Enter key is pressed.

Python Tutorials - Program Execution in Python, How to Program Execution is performed in Python


Program Execution in Python, How to Program Execution is performed in Python

Program Execution in python is a simplest way to write and run the python scripts on interactive prompt of any of the editor used to write the code and save it with .py extension and then run like this
python file_name.py hit enter

The Programmer’s View 


In the simplest way, a Python program is just a text file containing Python statements.
For example, the following file, named example.py, is the simplest way to write Python scripts, but it passes for a fully functional Python program:

>>>print('hello python world')
>>>print(3 ** 100)

The above file contains two Python print statements, which simply print a string ("hello python world") and a numeric expression result (3 to the power 100) to the output stream.

Python’s View

As like other programming languages the Python program also converts into something like a byte code and then also converts in machine code by something like a "virtual machine"

Byte code compilation

After compilation the Python source code converts into a Byte Code internally and you don't able to see it and sometimes the Byte Code converts for the piece of code individually and it is a secret code which is neither a source code nor a machine code, it is intermediate code and provide security and speed to the python programs execution.
The Byte Code can't be readable and it is look something like the combination of some special characters.

The Python Virtual Machine (PVM)

Once your program has been compiled to byte code , then it is send to generally known as the Python Virtual Machine (PVM). The PVM sounds more impressive than it is; really, it’s not a separate program it is inbuilt with the OS kernel, and it need not be installed by itself. In fact, the PVM is just a big loop that iterates through your byte code instructions, one by one, to carry out their operations. The PVM is wok as a real Machine but technically it is not a machine. The PVM is the run- time engine of Python. Technically, it’s just the last step of what is called the “Python interpreter.”


Performance implications

Readers with a background in fully compiled languages such as C and C++, Java, C# etc might notice a few differences in the Python model. One is, there is usually no "build" or “make” step in Python Execution, code runs immediately after it is written. Another is, Python byte code is not binary machine code. Byte code is a Python-specific representation of some hidden code.


In above figure -Python’s traditional run-time execution model, source code you type is translated or converted to byte code, which is then run or executed by the Python Virtual Machine. Your code is automatically compiled, but then it is interpreted.

Thursday, March 21, 2013

Features of Python - strength of Python over other languages, Python Features over the other languages


Strength of Python over other languages, Python Features over the other languages

How Is Python Supported?


Python is an open source programming language, It is a very powerful language to develop any kind of application like web application, mobile application, web services, windows application etc.

All the Operating system supports the python and any user whether he/she is used any of the O/S can write program on any O/S and can be run easily.


What Are Python’s Technical Strengths?


Naturally, this is a developer’s question. The Pythons Technical Strength are explained below


It’s Object-Oriented


Python is an object-oriented language, and as like other OOP's supported languages, Its class model supports advanced notions such as polymorphism, operator overloading, and multiple inheritance but, in the context of Python’s simple syntax and typing, OOP is remarkably easy to apply. In fact, if you don’t know about what are these terms, you’ll find they are much easier to learn with Python than with just about any other OOP's supported languages like C++, Java, C# etc available.


Python’s OOP's nature makes it ideal as a scripting tool for object-oriented systems languages such as C++, Java and C#. Much like C++, Python supports both procedural and object-oriented programming models. You can work with OOP and without OOP in Python


It’s Free


Python is completely free to use and distribute. As with other open source software, such as Tcl, Perl, Linux, and Apache, PHP, MySQL etc. You don't need to purchase any software to program with Python because its freely available for Download from its official site http://python.org.

The very important aspect is you can download the complete source code of python and you can modify it according to your need.

It’s Portable


The standard implementation of Python is written in portable ANSI C,and the Python programs can be execute on any platform easily. For example, Python programs run today on everything from PDAs to supercomputers. Here is a list where, Python is available on:

• Linux and Unix systems.
• Real-time systems such as VxWorks.
• Mac OS (both OS X and Classic).
• Cray supercomputers and IBM mainframes.
• Microsoft Windows and DOS (all modern flavors).
• Cell phones running Symbian OS and Windows Mobile.
• BeOS, OS/2, VMS, and QNX.
• Gaming consoles and iPods.
• PDAs running Palm OS, PocketPC, and Linux.
• Mac OS (both OS X and Classic).
• And more.

Python programs are automatically compiled to portable byte code, which runs the

same on any platform with a compatible version of Python installed

It’s Powerful


Python is an interpreted language but it strong tool set makes it very powerful language, The Python has the feature of scripting languages as well as the compiled languages also so these features makes it very powerful language to develop large scale of product with high functionality.


Dynamic typing


Python is a loosely typed language and there are no data types and no need to provide the range of the value into any of the value template.

The Python variable store any length of the value into it because of the Dynamic type nature of Python language.

Automatic memory management


Python is a OOP's supported language and there is a feature called "Garbage Collection" to automatically deallocates  the unused objects from the memory and free the memory for further storing of objects.


Built-in object types


Python provides commonly used data structures such as lists, dictionaries, tuples and

strings for working with arrays, dynamic arrays, and combination of characters, as you’ll see, they’re both flexible and easy to use. The Python's built-in objects can grow and shrink according to the need.

Built-in tools


Python provides the large collection of built-in library function and objects, To process all those object types and functions, Python comes with powerful and standard operations, including concatenation (joining collections), slicing (extracting sections),

sorting, mapping, and more.

Library utilities


If you want to use a specific task with your program like you want to use the Networking in your program for connect to the server you need to import the some library classes which is provided by the Python's large Library list.


Third-party utilities


Python is an Open Source language and it supports the large scale of third party utilities for communicate with the other software's or include any widget or any third party software to your program then the python provide the third party support for any kind of this work. 



It’s Mixable


Python program can be mixed with the C, C++ & Java, and the Python provides the API for mixing the other programming languages, If we use the Python with C it called the "Cython" and if we will use the Python with Java then it called the "Jython".


It’s Easy to Use


To run a Python program, you simply type it and run it. There are no compile and linking steps, Python also provide the large scale of built-in library function for minimizing the code of a program.

Python programs are very simple, easy to learn and very small as compare to other programming languages like C, C++, java etc.
Program written in Python is more small then program written in C, C++ or java.

It’s Easy to Learn


If you have experience of programming in any other programming languages then you can easily learn Python very quickly in less then 1 week and you don't need specify any starting point of a Python program as like the C, every C program should written inside the main function.





Use of Python - Python's Area - Companies using Python



Use of Python - Python's Area - Companies using Python
Python has a large user base and a very active developer community.
Because Python is 19 years old language, it is also very stable and robust, and portable language. Besides being employed by individual users.
The list of companies which are using Python in Large Scale--
• Google uses Python in its web search systems, and hire the Python Programmer.

• The YouTube video sharing service is written in Python also.


• Google’s very popular App Engine, web development framework uses Python as a primary application development language.


• EVE Online, a Massively Multi-player Online Game makes extensive use of Python.



• The popular Bit Torrent peer-to-peer file sharing system is developed in Python also.


• Intel,  HP, Cisco, Qualcomm, Seagate, and IBM use Python for testing the Hardware.


• Maya, a powerful integrated 3D modeling and animation system, provides a Python scripting API for developing Games.


• JPMorgan Chase, Getco,  UBS,and Citadel apply Python for financial market forecasting.


• Industrial Light & Magic, Pixar, and others use Python for production of large animated movies.

• iRobot develop commercial robotic devices in Python also.


• ESRI uses Python as an end-user customization tool for its popular GIS mapping products.


• Los Alamos, NASA, JPL,  Fermilab, and others use Python for scientific programming tasks.


• The One Laptop Per Child project builds its user interface and activity model in Python.


• The IronPort email server product uses more than 1 million lines of Python code to do its job.


• The NSA uses Python for cryptography and intelligence analysis.





What is Python - Why Python is useful, History of Python


What is Python - Why Python is useful, History of Python

Python is not a new language, it is 22 years old language, in fact it was released by its designer, Guido Van Rossum, in February 1991 while working for CWI also known as Stichting Mathematisch Centrum. Many of Python's features originated from an interpreted language called ABC.


Rossum thinks to correct some of ABC's problems and keep some of its features. At the time he was working on the Amoeba distributed operating system group and was looking for a scripting language with a syntax like ABC but with the access to the Amoeba system calls, so he decided to create a language that was generally extensible.


Python actually got its name from a BBC comedy series from the

seventies "Monty Python's Flying Circus". The designer needed

 a name that was short, unique, and slightly mysterious. Since he

was a fan of the show he thought this name was great.


What Can We Do with Python?


Python is an open source programming language, It is a very powerful language to develop any kind of application like web application, mobile application, web services, windows application etc.
All the Operating system supports the python and any user whether he/she is used any of the O/S can write program on any O/S and can be run easily.
In addition to being a well-designed programming language, Python is useful for accomplishing real-world tasks—the sorts of things developers do day in and day out. 

Python is an object-oriented language, and as like other OOP's supported languages, Its class model supports advanced notions such as polymorphism, operator overloading, and multiple inheritance but, in the context of Python’s simple syntax and typing, OOP is remarkably easy to apply. In fact, if you don’t know about what are these terms, you’ll find they are much easier to learn with Python than with just about any other OOP's supported languages like C++, Java, C# etc available.

Python’s OOP's nature makes it ideal as a scripting tool for object-oriented systems languages such as C++, Java and C#. Much like C++, Python supports both procedural and object-oriented programming models. You can work with OOP and without OOP in Python





Things which  can be done with Python

  • Systems Programming.

  • Graphical User Interface.

  • Internet Scripting and Website Development.

  • Component Integration

  • Database Programming

  • Rapid Prototyping

  • Numeric and Scientific Programming

  • Gaming, Images, Serial Ports, XML, Robots, and More

Monday, March 11, 2013

Online Mobile Shop Project Free Download - Free Download Online Mobile Shop Project in Asp.Net


Online Mobile Shop Project Free Download - Free Download Online Mobile Shop Project in Asp.Net




The Online Mobile Shop project is used to show the all Mobiles to the customers any customer can see the latest mobiles available in market through the website and can make query and purchase a product.


To get This project Contact me

Talib Hassan
Email- thussain520@gmail.com
Contact No- 8802932594 
Sunday, March 10, 2013

Chess Game project in Java free download , Online chess game project for CS/IT students free download


Chess Game project in Java free download , Online chess game project for CS/IT students free download





This Game is an online game for playing chess with partners and every user is able to create their user account and then login to their account and play chess with partners.

The Project Contains:-


  • The Game Code in Applet.
  • HTML Home page.
  • Jsp Pages for database connectivity.
  • Database.


To get This project Contact me

Talib Hassan
Email- thussain520@gmail.com
Contact No- 8802932594 




Saturday, March 9, 2013

How to set javac path - setting up jdk path, How to set java path in environment variables


How to set javac path - setting up jdk path, How to set java path in environment variables

To compile and run a java program from command prompt we need to tell the java compiler and java interpreter path to the DOS System because javac and java commands are not defined in command prompt so we explicitly tell the javac and java path to the DOS command prompt.


Setting Up Java path:-


There are few steps to set the java path for command prompt.

The first method to set up path for one time...

>> Open Command prompt

>> Go to your directory where your program is saved.
If your program saved in "javawork" folder in D drive, change your directory like this.

c:\Program Files>D:

now you are in d drive and the path is now like this..

D:\>

Now change the directory like this

D:\>cd javawork press enter

Now you are in javawork directory and the path look like this.

D:\javawork>

now write your jdk path setting string like this

D:\javawork>set path=%path%;C:\Program Files\Java\jdk1.7.0\bin press enter
 
Now your path set for one time, this path scope will remain till the command prompt is open now, write your program name like this
 
D:\javawork>javac programname.java press enter
 
If your program doesn’t have any error then your program is compiled successfully and the screen show like this  

D:\javawork>

Now you need to run your program like this

D:\javawork>java programname press enter

If your program does not have any runtime error then you can see your desired output..


 This method to set up path for all time...


Go to your java installation files like by default the jdk is installed in c:\Program Files\java\jdk 1.7.0\bin

so if your jdk installed in same directory so simply go to your installation path and copy the path from windows explorer address bar.

after copying the path right click on My Computer and the click on properties.

if you are using windows xp then you are directly see a button with name Environment Variables,
if you are using higher version of windows then you see the Advance System Settings and then you can see Environment Variables Button.

click on this button and you see the user variables click on new button, a new window appear with two text boxes write path on first textbox and paste the copied path into the second textbox then ; and then ok ok ok.


Now your path has been set and you can directly run your program by following the above steps

Friday, March 8, 2013

Free Download Library Management System Project in .Net - Library Management System final year project free download


Free Download Library Management System Project in .Net - Library Management System final year project free download



The Library Management System is a System which helps a Librarian to track out all books, like how many books are available, how many books taken by the students, total books, pending books, fine etc.

This project makes in .net and have all files including database.


Download this project

Download Help

Click on above link
then click on regular download
then wait for 1 minute to appear the download button

Thanks for visiting



Thursday, March 7, 2013

Online Shopping Project in Asp.Net free Download - Online Shopping Portal Project in ASP , Final Year Project for CS, IT Students


Online Shopping Project in Asp.Net free Download - Online Shopping Portal Project in ASP , Final Year Project for CS, IT Students





The Online Shopping Portal is used to shop the various kind of products online through the vendor website.

The Project Contains:-


  • User Accounts-
  • Admin Accounts-
  • Products-
  • Shopping Cart-
  • Style sheet Pages-
  • JavaScript Pages-
  • Database-



To get This project Contact me

Talib Hassan
Email- thussain520@gmail.com
Contact No- 8802932594

Download Project
Download Help


  • Click on above link
  • By clicking above link you will redirect Depositfiles.com
  • Now click on regular download
  • wait for 1 minute to appear download button 

Thanks & Regards
Talib Hassan



Insert into Statement in SQL - How to insert records into a table, Insert data into a table


Insert into Statement in SQL - How to insert records into a table, Insert data into a table

The INSERT INTO Statement is used to insert new records or new row into a table. There are two ways to insert records into a table.

Inserting whole records into a table row:-

This syntax is used to insert the all records or columns into a table. we can not leave any blank record into a row in a table with this syntax.

Syntax:-

insert into <table_name> values(value1,value2,.........value n)

Example:-

insert into student_info values('John','M.Tech','California',5647839)


Inserting few records into a Table:-

This syntax is used to insert some values into a table row. Its not recommended you should insert all records into a table row, you can insert values which you want to insert.

Syntax:-

insert into <table_name>(column_name1,column_name2,column_name3,.......column_name n) values(value1,value2,value3,.........,value n)

Example:-

insert into student_info(stu_name,stu_address,stu_course) values('John','California','M.tech')
Tuesday, March 5, 2013

Alter Table - How to Add a column in a Table and How to Delete a column from a Table


Alter Table - How to Add a column in a Table and How to Delete a column from a Table

The Alter Table statement is used to add, delete or modify the columns of an existing table. Sometimes we need to add a column into an existing table, delete a column from an existing table or modify the structure of the columns like data type, range etc into an existing table then the Alter Table statement is very useful.  

Adding a Column into a Table:-

alter table <table_name> add <column_name datatype>

alter table student_info add (course varchar(30)

Deleting a Column from a Table:-

alter table <table_name> drop <column_name>

alter table student_info drop course

Modify a column into a Table:-


alter table <table_name> modify <column_name datatype>

alter table student_info modify (course varchar(50))



Saturday, March 2, 2013

How to Drop a Table in SQL - Truncate a Table in SQL - SQL Drop and Truncate a Table


How to Drop a Table in SQL - Truncate a Table in SQL - SQL Drop and Truncate a Table 

The drop table command in sql allows you to drop or delete an existing table from the database. It delete the all data as well as the structure of a table from the database.

Syntax for dropping a table:-

drop table <tablename>

Example:-

drop table student_record

Truncating a Table in SQL:-

The truncate command in sql allows you to delete all data from the existing table but the structure of table remain as it is.

This command is same as "delete from <table_name>"

Syntax for truncate a table

truncate table <table_name>

Example:-

truncate table Student_info
Friday, March 1, 2013

Data Types in SQL - List of Data Types in SQL, Data Types in Oracle, Data Types in MySql, MS Access Data Types


Data Types in SQL - List of Data Types in SQL, Data Types in Oracle, Data Types in MySql, MS Access Data Types
Data Types are used to store the kind of data into a table columns. Every columns in database has its own data type.

The SQL Data Types change according to the Database. I am Showing The list of common Data Types according to the Databases.

MS Access Data Types:-

Text - Text is used to store the combination of Characters maximum range is 255 characters only.
Memo - Memo is used to store the combination of characters maximum range is 65,536 characters.
Byte - Used to store the numbers range is 0 to 255.
Integer - Used to store the numbers range is -32768 to 32767.
Long - Used to store the numbers range is -2,147,483,648 to 2,147,483,647.
Double - Used to store real numbers.
Currency - Used to store the currency according to the country. you can store 15 digit's currency with 4 decimal points.
AutoNumber - Used to give the number automatically to the field usually start from 1 but you can change the starting point. 

Oracle Data Types:-


Char() - Char is used to store the combination of Characters maximum range is 2000 characters only and once the lenght is given to the column with char it is fixed.
Varchar - Varchar is used to store the combination of Characters as well the only difference b/w char and varchar is the varchar size depends upon the characters inputted. 
Currency - Used to store the currency according to the country. you can store 15 digit's currency with 4 decimal points.
AutoNumber - Used to give the number automatically to the field usually start from 1 but you can change the starting point.