WorksheetsDML
Total questions: 25
Worksheet time: 19mins
SQL is
Structured Query Language
Simple Query Language
Structured Question Language
Structure Quality Language
DML
(a)
To remove a record from a table which SQL statement would you use?
Remove
Cancel
Delete
Eradicate
Which statement is used to extract data from a database?
Extract
Get
Open
Select
Which statement allows us to add a record to a table?
Add To
Update To
Add Into
Insert Into
Which word is missing from the following SQL statement?
Select * table_name
With
Where
From
And
Which SQL statement would add a record to the database?
INSERT INTO Designer VALUES ('SMI01', 'M Smith', 'mail@msmith.com', '01224123456')
INSERT VALUES ('SMI01', 'M Smith', 'mail@msmith.com', 01224123456') INTO Designer
INSERT ('SMI01', 'M Smith', 'mail@msmith.com', '01224123456') INTO Designer
INSERT Designer INTO VALUES (''SMI01', 'M Smith', 'mail@msmith.com', '01224123456')
It is a DML command that is used to display record.
DISPLAY
STRUCTURE
WHERE
SELECT
______________ constraint prevents NULL values
UNIQUE
NOT NULL
NULL
FOREIGN KEY
A primary key can be NULL in the table? TRUE or FALSE
TRUE
FALSE
A clause in the SELECT command that specifies the condition the records must satisfy.
Table_name
WHERE
LIKE
Database name
This symbol is an SQL wildcard that can substitute for one or more characters when searching for data in a database.
$
%
=
*
You are required to update the phone number for only the DesignerID "SMI01" in the "Designer" table. Which of these would successfully do that?
UPDATE Designer SET PhoneNo = '01224123456'
UPDATE Designer (PhoneNo) VALUES ('01224123456')
UPDATE Designer SET PhoneNo = '01224123456' WHERE DesignerID = 'SMI01'
UPDATE PhoneNo = '01224123456' FROM Designer WHERE DesignerID = 'SMI01'
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
None of the mentioned
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
Here which of the following displays the unique values of the column?
SELECT ________ dept_name
FROM instructor;
from
like
unique
distinct
The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate.
Where, from
From, select
Select, from
From, where
Which of the following statements contains an error?
Select * from emp where empid = 10003;
Select empid from emp where empid = 10006;
Select empid from emp;
Select empid where empid = 1009 and lastname = ‘GELLER’;
In the given query which of the keyword has to be inserted?
INSERT INTO employee _____ (1002,'Joey',2000);
table
values
from
relation
SELECT * FROM sales WHERE amount > 200.
the query will display all the sales records with amounts starting from 200 and above
the query will display all the sales records with amounts less than 200
the query will display all the sales records with amounts greater than 200
the query will output sales records with the amount equal to 200.
In a LIKE clause, you can ask for any 6 letter value by writing
LIKE ______ (that's six underscore characters)
LIKE ...... (that's six dots)
LIKE .{6}
LIKE ??????
The SQL keyword BETWEEN is used:
For ranges.
To limit the columns displayed.
As a wildcard.
None of the above
SELECT * FROM cars WHERE Doors > 3
would return how many records?
1
2
3
4
SELECT * FROM Students WHERE Gender="Female" AND Class=2.2
would return how many records?
1
2
3
4
