Understanding SQL Flashcards
(20 cards)
What does SQL stand for?
Structured Query Language.
What is SQL used for?
To communicate with and operate on relational databases.
Why is SQL important for relational databases?
It provides the commands for creating, manipulating, and querying the data.
Is SQL a database management system?
No, it’s a language used to interact with a DBMS like MySQL.
List categories of SQL commands.
Database Design-Construction, Data Manipulation, Reporting (querying), Data Control, Transaction Control, Miscellaneous Commands.
What does the Database Design-Construction category include?
Commands for creating and modifying database structure, like CREATE or ALTER.
What does the Data Manipulation category include?
Commands like INSERT, UPDATE, DELETE — used for changing actual data.
What does Reporting (querying) involve?
Commands like SELECT and aggregate functions used to extract and analyze data.
What does Data Control refer to?
Managing user access and privileges (e.g., GRANT, REVOKE).
What does Transaction Control involve?
Managing changes with commands like COMMIT and ROLLBACK.
What command connects to MySQL from terminal?
mysql -u user_name -p
What does ‘-u’ and ‘-p’ mean in the connection command?
‘-u’ is the username, ‘-p’ triggers password prompt.
Which category includes SELECT queries?
Reporting (querying).
If you are modifying tables and constraints, what category are you working in?
Database Design-Construction.
If you want to rollback a failed transaction, what category does that fall under?
Transaction Control.
Spot the mistake: ‘sql -u user -p’
Missing ‘mysql’. Correct command: mysql -u user -p
Spot the mistake: ‘SQL is a DBMS.’
Incorrect. SQL is a language, not a DBMS.
Explain the relationship between SQL and an RDBMS.
SQL is the language used to interact with an RDBMS which executes the operations on the data.
Describe the purpose of categorizing SQL commands.
It helps understand the different types of tasks SQL can perform and organizes learning.
If you confuse SQL with a DBMS, what kind of conceptual error are you making?
You’re mistaking the tool (language) with the system that processes it.