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
6Activity
0 of .
Results for:
No results containing your search query
P. 1
SQL 5(Assignment)

SQL 5(Assignment)

Ratings:

4.0

(1)
|Views: 994 |Likes:
Published by bookworm_shashi
For all Accy Friends
For all Accy Friends

More info:

Published by: bookworm_shashi on Aug 31, 2008
Copyright:Attribution Non-commercial

Availability:

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

05/09/2014

pdf

text

original

 
SQL Assignment
1. What does SQL stand for?Structured Question LanguageStructured Query LanguageStrong Question Language
2. Which SQL statement is used to extract data from a database?
OPENGETEXTRACTSELECT
3. Which SQL statement is used to update data in a database?
SAVEUPDATEMODIFYSAVE AS
4. Which SQL statement is used to delete data from a database?
REMOVEDELETECOLLAPSE
5. Which SQL statement is used to insert new data in a database?
ADD NEWINSERT INTOADD RECORDINSERT NEW
 
6. With SQL, how do you select a column named "FirstName" from a table named"Persons"?
EXTRACT FirstName FROM PersonsSELECT Persons.FirstNameSELECT FirstName FROM Persons
7. With SQL, how do you select all the columns from a table named "Persons"?
SELECT PersonsSELECT [all] FROM PersonsSELECT *.PersonsSELECT * FROM Persons
8. With SQL, how do you select all the records from a table named "Persons" wherethe value of the column "FirstName" is "Peter"?
SELECT * FROM Persons WHERE FirstName='Peter'SELECT [all] FROM Persons WHERE FirstName='Peter'SELECT * FROM Persons WHERE FirstName LIKE 'Peter'SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
9. With SQL, how do you select all the records from a table named "Persons" wherethe value of the column "FirstName" starts with an "a"?
SELECT * FROM Persons WHERE FirstName='%a%'SELECT * FROM Persons WHERE FirstName='a'SELECT * FROM Persons WHERE FirstName LIKE '%a'SELECT * FROM Persons WHERE FirstName LIKE 'a%'
10. The OR operator displays a record if ANY conditions listed are true. The ANDoperator displays a record if ALL of the conditions listed are true
FalseTrue
12. With SQL, how do you select all the records from a table named "Persons"where the "LastName" is alphabetically between (and including) "Hansen" and"Pettersen"?
SELECT * FROM Persons WHERE LastName>'Hansen' ANDLastName<'Pettersen'
 
SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND'Pettersen'SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons 
13. Which SQL statement is used to return onlydifferent values?
SELECT UNIQUESELECT DIFFERENTSELECT DISTINCT
14. Which SQL keyword is used to sort the result-set?
SORTSORT BYORDER BYORDER 
15. With SQL, how can you return all the records from a table named "Persons"sorted descending by "FirstName"?
SELECT * FROM Persons ORDER BY FirstName DESCSELECT * FROM Persons ORDER FirstName DESCSELECT * FROM Persons SORT BY 'FirstName' DESCSELECT * FROM Persons SORT 'FirstName' DESC
16. With SQL, how can you insert a new record into the "Persons" table?
INSERT VALUES ('Jimmy', 'Jackson') INTO PersonsINSERT ('Jimmy', 'Jackson') INTO PersonsINSERT INTO Persons VALUES ('Jimmy', 'Jackson').
17. With SQL, how can you insert "Olsen" as the "LastName" in the "Persons"table?
INSERT INTO Persons ('Olsen') INTO LastNameINSERT INTO Persons (LastName) VALUES ('Olsen')INSERT ('Olsen') INTO Persons (LastName)
18. How can you change "Hansen" into "Nilsen" in the "LastName" column in thePersons table?
UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'MODIFY Persons SET LastName='Hansen' INTO LastName='NilsenUPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'

Activity (6)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
aliyu.aisha3408 liked this
mani7031987 liked this
mani7031987 liked this
man85deep liked this

You're Reading a Free Preview

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