SQL 5 (Assignment)
SQL 5 (Assignment)
SQL 5 (Assignment)
OPEN
GET
EXTRACT
SELECT
SAVE
UPDATE
MODIFY
SAVE AS
REMOVE
DELETE
COLLAPSE
ADD NEW
INSERT INTO
ADD RECORD
INSERT NEW
6. With SQL, how do you select a column named "FirstName" from a table named
"Persons"?
7. With SQL, how do you select all the columns from a table named "Persons"?
SELECT Persons
SELECT [all] FROM Persons
SELECT *.Persons
SELECT * FROM Persons
8. With SQL, how do you select all the records from a table named "Persons" where
the value of the column "FirstName" is "Peter"?
9. With SQL, how do you select all the records from a table named "Persons" where
the value of the column "FirstName" starts with an "a"?
10. The OR operator displays a record if ANY conditions listed are true. The AND
operator displays a record if ALL of the conditions listed are true
False
True
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 UNIQUE
SELECT DIFFERENT
SELECT DISTINCT
14. Which SQL keyword is used to sort the result-set?
SORT
SORT BY
ORDER BY
ORDER
15. With SQL, how can you return all the records from a table named "Persons"
sorted descending by "FirstName"?
17. With SQL, how can you insert "Olsen" as the "LastName" in the "Persons"
table?
Theoritical Questions:
Queries:
Dept
Emp
SQL
Level –1
1)Write a query to list all the employees who are working as clerk
2) Write a query to list the employees who are working as clerks or
managers with the minimum salary of 4000
3) Write a query to get the current date
4) Write a query o list the employees who are having experience more
than 4 years
5) Write a query to list the employees who hired in the last seven days
6) Write a query to list the employees whose salaries are within the
range of 5000 and 10000
7) Write a query to list the employees who have joined in the month of
March’99
8) Write a query to list the employees whose salaries are not within
the range of 10000 and 13000
9) Write a query who are getting 1000, 2000, 3000
10) Query to list all employees except who are joined on 11- Sep-2001,
31-Mar-2002
11) To list all the employees whose names are having ‘O’ as second
character
12) To list all the employees whose names are having ‘R’ as last
character
13) To list all the employees whose names are having just 5 characters
as length.
14) To list all the employees whose names are starting with ‘R’ and
ending with ‘O’