COMP9. DATA MANIPULATION LANGUAGE

COMP9. DATA MANIPULATION LANGUAGE

9th Grade

30 Qs

quiz-placeholder

Similar activities

UTS Basisdata 12RPL sem 5 22-23

UTS Basisdata 12RPL sem 5 22-23

2nd Grade - University

30 Qs

QUIZ KELAS 9

QUIZ KELAS 9

9th Grade

25 Qs

SQL Pre Test

SQL Pre Test

9th - 11th Grade

33 Qs

Microsoft Access Intro

Microsoft Access Intro

9th - 12th Grade

30 Qs

DATABESES

DATABESES

9th - 11th Grade

26 Qs

SQL intro

SQL intro

8th - 12th Grade

26 Qs

Nat 5 Database Revision

Nat 5 Database Revision

9th - 10th Grade

27 Qs

Database

Database

KG - University

35 Qs

COMP9. DATA MANIPULATION LANGUAGE

COMP9. DATA MANIPULATION LANGUAGE

Assessment

Quiz

Computers

9th Grade

Medium

Created by

Michael Atienza

Used 6+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

You have a table Employees with columns EmployeeID, FirstName, LastName, and Position. How would you insert a new employee with the following details: EmployeeID = 101, FirstName = 'John', LastName = 'Doe', Position = 'Manager'?

INSERT INTO Employees (EmployeeID, FirstName, LastName, Position) VALUES (101, 'John', 'Doe', 'Manager');
SELECT * FROM Employees WHERE EmployeeID = 101;
DELETE FROM Employees WHERE EmployeeID = 101;
UPDATE Employees SET FirstName = 'John' WHERE EmployeeID = 101;

2.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

If a table Orders has columns OrderID, ProductName, and Quantity and you only want to insert a value for ProductName and Quantity, which command is correct?

INSERT INTO Orders (OrderID, ProductName) VALUES (1, 'ProductA');
INSERT INTO Orders (Quantity) VALUES (10);
INSERT INTO Orders (ProductName, Quantity) VALUES ('ProductA', 10);
INSERT INTO Orders (ProductName) VALUES ('ProductA', 10);

3.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What happens if you execute the following command and the StudentID column in the Students table is set to auto-increment?

The StudentID will be set to a random value.
The StudentID will reset to zero.
The StudentID will remain unchanged.
The StudentID will automatically increment to the next available value.

4.

MULTIPLE SELECT QUESTION

1 min • 2 pts

You have a table Products with columns ProductID, ProductName, Price, and Stock. Which of the following statements would add a new product named "Notebook" with a price of 15.99 and stock of 100?

INSERT INTO Products (ProductName, Price, Stock) VALUES ('Notebook', 15.99, 100);

    INSERT INTO Products VALUES (NULL, 'Notebook', 15.99, 100);

DELETE FROM Products WHERE ProductName = 'Notebook';
UPDATE Products SET Price = 15.99 WHERE ProductName = 'Notebook';

5.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What would happen if you attempt to execute the following command on a table where EmployeeID is the primary key and already contains the value 201?

INSERT INTO Employees (EmployeeID, FirstName, LastName) VALUES (201, 'Jake', 'Brown');

The insertion will fail due to a primary key constraint violation.
The command will create a duplicate entry without any error.
The command will update the existing record with EmployeeID 201.
The insertion will succeed and add a new record.

6.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

You are inserting data into a table with a column that allows NULL values. Which statement will successfully insert a NULL into that column?

INSERT INTO Sales (Product, Price) VALUES ('Pen', NULL);

INSERT INTO Sales (Product, Price) VALUES ('Pen', 'NULL');

INSERT INTO table_name (column_name) VALUES (DEFAULT);
INSERT INTO table_name (column_name) VALUES (0);

7.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

You have a table Customers with columns CustomerID, Name, and Email. If you want to add a new customer with only their Name and Email, leaving CustomerID to be auto-generated, which command should you use?

UPDATE Customers SET Name = 'Customer Name', Email = 'customer@example.com' WHERE CustomerID = 1;
SELECT * FROM Customers WHERE Name = 'Customer Name';
DELETE FROM Customers WHERE Name = 'Customer Name';
INSERT INTO Customers (Name, Email) VALUES ('Customer Name', 'customer@example.com');

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?