IM PRELIM Flashcards

1
Q

Who proposed the relational model for database systems in 1970?
a) Charles Babbage
b) Edgar F. Codd
c) Alan Turing
d) Donald Knuth

A

Edgar F. Codd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the unique identifier for each row in a relational database table?
a) Foreign Key
b) Index
c) Primary Key
d) Column

A

Primary Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What property of relational tables ensures that the order of rows does not matter?
a) Data Integrity
b) Sequence Independence
c) Data Redundancy
d) Foreign Key Constraint

A

Sequence Independence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What SQL keyword is used to retrieve all rows and columns from a table?
a) DISPLAY *
b) FETCH *
c) SELECT *
d) SHOW *

A

SELECT *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What clause is used to filter records in an SQL query?
a) HAVING
b) WHERE
c) ORDER BY
d) SELECT

A

WHERE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which SQL clause is used to sort query results?
a) SORT BY
b) FILTER BY
c) ORDER BY
d) GROUP BY

A

ORDER BY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What function is used to return the current date and time in Oracle SQL?
a) GETDATE()
b) SYSDATE
c) CURRENT_DATE()
d) DATE()

A

SYSDATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which arithmetic operator has the highest precedence in SQL?
a) Addition (+)
b) Multiplication (*)
c) Subtraction (-)
d) Division (/)

A

Multiplication (*)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the result of NULL in an arithmetic expression?
a) 0
b) Error
c) NULL
d) Infinity

A

NULL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which operator is used in SQL to filter a range of values?
a) IN
b) BETWEEN
c) LIKE
d) HAVING

A

BETWEEN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What SQL operator is used to check if a value is in a given list?
a) LIKE
b) IN
c) EXISTS
d) HAVING

A

IN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which SQL condition is used for wildcard searches in text fields?
a) LIKE
b) IN
c) BETWEEN
d) EXISTS

A

LIKE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which category of SQL statements is used to modify table structures?
a) DML
b) DDL
c) TCL
d) DCL

A

DDL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What SQL command is used to add new records into a table?
a) ADD
b) INSERT
c) UPDATE
d) MERGE

A

INSERT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which SQL keyword is used to give a user access to a database object?
a) REVOKE
b) GRANT
c) PERMIT
d) ACCESS

A

GRANT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Who proposed the relational model for database systems in 1970?
a) Charles Babbage
b) Edgar F. Codd
c) Alan Turing
d) Donald Knuth

A

Edgar F. Codd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the main purpose of a relational database?
a) Storing images and videos
b) Managing unstructured data
c) Organizing data into related tables
d) Replacing programming languages

A

Organizing data into related tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which of the following is a basic storage structure in a relational database?
a) Column
b) Table
c) Field
d) Index

A

Table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a foreign key in a relational database?
a) A unique identifier for a row
b) A key that refers to the primary key in another table
c) A randomly generated key
d) A key used for encryption

A

A key that refers to the primary key in another table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Which of the following is NOT a property of a relational table?
a) Each row is unique
b) The sequence of columns is significant
c) Entries in a column must be of the same type
d) Each column has a unique name

A

The sequence of columns is significant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What SQL statement is used to retrieve data from a database?
a) INSERT
b) SELECT
c) DELETE
d) UPDATE

A

SELECT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which keyword is used to select all columns from a table?
a) ALL
b) SELECT *
c) FETCH *
d) SHOW *

A

SELECT *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What clause is used to filter data in an SQL query?
a) FILTER
b) SORT
c) WHERE
d) ORDER BY

A

WHERE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What clause is used to sort the results of an SQL query?
a) GROUP BY
b) SORT BY
c) ORDER BY
d) ARRANGE

A

ORDER BY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What does the DISTINCT keyword do in a SQL query? a) Removes duplicate rows from the result set b) Selects a specific column c) Changes column names d) Sorts the output
Removes duplicate rows from the result set
26
What function is used to return the current date and time in Oracle SQL? a) GETDATE() b) SYSDATE c) NOW() d) CURRENT_DATE()
SYSDATE
27
What is the default format for dates in Oracle SQL? a) YYYY-MM-DD b) MM-DD-YYYY c) DD-MON-RR d) HH:MM:SS
DD-MON-RR
28
Which arithmetic operator has the highest precedence in SQL? a) Addition (+) b) Multiplication (*) c) Subtraction (-) d) Division (/)
Multiplication (*)
29
What happens if an arithmetic expression contains a NULL value? a) The result is zero b) The result is NULL c) An error occurs d) It is ignored
The result is NULL
30
What function is used to concatenate two strings in Oracle SQL? a) JOIN() b) CONCAT() c) APPEND() d) MERGE()
CONCAT()
31
Which operator is used in SQL to filter a range of values? a) IN b) BETWEEN c) LIKE d) HAVING
BETWEEN
32
What SQL operator is used to check if a value is in a given list? a) LIKE b) IN c) EXISTS d) HAVING
IN
33
Which SQL condition is used for wildcard searches in text fields? a) LIKE b) IN c) BETWEEN d) EXISTS
LIKE
34
Which SQL join retrieves only matching rows from both tables? a) INNER JOIN b) LEFT JOIN c) RIGHT JOIN d) FULL JOIN
INNER JOIN
35
Which SQL keyword is used to remove duplicate rows from a query result? a) REMOVE b) DISTINCT c) DELETE d) UNIQUE
DISTINCT
36
Which category of SQL statements is used to modify table structures? a) DML b) DDL c) TCL d) DCL
DDL
37
What SQL command is used to insert new records into a table? a) ADD b) INSERT c) UPDATE d) MERGE
INSERT
38
What SQL command is used to modify existing records in a table? a) MODIFY b) ALTER c) UPDATE d) CHANGE
UPDATE
39
What SQL command is used to delete all records from a table without removing the structure? a) DROP b) DELETE c) TRUNCATE d) CLEAR
TRUNCATE
40
Which SQL keyword is used to grant a user access to a database object? a) REVOKE b) GRANT c) PERMIT d) ACCESS
GRANT
41
Which SQL clause is used to group records that have the same values? a) ORDER BY b) GROUP BY c) FILTER d) SORT
GROUP BY
42
Which SQL constraint ensures that a column does not have NULL values? a) UNIQUE b) NOT NULL c) PRIMARY KEY d) FOREIGN KEY
NOT NULL
43
What SQL statement is used to roll back a transaction? a) ROLLBACK b) UNDO c) REVERT d) CANCEL
ROLLBACK
44
What SQL function returns the number of rows in a table? a) COUNT() b) SUM() c) AVG() d) TOTAL()
COUNT()
45
Which logical operator returns TRUE only if both conditions are met? a) OR b) AND c) NOT d) XOR
AND
46
Who developed the relational database model in 1970? a) Charles Babbage b) Edgar F. Codd c) Alan Turing d) Donald Knuth
Edgar F. Codd
47
What major concept did Edgar F. Codd introduce? a) NoSQL Databases b) Relational Algebra c) Blockchain Databases d) Data Warehousing
Relational Algebra
48
Which company developed the SQL language? a) Oracle b) IBM c) Microsoft d) Google
IBM
49
Who is often credited for the development of the Entity-Relationship (ER) Model? a) Edgar F. Codd b) Peter Chen c) Bill Inmon d) Larry Page
Peter Chen
50
Which company is known for creating the Oracle RDBMS? a) Microsoft b) IBM c) Oracle Corporation d) Google
Oracle Corporation
51
Which SQL command is used to create a new table? a) CREATE b) INSERT c) ALTER d) DEFINE
CREATE
52
What SQL statement is used to remove all records from a table but keep its structure? a) DELETE b) DROP c) TRUNCATE d) CLEAR
TRUNCATE
53
Which SQL keyword is used to remove a table completely? a) DELETE b) DROP c) TRUNCATE d) CLEAR
DROP
54
What command is used to change an existing table structure? a) UPDATE b) MODIFY c) ALTER d) EDIT
ALTER
55
Which SQL clause is used to filter records in a query? a) WHERE b) ORDER BY c) FILTER d) GROUP BY
WHERE
56
What SQL function retrieves the current date in Oracle? a) NOW() b) GETDATE() c) SYSDATE d) CURRENT_DATE()
SYSDATE
57
What function returns the difference between two dates in months? a) DATE_DIFF b) MONTHS_BETWEEN c) TIMESTAMP_DIFF d) DATE_SUB
MONTHS_BETWEEN
58
What function adds months to a given date in Oracle SQL? a) ADD_DATE b) DATE_ADD c) ADD_MONTHS d) TIMESTAMP_ADD
ADD_MONTHS
59
Which SQL function returns the last day of a given month? a) LAST_DATE b) END_DATE c) LAST_DAY d) MONTH_END
LAST_DAY
60
What function returns the next specified day (e.g., next Monday) after a given date? a) NEXT_WEEKDAY b) NEXT_DATE c) NEXT_DAY d) UPCOMING_DAY
NEXT_DAY
61
What is the default date format in Oracle SQL? a) YYYY-MM-DD b) MM-DD-YYYY c) DD-MON-RR d) HH:MM:SS
DD-MON-RR
62
Which SQL function is used to convert a string into a date format? a) DATE_CAST b) TO_DATE c) CONVERT_DATE d) STR_TO_DATE
TO_DATE
63
What is the purpose of the RR date format in Oracle SQL? a) It ensures compatibility between 20th and 21st-century dates b) It represents dates in Roman numerals c) It forces all dates to be in the 1900s d) It removes the year entirely
It ensures compatibility between 20th and 21st-century dates
64
What is the correct syntax to display the current date in YYYY-MM-DD format? a) SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD') FROM dual; b) SELECT FORMAT_DATE(SYSDATE, 'YYYY-MM-DD') FROM dual; c) SELECT CURRENT_DATE() FORMAT 'YYYY-MM-DD'; d) SELECT DATE(SYSDATE, 'YYYY-MM-DD') FROM dual;
SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD') FROM dual;
65
Which SQL function extracts the year from a date? a) GET_YEAR b) EXTRACT(YEAR FROM date) c) YEAR(date) d) FORMAT_YEAR
EXTRACT(YEAR FROM date)
66
How do you extract the month name from a date? a) TO_CHAR(date, 'MONTH') b) EXTRACT(MONTH FROM date) c) DATE_FORMAT(date, 'MMMM') d) GET_MONTH_NAME(date)
TO_CHAR(date, 'MONTH')
67
What function converts a number to a string in Oracle SQL? a) TO_CHAR b) CAST c) TO_STRING d) FORMAT
TO_CHAR
68
What function truncates a date to remove the time component? a) REMOVE_TIME b) TRUNC(date) c) STRIP_TIME(date) d) DATE_TRIM(date)
TRUNC(date)
69
Which SQL statement finds the first Monday of the next month? a) SELECT NEXT_DAY(ADD_MONTHS(SYSDATE, 1), 'MONDAY') FROM dual; b) SELECT FIRST_WEEKDAY(ADD_MONTHS(SYSDATE, 1), 'MONDAY') FROM dual; c) SELECT UPCOMING_DAY(ADD_MONTHS(SYSDATE, 1), 'MONDAY') FROM dual; d) SELECT GET_FIRST_MON(ADD_MONTHS(SYSDATE, 1)) FROM dual;
SELECT NEXT_DAY(ADD_MONTHS(SYSDATE, 1), 'MONDAY') FROM dual;
70
What is the function of the TRUNC(date, 'MONTH') statement? a) Rounds the date to the nearest month b) Removes the day portion and sets it to the first day of the month c) Converts the date into a string d) Returns the number of days in the month
Removes the day portion and sets it to the first day of the month