24 Questions
Which SQL statement is used to retrieve data from a database?
SELECT
Which SQL clause is used to filter data based on specified conditions?
WHERE
Which of the following is the CORRECT order of keywords for SQL SELECT statements?
SELECT, FROM, WHERE
The command to eliminate the table from a database is _____.
DROP TABLE Customer;
What is the difference between the DELETE and DROP commands?
DELETE command will delete row(s) of a table, while the DROP command delete the structure and content (data) of the table.
DELETE FROM Customer WHERE State =’Negeri Sembilan’; .
What does the following SQL statement do?
Deletes all records from the customer table where the state is equal to Negeri Sembilan.
What is the difference between the CREATE DATABASE and CREATE TABLE commands?
CREATE DATABASE is used to create a new database, while CREATE TABLE is used to create a new table within the existing database.
SQL can be used to:
i. Create database structures ii. Query database data iii. Modify database data
i, ii and iii
What happens when you omit the WHERE clause in a DELETE statement?
All rows in the table are removed.
Which of the following is a valid SQL type?
All of the above
What is the output of the following SQL statement?
SELECT * FROM employees;
Retrieves all rows and columns from the “employees” table
Which are Data Manipulation Language (DML) statements?
i. SELECT ii. ALTER iii. DROP iv. DELETE
i and iv
What will the following SQL do?
DROP DATABASE mydb;
Delete a database named mydb from the system
In UPDATE statement, choose the correct answer to update firstname= Mary to firstname = Marry from a table named “staff”.
UPDATE staff SET FName = ‘Marry’ WHERE LName =’Mary’;
Which of the following statement is TRUE about SQL?
SQL is used for managing and manipulating relational databases.
How do DML commands differ from DDL commands in SQL?
DML commands operate on existing tables, while DDL commands define how data is stored.
Which SQL statement is used to insert data into a table?
INSERT INTO
Which SQL statement is used to remove rows of data from the database table?
DELETE
In UPDATE statement, choose the correct answer to update firstname= Jamy to firstname = Jammy from a table named “staff”.
UPDATE staff SET FName = ‘Jammy’ WHERE LName =’Jamy’;
Which are Data Definition Language (DDL) statements?
i. SELECT ii. ALTER iii. DROP iv. DELETE
ii and iii
- What is the output of the following SQL statement?
SELECT * FROM student;
Retrieves all rows and columns from the “student” table
Which language is commonly used to query and manipulate data in a relational database?
SQL
Which of the following is NOT a valid SQL type?
CHARS
How does SQL update records in a database?
By modifying existing data values
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free