Understanding SQL Flashcards

(20 cards)

2
Q

What does SQL stand for?

A

Structured Query Language.

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

What is SQL used for?

A

To communicate with and operate on relational databases.

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

Why is SQL important for relational databases?

A

It provides the commands for creating, manipulating, and querying the data.

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

Is SQL a database management system?

A

No, it’s a language used to interact with a DBMS like MySQL.

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

List categories of SQL commands.

A

Database Design-Construction, Data Manipulation, Reporting (querying), Data Control, Transaction Control, Miscellaneous Commands.

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

What does the Database Design-Construction category include?

A

Commands for creating and modifying database structure, like CREATE or ALTER.

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

What does the Data Manipulation category include?

A

Commands like INSERT, UPDATE, DELETE — used for changing actual data.

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

What does Reporting (querying) involve?

A

Commands like SELECT and aggregate functions used to extract and analyze data.

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

What does Data Control refer to?

A

Managing user access and privileges (e.g., GRANT, REVOKE).

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

What does Transaction Control involve?

A

Managing changes with commands like COMMIT and ROLLBACK.

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

What command connects to MySQL from terminal?

A

mysql -u user_name -p

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

What does ‘-u’ and ‘-p’ mean in the connection command?

A

‘-u’ is the username, ‘-p’ triggers password prompt.

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

Which category includes SELECT queries?

A

Reporting (querying).

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

If you are modifying tables and constraints, what category are you working in?

A

Database Design-Construction.

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

If you want to rollback a failed transaction, what category does that fall under?

A

Transaction Control.

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

Spot the mistake: ‘sql -u user -p’

A

Missing ‘mysql’. Correct command: mysql -u user -p

18
Q

Spot the mistake: ‘SQL is a DBMS.’

A

Incorrect. SQL is a language, not a DBMS.

19
Q

Explain the relationship between SQL and an RDBMS.

A

SQL is the language used to interact with an RDBMS which executes the operations on the data.

20
Q

Describe the purpose of categorizing SQL commands.

A

It helps understand the different types of tasks SQL can perform and organizes learning.

21
Q

If you confuse SQL with a DBMS, what kind of conceptual error are you making?

A

You’re mistaking the tool (language) with the system that processes it.