WorksheetsUAS - PBD - INABA
Total questions: 50
Worksheet time: 25mins
The SQL WHERE clause:
limits the column data that are returned.
limits the row data that are returned.
Both A and B are correct
Neither A nor B is correct
Arrange the order of clauses in the select statement
FROM
WHERE
GROUP BY
HAVING
ORDER BY
Check
Used to limit column values to specific values
Delete
Remove specific rows
Unique
Will not allow duplicate
Having
Restrict the output after grouping
Distinct
Eliminate duplicate values
Drag the correct option into the correct box
SELECT (a) (b) users (c) (d) ='user1';
The command to remove rows from a table 'CUSTOMER' is:
REMOVE FROM CUSTOMER ...
DROP FROM CUSTOMER ...
DELETE FROM CUSTOMER WHERE ...
UPDATE FROM CUSTOMER ...
How can you change 'Thomas' to 'Michael' in the LastName column in the user table
UPDATE User SET LastName = 'Thomas' INTO LastName = 'Michel'
MODIFY Users SET LastName = 'Michel' WHERE LastName = 'Thomas'
MODIFY Users SET LastName = 'Thomas' INTO LastName = 'Michel'
UPDATE Users SET LastName = 'Michel' WHERE LastName = 'Thomas'
Complete the query by drag the correct option into the correct boxes.
To display the detail of employee having „e‟ in their name in descending order of salary
SELECT * (a) emp (b) ename LIKE "%e%" (c) SAL (d) ;
DDL
ALTER
DML
UPDATE
TCL
ROLLBACK
DCL
GRANT
Reorder the following
Order of keywords for SQL SELECT statements?
SELECT
FROM
WHERE
GROUP B Y
ORDER BY
DDL Stands for ___________.
Data Management Language
Data Manupulation Language
Data Development Language
Data Definition Language
The language used application programs to request data from the DBMS is referred to as __________
DDL
DML
Query Language
All of the mentioned
Match SQL language with SQL commands
1)DDL i)Revok, Grant
2)DML ii)rename a table
3)TCL iii)insert, update
4)DCL iv)rollback , commit
1-iii,2-i,3-ii,4-iv
1-iii,2-ii,3-iv,4-i
1-ii,2-iii,3-iv,4-i
1-i,2-iii,3-ii,4-iv
Which of the following is not a type of SQL statement?
Data Manipulation Language (DML)
Data Definition Language (DDL)
Data Control Language (DCL)
Data Communication Language (DCL)
In existing table, ALTER TABLE statement is used to
Add columns
Add constraints
Delete columns
Delete constrains
All the above
SQL Query to delete all rows in a table without deleting the table (structure, attributes, and indexes)
DELETE FROM table_name;
DELETE TABLE table_name;
DROP TABLE table_name;
None
Correct syntax query syntax to drop a column from a table is
DELETE COLUMN column_name;
DROP COLUMN column_name;
ALTER TABLE table_name DROP COLUMN column_name;
None is correct.
SQL has how many main commands for DDL:
1
2
3
4
Which command is used for removing a table and all its data from the database:
Create command
Drop table command
Alter table command
All of the mentioned
Which of the following language is used to specify database Schema ?
DDL
DML
DCL
None
What is a ‘tuple’?
A row or record in a database table
Another name for the key linking different tables in a database.
An attribute attached to a record.
Another name for a table in an RDBMS.
The command to remove rows from a table ‘CUSTOMER’ is:
REMOVE FROM CUSTOMER …
DROP FROM CUSTOMER …
DELETE FROM CUSTOMER WHERE …
UPDATE FROM CUSTOMER …
The command to eliminate a table from a database is:
REMOVE TABLE CUSTOMER;
DROP TABLE CUSTOMER;
DELETE TABLE CUSTOMER;
UPDATE TABLE CUSTOMER;
To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included
ONLY
UNIQUE
DISTINCT
SINGLE
With SQL, how do you select all the columns from a table named "Persons"?
SELECT [all] FROM Persons
SELECT Persons
SELECT * FROM Persons
SELECT *.Persons
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'
With SQL, how can you insert a new record into the "Persons" table?
INSERT ('Jimmy', 'Jackson') INTO Persons
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
With SQL, how can you return the number of records in the "Persons" table?
Next ❯
SELECT NO(*) FROM Persons
SELECT COLUMNS(*) FROM Persons
SELECT COUNT(*) FROM Persons
SELECT LEN(*) FROM Persons
The NOT NULL constraint enforces a column to not accept empty values.
Next ❯
TRUE
FALSE
Which operator is used to search for a specified pattern in a column?
GET
FROM
LIKE
SELECT * FROM employee WHERE salary>10000 AND dept_id=101;
Which of the following fields are displayed as output?
Salary, dept_id
Employee
Salary
All the field of employee relation
In the given query which of the keyword has to be inserted?
INSERT INTO employee _____ (1002,Joey,2000);
Table
Values
Relation
Field
CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL);
INSERT INTO employee VALUES (1005,Rach,0);
INSERT INTO employee VALUES (1007,Ross, );
INSERT INTO employee VALUES (1002,Joey,335);
Some of these insert statements will produce an error. Identify the statement.
Insert into employee values (1005,Rach,0);
Insert into employee values (1002,Joey,335);
Insert into employee values (1007,Ross, );
None of the mentioned
Which command is used for removing a table and all its data from the database:
Create command
Drop table command
Alter table command
All of the mentioned
Which constraint(s) can be used to make sure that the column is not left empty?
NOT NULL
UNIQUE
PRIMARY KEY
ALL THE ABOVE
______________ constraint prevents NULL values
UNIQUE
NOT NULL
NULL
FOREIGN KEY
5. ___________ constraint ensures that no two rows have the same value in the specified columns.
Primary Key
Unique
Default
Check
6. ___________ which helps to uniquely identify a record.
Primary key Constraint
Unique Constraint
Default constraint
Check constraint
A primary key can be NULL in the table? TRUE or FALSE
TRUE
FALSE
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
In the given query which of the keyword has to be inserted?
INSERT INTO employee _____ (1002,Joey,2000);
Table
Values
Relation
Field
CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL);
INSERT INTO employee VALUES (1005,Rach,0);
INSERT INTO employee VALUES (1007,Ross, );
INSERT INTO employee VALUES (1002,Joey,335);
Some of these insert statements will produce an error. Identify the statement.
Insert into employee values (1005,Rach,0);
Insert into employee values (1002,Joey,335);
Insert into employee values (1007,Ross, );
None of the mentioned
Which statement is used to extract data from a database?
Extract
Get
Open
Select
If you were wanting to filter data, which clause would you use?
Where
Order by
From
Select
Using which word allows you to specify that more than one condition must be met in a query?
Also
And
Or
Where
Using which word allows you to specify that only one of a series of conditions needs to be met in a query filter?
And
Maybe
If
Or
In order to amend data in a database we would use which SQL statement?
Update
Amend
Alter
Modify
To remove a record from a table which SQL statement would you use?
Remove
Cancel
Delete
Eradicate
Less than or equal to?
>=
=>
=<
<=
