Q1
Q1 What type of database model organizes data in tables with rows and columns?
Hierarchical
Network
Relational
Object-Oriented
Q2
Q2 In a database, what is a unique identifier for each record in a table called?
Primary key
Secondary key
Foreign key
Index key
Q3
Q3 Which SQL statement is used to retrieve data from a database?
UPDATE
DELETE
INSERT
SELECT
Q4
Q4 What is the purpose of normalization in a database?
Increase data redundancy
Optimize query speed
Reduce data redundancy
Improve data security
Q5
Q5 Which of the following is not a characteristic of a good database design?
Data integrity
Data redundancy
Scalability
Efficiency
Q6
Q6 Which data type is used in SQL to store true or false values?
INT
BOOLEAN
VARCHAR
FLOAT
Q7
Q7 In SQL, which data type is best suited for storing large texts such as articles or comments?
TEXT
VARCHAR
CHAR
BLOB
Q8
Q8 Which SQL data type is used to store numerical values with fixed precision and scale?
DECIMAL
INTEGER
DATE
VARCHAR
Q9
Q9 In SQL, what is the difference between CHAR and VARCHAR data types?
CHAR is fixed length, VARCHAR is variable length
CHAR is variable length, VARCHAR is fixed length
No difference
VARCHAR is used only for numeric data
Q10
Q10 What data type would you use in SQL to store a date and time value together?
DATETIME
DATE
TIME
TIMESTAMP
Q11
Q11 Which SQL command is used to create a new table in a database?
CREATE
ALTER
DROP
TRUNCATE
Q12
Q12 What does the DROP command do in SQL?
Adds a new row to a table
Deletes an existing table
Modifies a table
Creates a new table
Q13
Q13 In SQL, what is the purpose of the TRUNCATE command?
Deletes specific rows from a table
Removes all rows from a table
Changes table structure
Creates a new table
Q14
Q14 Which command should be used to change the datatype of a column in an SQL table?
CREATE
ALTER
DROP
TRUNCATE
Q15
Q15 What is the difference between the DROP and TRUNCATE commands in SQL?
DROP deletes the table, TRUNCATE deletes only the table data
TRUNCATE deletes the table, DROP deletes only the table data
No difference
Both commands modify table data
Q16
Q16 Which part of this statement is incorrect?
"CREATE TABEL Students (ID int, Name varchar(50));"
TABEL
Students
ID int
Name varchar(50)
Q17
Q17 Identify the error in
"ALTER TABLE Students DROP COLUMN DateOfBirth date;"
ALTER TABLE
DROP COLUMN
DateOfBirth
date
Q18
Q18 What needs to be changed in
"TRUNCATE Students;" to make it a valid SQL statement?
TRUNCATE
Students
All Correct
Add a WHERE clause
Q19
Q19 Correct the syntax error in
"CREATE TABLE Students (ID int PRIMARY, Name varchar(50));"
PRIMARY
ID int
Name varchar(50)
CREATE TABLE
Q20
Q20 In "ALTER TABLE Students ADD COLUMN Email varchar(50),
what is missing for this statement to be correct?
ADD COLUMN
varchar(50)
All Correct
Q21
Q21 Which SQL command is used to add a new record to a table?
SELECT
DELETE
UPDATE
INSERT
Q22
Q22 What does the UPDATE command in SQL do?
Deletes a record
Modifies an existing record
Adds a new record
Retrieves data
Q23
Q23 In SQL, what is the purpose of the WHERE clause in a DELETE statement?
Specifies which database to use
Specifies which table to delete from
Specifies which records to delete
Specifies how to order the records
Q24
Q24 Which command is used to remove a specific record from a table in SQL?
DELETE
UPDATE
INSERT
SELECT
Q25
Q25 How does a transaction ensure data integrity in SQL?
By locking the database
By allowing multiple users to modify data simultaneously
By ensuring all operations within the transaction are completed before committing
By automatically updating all related tables
Q26
Q26 In the query "SELECT Name FROM Employees WHERE Age > 30 AND Department = 'HR';",
what needs to be corrected?
All Correct
The SELECT keyword
The WHERE clause
The AND operator
Q27
Q27 Identify the error in
"UPDATE Employees SET Salary = Salary * 1.05 WHERE;"
UPDATE keyword
SET keyword
WHERE clause
No error
Q28
Q28 What is missing in the following statement?
"INSERT INTO Employees (Name, Department) VALUES ('John', 'Sales');"
All Correct
Employee ID
A WHERE clause
Additional column names
Q29
Q29 Correct the syntax error in
"DELETE FROM Employees HAVING Age < 25;"
DELETE keyword
FROM keyword
HAVING keyword
No syntax error
Q30
Q30 In "UPDATE Employees SET Age = Age + 1 WHERE Department IN ('Sales', 'HR') AND Age >= 30;",
identify the error.
The IN operator
The AND operator
No error
The SET keyword