Basic Database
Basic Database
A database is a collection of organized data that can be easily accessed, managed, and updated.
What is DBMS?
DBMS stands for Database Management System.
It is software that helps to store, retrieve, and manage data in a database.
What is SQL?
Example:
sql
CopyEdit
Keyword Meaning
SELECT Retrieve data from a table
FROM Specify the table name
WHERE Set conditions (filters)
INSERT Add new data to a table
UPDATE Modify existing data
DELETE Remove data from a table
CREATE Create new table or database
DROP Delete a table or database
What is a Table?
A table is where data is stored in rows and columns.
Example:
A student table may have columns: ID, Name, Marks.
A primary key is a column (or set of columns) that uniquely identifies each row.
What is Normalization?
Normalization is the process of organizing data to reduce redundancy (no repeating data).
What is a Query?
2.
Which command is used to retrieve data from a database?
a) UPDATE
b) SELECT
c) DELETE
d) CREATE
Answer: b) SELECT
3.
Which key uniquely identifies a row in a table?
Answer: Primary Key
4.
SQL stands for?
Answer: Structured Query Language
5.
Which SQL command is used to remove all data from a table but not the table itself?
Answer: DELETE
You said:
Here’s a set of 50 previous-style CoCubes questions on Basic Database Awareness, ideal for exam prep. They include multiple-choice, true/
false, and fill-in-the-blanks, crafted from patterns of past questions.
2.
SQL stands for?
a) Sequential Query List b)
Structured Query Language c)
Simple Query Language d)
None
Answer: b
3.
Command to add new rows?
a) UPDATE b)
INSERT c)
SELECT d)
CREATE
Answer: b
4.
Remove a table completely?
a) DELETE TABLE b)
REMOVE c)
DROP d)
ERASE
Answer: c
5.
Fetch all records from student only where grade = 'A'?
a) SELECT * FROM student WHERE grade='A'
b) SELECT ALL FROM student WHERE grade='A'
c) SELECT grade='A' FROM student
d) SELECT student FROM grade A
Answer: a
6.
Primary key characteristic?
a) Unique and nullable
b) Unique and non-nullable
c) Non-unique
d) Nullable only
Answer: b
7.
Foreign key?
a) Unique key
b) Primary key in same table
c) References primary key of another table
d) Can be null only
Answer: c
8.
Normalization reduces?
a) Speed
b) Redundancy
c) Accuracy
d) Capacity
Answer: b
9.
2NF requires?
a) No partial dependency
b) No transitive dependency
c) Both
d) None
Answer: a
10.
Select distinct cities:
a) SELECT city FROM table;
b) SELECT UNIQUE(city) FROM table;
c) SELECT DISTINCT city FROM table;
d) SELECT city DISTINCT FROM table;
Answer: c
11.
A view is?
a) Physical table
b) Virtual table
c) Backup
d) Index
Answer: b
12.
Default SQL clause order:
a) SELECT FROM WHERE GROUP BY HAVING ORDER BY
b) SELECT WHERE FROM ORDER BY
c) FROM SELECT WHERE ORDER BY
d) SELECT FROM ORDER BY
Answer: a
13.
HAVING is for?
a) Filtering columns
b) Aggregated results
c) Sorting
d) None
Answer: b
14.
Command to change table structure:
a) MODIFY TABLE
b) CHANGE TABLE
c) ALTER TABLE
d) UPDATE TABLE
Answer: c
15.
JOIN type showing all records?
a) INNER JOIN
b) LEFT JOIN
c) FULL OUTER JOIN
d) CROSS JOIN
Answer: c
16.
Entity–relationship diagram shows?
a) Data flow
b) Entities and relationships
c) CPU architecture
d) Network layout
Answer: b
17.
Transaction property 'A' stands for?
a) Accurate
b) Atomicity
c) Accessible
d) Acyclic
Answer: b
18.
Rollback returns to?
a) Initial DB
b) Before transaction start
c) Archive
d) Uncertain
Answer: b
19.
COMMIT does?
a) Saves changes
b) Discards changes
c) Deletes table
d) Creates backup
Answer: a
20.
SQL injection attacks target?
a) UI only
b) Code
c) Database queries
d) File system
Answer: c
21.
Clustered index sorts table physically?
a) True
b) False
Answer: a
22.
Runtime compilation of SQL is called?
a) Hard parse
b) Soft parse
c) Both
d) None
Answer: a
23.
Default join in SQL is?
a) INNER JOIN
b) FULL JOIN
c) LEFT JOIN
d) CROSS JOIN
Answer: a
24.
Stored procedures are server-side executed?
a) True
b) False
Answer: a
25.
Data Dictionary stores metadata?
a) True
b) False
Answer: a
26.
Rollback of a committed transaction allowed?
a) Yes
b) No
Answer: b
27.
Composite key uses multiple columns?
a) True
b) False
Answer: a
28.
Default port of MySQL?
a) 3306
b) 5432
c) 8080
d) 1521
Answer: a
29.
ACID stands for Atomicity, Consistency, _____, Durability.
a) Integrity
b) Isolation
c) Indivisibility
d) I/O
Answer: b
30.
UNION vs UNION ALL removes duplicates?
a) UNION only
b) UNION ALL only
c) Both
d) Neither
Answer: a
32.
DROP removes table permanently.
True
33.
Normalization increases redundancy.
False
34.
Primary key can have NULL.
False
35.
Foreign key ensures referential integrity.
True
36.
Index slows INSERT operations.
True
37.
A trigger auto-executes on events.
True
38.
Check constraint ensures valid data.
True
39.
Data warehouse same as OLTP DB.
False
40.
Denormalization can improve read performance.
True
42.
_______ keys uniquely identify rows in a table.
Answer: Primary
43.
_______ is the process of removing duplicate rows.
Answer: UNION
44.
SQL command to modify rows is _______.
Answer: UPDATE
45.
_______ locks rows or tables during transactions.
Answer: Lock
46.
_______ processes analytical, read-heavy data models.
Answer: OLAP
47.
_______ ensures no partial dependency in a table.
Answer: Second Normal Form
48.
_______ is a snapshot view created from one or more tables.
Answer: View
49.
_______ represents database structure and constraints.
Answer: Schema
50.
The _______ clause filters groups after aggregation.
Answer: HAVING
Tips for CoCubes Exam Preparation