Font size
WorksheetsSQL Fundamentals_Amr
Total questions: 50
Worksheet time: 24mins
What does SQL stand for?
Structured Query Language
Standard Query Language
Strong Query Langauge
Which SQL statement is used to extract data from a database?
EXTRACT
Get
OPEN
SELECT
Which SQL statement is used to update data in a database?
MODIFY
SAVE AS
UPDATE
SAVE
Which SQL statement is used to delete data from a database?
Modify
DELETE
MOVE
Which SQL statement is used to insert new data in a database?
ADD RECORD
INSERT NEW
INSERT INTO
ADD NEW
_______used to Create, Manage database objects in the database.
DDL
DML
DCL
DQL
You issue the following query: SELECT empno, ename FROM emp WHERE empno = 7782 OR empno = 7876; Which other operator can replace the OR condition in the WHERE clause
IN
BETWEEN.. AND..
LIKE
Roll Back segment is not used in case of:
DCL
DDL
DQL
All of the above
You query the table with this commandSELECT nameFROM employeeWHERE name LIKE '_a%'; Which names are displayed?
Names starting with “a”
Names containing “a” as any letter except the first
Names containing “a” as second character
Names starting with “a” or “A”
How does a TRUNCATE TABLE statement differ from an unrestricted DELETE? Select all that apply.
Using TRUNCATE all the values in the table will be deleted but not the structure whereas as In Delete a particular row can be deleted but not the structure
Using TRUNCATE all the values in the table will be deleted and the structure as well but whereas as In Delete a particular row can be deleted but not the structure
Using TRUNCATE all the values in the table will be deleted but not the structure whereas as In Delete a particular row can be deleted and the structure as well
None of the Above
How many columns are retrieved from this query: SELECT address1||','||address2||','||address2 "Address" FROM employee;
1
2
3
4
The following are clauses of the SELECT statement:1. WHERE 2. FROM 3. ORDER BY In which order should they appear in a query?
1, 3, 2
2, 1, 3
2, 3, 1
With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?
DELETE FROM Persons WHERE FirstName = 'Peter'
DELETE FirstName='Peter' FROM Persons
DELETE ROW FirstName='Peter' FROM Persons
DELETE Persons WHERE FirstName = 'Peter'
With SQL, how do you select a column named "FirstName" from a table named "Persons"?
SELECT Persons. FirstName
SELECT First Name FROM persons
SELECT FirstName FROM Persons
EXTRACT FirstName FROM Persons
Which command will delete all data from a table and will not write to the rollback segment?
Drop
Cascade
Truncate
Delete
Which of the following are parts of a SELECT statement? Choose all that apply.
FROM
DEFINE
WHERE
DESELECT
Which of the following statements contains an error?
SELECT * FROM emp WHERE empid = 493945;
SELECT empid FROM emp;
SELECT empid FROM emp WHERE empid= 493945;
SELECT empid WHERE empid = 56949 AND lastname = ‘SMITH’;
How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
Choose correct syntax to insert values into r4r_team table
INSERT INTO r4r_team (id, username, exp) VALUES (1, ‘r4r01’, ‘2’);
INSERT IN r4r_team VALUES (1, ‘r4r01’, ‘2’);
INSERT INTO r4r_team (id, username, exp) VALUE (1, ‘r4r01’, ‘2’);
INSERT INTO table r4r_team (id, username, exp) VALUE (1, ‘r4r01’, ‘2’);
With SQL, how do you select all the columns from a table named "Persons"?
SELECT [all] FROM Persons
SELECT * FROM Persons
SELECT *.Persons
SELECT Persons
With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
INSERT INTO Persons ('Olsen') INTO LastName
INSERT INTO Persons (LastName) VALUES ('Olsen')
INSERT ('Olsen') INTO Persons (LastName)
INSERT IN Persons ('Olsen') INTO LastName
With SQL, how can you insert a new record into the "Persons" table?
INSERT ('Jimmy', 'Jackson') INTO Persons
INSERT Persons values ('Jimmy', 'Jackson')
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
Which Operators combine the results of two-component queries into a single result?
Character Operators
Comparison Operators
Set Operators
Miscellaneous Operators
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"?
SELECT FROM Persons WHERE FirstName='%a%'
SELECT FROM Persons WHERE FirstName LIKE '%a'
SELECT FROM Persons WHERE FirstName='a'
SELECT FROM Persons WHERE FirstName LIKE 'a%'
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
True
False
Which SQL statement is used to return only different values?
Next ❯
SELECT DIFFERENT
SELECT UNIQUE
SELECT DISTINCT
Which SQL keyword is used to sort the result-set?
ORDER BY
SORT BY
ORDER
SORT
With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?
DELETE FirstName='Peter' FROM Persons
DELETE ROW FirstName='Peter' FROM Persons
DELETE FROM Persons WHERE FirstName = 'Peter'
With SQL, how can you return the number of records in the "Persons" table?
SELECT LEN(*) FROM Persons
SELECT COUNT(*) FROM Persons
SELECT COLUMNS(*) FROM Persons
SELECT NO(*) FROM Persons
What is the most common type of join?
JOINED TABLE
INSIDE JOIN
JOINED
INNER JOIN
Which operator is used to select values within a range?
RANGE
BETWEEN
WITHIN
Which operator is used to search for a specified pattern in a column?
GET
LIKE
FROM
Which SQL function is used to count the number of rows in a SQL query?
COUNT()
NUMBER()
SUM()
The FROM SQL clause is used to…
Specify range for search condition
Specify search condition
Specify what table we are selecting or deleting data from.
Which of the following is NOT a SQL keyword or SQL clause?
INSERT
SELECT
UPDATE
INVERT
The UNION SQL clause can be used with…
The SELECT clause only
The DELETE and UPDATE clauses
The UPDATE clause only
None of the other three
What does DML stand for?
Data Mode Lane
Data Model Language
Data Manipulation language
Different Mode Level
Which SQL keyword is used to retrieve a maximum value?
MOST
MAX
TOP
UPPER
Which of the following SQL clauses is used to enter data into a SQL table?
INSERT INTO
WRITE
SELECT
ENTER
Which of the following SQL clauses is used to DELETE data from a database table?
DELETE
REMOVE
DROP DATA
CLEAR
Which of the following SQL statements is correct?
SELECT CustomerName, COUNT(CustomerName) FROM Orders
SELECT CustomerName, COUNT(CustomerName) FROM Orders GROUP BY CustomerName
SELECT CustomerName, COUNT(CustomerName) FROM Orders ORDER BY CustomerName
If you don't specify ASC or DESC after a SQL ORDER BY clause, the following is used by default:
ASC
DESC
There is no default value.
When inserting data in a table do you always have to specify a list of all column names you are inserting values for?
No
Yes
Which of the following 3 SQL statements is correct?
SELECT Username, Password FROM Users
SELECT Username AND Password FROM Users
SELECT Username, Password WHERE Username = 'user1'
What does follow after the SQL WHERE clause?
Definition of the condition to be met for the rows to be returned.
A list of columns to be selected.
The name of the table we are selecting from.
What does the ALTER TABLE clause do?
The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints.
The SQL ALTER TABLE clause is used to insert data into database table.
THE SQL ALTER TABLE deletes data from database table.
The SQL ALTER TABLE clause is used to delete a database table.
What is the purpose of the SQL AS clause?
The AS SQL clause is used change the name of a column in the result set
The AS clause is used with the JOIN clause only.
The AS clause defines a search condition.
The IN SQL keyword…
Is used with the DISTINCT SQL keyword only.
Determines if a value matches any of the values in a list or a sub-query.
Defines the tables we are selecting or deleting data from
The UPDATE SQL clause can…
Update only one row at a time.
Update more than one row at a time.
Delete more than one row at a time.
Delete only one row at a time..
Which of the following statements gets the total value of the column 'Price' in the 'Sales' table?
SELECT ADD(Price) FROM Sales
SELECT SUM(Price) FROM Sales
SELECT TOTAL(Price) FROM Sales
SELECT SUM(Price) WHERE Sales
