Search Header Logo

COMP9. DATA MANIPULATION LANGUAGE

Authored by Michael Atienza

Computers

9th Grade

Used 6+ times

COMP9. DATA MANIPULATION LANGUAGE
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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');

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?