Database Flashcards

(26 cards)

1
Q

What is a database?

A

A database is an organized collection of structured information or data, typically stored electronically in a computer system.

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

What is a DBMS?

A

A Database Management System (DBMS) is software that interacts with users, applications, and the database to capture and analyze data.

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

What is SQL?

A

SQL (Structured Query Language) is a standard programming language used to manage and manipulate relational databases.

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

What are the types of SQL commands?

A

DDL, DML, DCL, and TCL.

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

What does the SELECT statement do?

A

It retrieves data from one or more tables.

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

What is the difference between WHERE and HAVING?

A

WHERE filters rows before grouping; HAVING filters after grouping.

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

How do you insert data into a table?

A

INSERT INTO table_name (column1, column2) VALUES (value1, value2);

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

How do you update a record in SQL?

A

UPDATE table_name SET column1 = value1 WHERE condition;

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

How do you delete a record from a table?

A

DELETE FROM table_name WHERE condition;

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

What is a JOIN in SQL?

A

A JOIN combines rows from two or more tables based on a related column.

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

Name the types of JOINs.

A

INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, CROSS JOIN.

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

What is a subquery?

A

A query nested inside another query.

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

What is the difference between IN, EXISTS, and ANY?

A

IN checks if a value is in a list, EXISTS checks if a subquery returns any row, ANY compares to any value returned by a subquery.

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

What is a primary key?

A

A unique identifier for each record in a table.

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

What is a foreign key?

A

A field in one table that refers to the primary key in another table.

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

What is a unique constraint?

A

Ensures that all values in a column are different.

17
Q

What is the difference between NULL and ‘’ (empty string)?

A

NULL represents the absence of a value; ‘’ is a value (an empty string).

18
Q

What is normalization?

A

The process of organizing data to reduce redundancy and improve integrity.

19
Q

What are the normal forms?

A

1NF, 2NF, 3NF, BCNF.

20
Q

What is denormalization?

A

Combining tables to reduce the number of joins and improve read performance.

21
Q

What is an index?

A

A database object that improves the speed of data retrieval operations on a table.

22
Q

What is a composite index?

A

An index on two or more columns of a table.

23
Q

What is a transaction?

A

A sequence of one or more SQL operations that are executed as a single unit.

24
Q

What does ACID stand for?

A

Atomicity, Consistency, Isolation, Durability.

25
What is a rollback?
A command that undoes transactions that have not yet been committed.
26
What is the difference between COMMIT and ROLLBACK?
COMMIT saves changes; ROLLBACK undoes changes.