infy

infy

University

20 Qs

quiz-placeholder

Similar activities

MB-8

MB-8

University

15 Qs

Parallel & Distributed Database

Parallel & Distributed Database

University

20 Qs

ITDB202 - SQL DDL, DML and TCL Statements

ITDB202 - SQL DDL, DML and TCL Statements

12th Grade - University

17 Qs

Database Management Systems

Database Management Systems

University

19 Qs

SQL Quiz

SQL Quiz

University

19 Qs

Pretest DBMS

Pretest DBMS

University

25 Qs

CS 316 - Web Systems and Technologies 2( Midterm Exam)

CS 316 - Web Systems and Technologies 2( Midterm Exam)

University

21 Qs

Round 1 for Preplacement Bootcamp.

Round 1 for Preplacement Bootcamp.

University

15 Qs

infy

infy

Assessment

Quiz

Computers

University

Hard

Created by

NV CHALLA

Used 2+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. Which SQL command creates a table named Employees with columns EmpID (integer) and EmpName (varchar 50)?

CREATE TABLE Employees (EmpID INT, EmpName VARCHAR(50));

CREATE Employees TABLE (EmpID INT, EmpName VARCHAR(50));

TABLE CREATE Employees (EmpID INT, EmpName VARCHAR(50));

CREATE TABLE Employees (EmpID VARCHAR(50), EmpName INT);

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. How to add a new column JoiningDate of type DATE to the Employees table?

CREATE TABLE Employees (JoiningDate DATE);
UPDATE Employees SET JoiningDate = CURRENT_DATE;
ALTER TABLE Employees ADD JoiningDate DATE;
ALTER TABLE Employees ADD COLUMN JoiningDate;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. What will this query do? DELETE FROM Employees WHERE EmpID = 100;

It removes the employee with EmpID 100 from the Employees table.
It updates the employee's details with EmpID 100 in the Employees table.
It adds a new employee with EmpID 100 to the Employees table.
It retrieves the employee with EmpID 100 from the Employees table.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. How do you rename the column EmpName to EmployeeName in the Employees table?

UPDATE Employees SET EmpName = 'EmployeeName';
RENAME TABLE Employees TO NewEmployees;
ALTER Employees CHANGE EmpName EmployeeName;
ALTER TABLE Employees RENAME COLUMN EmpName TO EmployeeName;

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. Which query inserts a new employee with EmpID = 10 and EmpName = 'Rahul'?

INSERT INTO Employees (EmpID, EmpName) VALUES (10, 'Rahul');
INSERT Employee VALUES (10, 'Rahul') INTO Employees;
ADD Employee (10, 'Rahul') TO Employees;
INSERT INTO Employees (EmpID, EmpName) SET (10, 'Rahul');

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. What will this query do?

UPDATE Employees SET EmpName = 'Sonia' WHERE EmpID = 5;

It retrieves the name of the employee with EmpID 5.
It updates the name of the employee with EmpID 5 to Sonia.
It adds a new employee named Sonia.
It deletes the employee with EmpID 5.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. How to delete all data from Employees without deleting the table?

TRUNCATE Employees;
DROP TABLE Employees;
DELETE * FROM Employees;
DELETE FROM Employees;

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?