Quick Revision

GK One-Line Question & Answer

15541+ short questions with short answers, covering every category and sub-category on the site — no long articles to scroll through. Good for a fast recap before an exam, or a few minutes of daily practice.

DBMS → Indexes 3

If a1, a2, a3 are attributes in a relation and S is another relation, which of the following is an incorrect specification of an integrity constraint?
foreign key(a1, a2)
click to copy
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
click to copy
The command to remove rows from a table ‘CUSTOMER’ is __________________
DELETE FROM CUSTOMER WHERE
click to copy

DBMS → Transactions 3

What is the syntax to load data into the database? (Consider D as the database and a, b, c as datA:)
insert into D values (a, b, C:);
click to copy
With SQL, how can you return all the records from a table named “Persons” sorted descending by “FirstName”?
SELECT * FROM Persons ORDER BY FirstName DESC
click to copy
What type of join is needed when you wish to include rows that do not have matching values?
Outer join
click to copy

DBMS → Concurrency Control 3

Which of the following commands do we use to delete a relation (R) from a database?
drop table R
click to copy
With SQL, how can you return the number of not null records in the “Persons” table?
SELECT COUNT(*) FROM Persons
click to copy
What type of join is needed when you wish to return rows that do have matching values?
All of the Mentioned
click to copy

DBMS → Deadlock 3

Which of the following commands do we use to delete all the tuples from a relation (R)?
delete from R
click to copy
What does the ALTER TABLE clause do?
The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints
click to copy
Which of the following is one of the basic approaches for joining tables?
All of the Mentioned
click to copy

DBMS → Database Security 2

Choose the correct command to delete an attribute A from a relation R
alter table R drop A
click to copy
The UPDATE SQL clause can _____________
update more than one row at a time
click to copy

DBMS → PL/SQL 2

create table apartment(ownerID varchar (5), ownername varchar(25), floor numeric(4,0),<br>primary key (ownerID:));<br>Choose the correct option regarding the above statement
It creates a relation with three attributes ownerID, ownername, floor in which ownerID cannot be null.
click to copy
The UNION SQL clause can be used with _____________
SELECT clause only
click to copy

DBMS → Introduction to DBMS 2

What does the notnull integrity constraint do?
It ensures that all tuples have a finite value on a specified attribute
click to copy
Which SQL statement is used to return only different values?
SELECT DISTINCT
click to copy

DBMS → Database Architecture 2

Which SQL function is used to count the number of rows in a SQL query?
COUNT(*)
click to copy
Which SQL keyword is used to sort the result-set?
ORDER BY
click to copy

DBMS → Data Models 2

Which SQL keyword is used to retrieve a maximum value?
MAX
click to copy
How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
click to copy

DBMS → ER Model 2

Which of the following SQL clauses is used to DELETE tuples from a database table?
DELETE
click to copy
Which of the following command makes the updates performed by the transaction permanent in the database?
COMMIT
click to copy

DBMS → Relational Model 2

___________removes all rows from a table without logging the individual row deletions.
TRUNCATE
click to copy
Which TCL command undo all the updates performed by the SQL in the transaction?
ROLLBACK
click to copy

DBMS → Normalization 2

Which of the following is not a DDL command?
UPDATE
click to copy
SQL query to find all the cities whose humidity is 95.
SELECT city FROM weather WHERE humidity = 95
click to copy

DBMS → Functional Dependency 2

Which of the following are TCL commands?
ROLLBACK and SAVEPOINT
click to copy
SQL query to find the temperature in increasing order of all cities.
SELECT city, temperature FROM weather ORDER BY city
click to copy

DBMS → SQL Basics 2

________________ is not a category of SQL command.
SCL
click to copy
What is the meaning of LIKE ‘%0%0%’?
Feature has two 0’s in it, at any position
click to copy

DBMS → DDL Commands 2

If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default ______________
ASC
click to copy
Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
click to copy

DBMS → DML Commands 2

Which of the following statement is true?
DELETE does not free the space containing the table and TRUNCATE free the space containing the table
click to copy
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
click to copy

DBMS → Joins 2

What is the purpose of the SQL AS clause?
The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column
click to copy
Find all the tuples having a temperature greater than ‘Paris’.
SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’
click to copy

DBMS → Views 2

What does DML stand for?
Data Manipulation language
click to copy
Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79.
SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
click to copy