2-Databases Flashcards
1-Intro to Databases 2-Types of Databases
What does SQL stand for?
A) Structured Query Language
B) Simple Query Language
C) Secure Query Language
D) Server Query Language
A) Structured Query Language
Explanation: SQL stands for Structured Query Language, which is used to manage and manipulate databases.
Which database system is commonly vulnerable to SQL injection?
A) NoSQL
B) MongoDB
C) MySQL
D) All of the above
C) MySQL
Explanation: While SQL injection primarily targets SQL databases like MySQL, NoSQL databases can be vulnerable to other types of injection attacks.
What is a primary feature of a Database Management System (DBMS)?
A) Data duplication
B) Concurrency
C) Unstructured data handling
D) Manual query operation
B) Concurrency
Explanation: Concurrency is a feature of DBMSs that allows multiple users to interact with the database simultaneously without issues like data corruption.
How can SQL injections be prevented?
A) By increasing database size
B) By using file-based databases
C) By using parameterized queries
D) By disabling databases
C) By using parameterized queries
Explanation: Parameterized queries help prevent SQL injections by separating SQL code from data, thus avoiding the execution of harmful injected code.
What could be an impact of a successful SQL Injection attack?
A) Improved database performance
B) Unauthorized data access
C) Enhanced database security
D) Reduction in data storage needs
B) Unauthorized data access
Explanation: SQL injection can lead to unauthorized data access, where attackers can view, modify, or delete data they shouldn’t be able to access.
What SQL technique involves merging the results of two queries?
A) Join
B) Index
C) Union
D) Group
C) Union
Explanation: The UNION SQL operation is used to combine the results of two distinct SELECT queries into a single result set.
Which DBMS feature ensures data integrity?
A) Reliability
B) Security
C) Consistency
D) Backup
C) Consistency
Explanation: Consistency in a DBMS ensures that data remains accurate and valid across all transactions and at all times.
Which is a NOT a method to interact with a DBMS?
A) APIs
B) GUIs
C) Command-line tools
D) Manual recording
D) Manual recording
Explanation: DBMS interactions are typically conducted through APIs, graphical interfaces, or command-line tools, not manual recording.
What is a common consequence of SQL injection?
A) Faster data retrieval
B) Database corruption
C) Increased security
D) Automated data backups
B) Database corruption
Explanation: SQL injection can lead to database corruption as malicious queries alter or damage data structures or content.
Which approach helps secure a DBMS?
A) Reducing user permissions
B) Fine-grained security controls
C) Eliminating backups
D) Using outdated software
B) Fine-grained security controls
Explanation: Fine-grained security controls, such as user authentication and permissions, help prevent unauthorized access and modifications to the database.
What is unique about Relational Databases?
A) They do not use SQL
B) They use a schema to define data structure
C) They do not allow for data retrieval
D) They store data without a defined structure
B) They use a schema to define data structure
Explanation: Relational databases use a schema to define how data is structured, which helps maintain data accuracy and organization.
Which database type is best suited for handling unstructured data?
A) Relational Database
B) Graph Database
C) NoSQL Database
D) SQL Database
C) NoSQL Database
Explanation: NoSQL databases are ideal for unstructured data due to their flexible schema-less architecture, which allows them to handle a variety of data forms easily.
Which of these is a key feature of Relational Databases?
A) Lack of schema
B) Key-value storage model
C) Relationship between tables
D) All data stored as single document
C) Relationship between tables
Explanation: A key feature of relational databases is the relationship between tables, often managed through foreign keys that help maintain data integrity across different tables.
How do NoSQL databases typically store data?
A) In strictly structured SQL tables
B) As JSON or XML in key-value pairs
C) Only in graph formats
D) Using relational models
B) As JSON or XML in key-value pairs
Explanation: NoSQL databases often use key-value storage models, where data is stored in formats like JSON or XML, allowing for flexible and scalable data management.
What does RDBMS stand for?
A) Real Database Management System
B) Relational Database Management System
C) Rapid Database Management System
D) Reduced Database Management System
B) Relational Database Management System
Explanation: RDBMS stands for Relational Database Management System, which is a database management system that supports relational models.