Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
sql file

sql file

Ratings: (0)|Views: 6|Likes:
Published by amant
sql commands
sql commands

More info:

Published by: amant on Dec 03, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

03/30/2014

pdf

text

original

 
 DATABASE MANAGEMENT SYSTEM LAB
SUBMITTED BY:AMANT KUMARB.TECH (CSE) (2010-2014)
 
SELECT
A common use of this command is to select data from the tables locatedin a database. We see two keywords: we need to
SELECT
information
FROM
a table. Hence SQL structure:
SELECT "column_name" FROM "table_name"
 Table
Store_Information
SELECT
store_name
FROM
Store_Information
Result:
 store_nameLos AngelesSan DiegoLos AngelesBostonMultiple column names can be selected, as well as multiple table names.store_name Sales DateLos Angeles $1500 Jan-05-1999San Diego $250 Jan-07-1999Los Angeles $300 Jan-08-1999Boston $700 Jan-08-1999
 
DISTINCT
The
SELECT
keyword allows us to grab all information from a column (orcolumns) on a table. This, of course, necessarily mean that there will beredundancies. All we need to do is to add
DISTINCT
after
SELECT
. Thesyntax is as follows:
SELECT DISTINCT "column_name" FROM "table_name"
Table
Store_Information
 store_name Sales DateLos Angeles $1500 Jan-05-1999San Diego $250 Jan-07-1999Los Angeles $300 Jan-08-1999Boston $700 Jan-08-1999we key in,
SELECT DISTINCT store_name FROM Store_Information
Result:
 store_nameLos AngelesSan DiegoBoston

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->