Lesson 3 Part 3 Flashcards

(37 cards)

1
Q

What is Data?

A

Data is information with a purpose, used in enterprise applications to provide insights and persistent information, including for marketing, usage statistics, and error reporting.

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

What is a database?

A

A database is a system of software and capabilities that allows for validating, storing, searching, filtering, aggregating, grouping, and administering data.

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

What are the two main categories of databases in enterprise applications?

A

SQL databases and NoSQL databases.

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

What is an SQL database?

A

An SQL database is a type of Relational Database Management System (RDBMS) that uses Structured Query Language (SQL) to manage data stored in tables.

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

What is the general syntax for creating a database in MySQL?

A

CREATE DATABASE database_name;

Example: CREATE DATABASE employee;

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

What is a NoSQL database?

A

A NoSQL database is not necessarily based on the relational model and uses various methods or domain-specific languages (DSL) for data management, employing different structures for storing data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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
8
Q

What is the syntax to use a newly created schema in MySQL?

A

USE database_name;
Example: USE employee

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

What are the five sublanguages of SQL?

A

DDL (Data Definition Language)
DML (Data Manipulation Language)
DCL (Data Control Language)
TCL (Transaction Control Language)
DQL (Data Query Language)

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

What does DML stand for and what is its purpose?

A

Data Manipulation Language; it is used for inserting, updating, and deleting records.

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

What does DDL stand for and what is its purpose?

A

Data Definition Language; it defines the structure of the database.

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

What does DCL stand for and what is its purpose?

A

Data Control Language; it grants or revokes access permissions to database objects.

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

What does TCL stand for and what is its purpose?

A

Transaction Control Language; it defines boundaries for concurrent operations.

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

What does DQL stand for and what is its purpose?

A

Data Query Language; it is used to search, filter, group, and aggregate stored data.

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

Name some popular SQL implementations.

A

Oracle, MySQL, PostgreSQL, Microsoft SQL Server, MariaDB, SQLite.

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

Why is database consistency important?

A

It ensures accuracy, improves data retrieval, and optimizes database space by maintaining consistent data formats and preventing errors.

15
Q

What is database inconsistency?

A

Database inconsistency occurs when updates to data are not properly reflected across all tables that use the data, resulting in conflicting or outdated information.

15
Q

What is database consistency?

A

Database consistency ensures that all data points align with predefined rules and constraints, maintaining accuracy and adherence to the database’s rules.

16
Q

What is an RDBMS?

A

A Relational Database Management System (RDBMS) is a type of database management system (DBMS) based on the relational model, which stores data in tables and enables various operations like creation, updating, and querying of relational databases.

16
Q

Provide an example of database consistency.

A

A driver’s license number must follow a specific format, such as “P123456A.” Any entry not matching this format is considered inconsistent.

16
Q

Provide an example of database inconsistency.

A

If a driver’s address is updated, but the old address remains in some tables while others have the new address, this is an example of database inconsistency.

17
Q

Name three benefits of using an RDBMS.

A
  1. Enforced data integrity
  2. Support for large-scale concurrent data access
  3. Fault tolerance
17
Q

Describe the role of the ‘Connection Handler’ in MySQL architecture.

A

It receives incoming client connections and creates new thread execution contexts to isolate client connections from each other.

18
Q

What is the purpose of a ‘Constraint’ in an RDBMS?

A

A constraint is a restriction on the type or value that can be assigned to a column to ensure data integrity.

19
What is a database schema?
A schema is the structure of a database, including its tables and relationships, described using a formal language like SQL.
20
How is a schema typically created in an RDBMS?
Using SQL statements such as CREATE SCHEMA to define the schema and CREATE TABLE statements to define the tables and their relationships.
21
What are integrity constraints?
Integrity constraints are rules that ensure the accuracy and consistency of data within a database. They include column names, data types, data constraints, and relationships.
22
What does the SQL command CREATE TABLE do?
It creates a new table in a database with specified columns, data types, and constraints.
23
What is the difference between a table and a database?
A table is a collection of related data entries organized in rows and columns, while a database is a collection of multiple tables and other database objects.
23
What is the purpose of the DROP TABLE command?
It completely removes a table from the database, including its structure and data.
24
How do you create a new table in MySQL?
Using the CREATE TABLE command, followed by column definitions and constraints.
24
What is a tuple in the context of databases?
A tuple is an ordered set of values, corresponding to a row in a table, where each value represents a specific attribute.
25
What does the TRUNCATE TABLE command do?
It removes all data from a table but does not delete the table itself.
26
How can you modify a table structure in MySQL?
Using the ALTER TABLE command, you can add, drop, or modify columns.
27
What is the syntax to add a new column to an existing table?
ALTER TABLE table_name ADD column_name datatype;
28
What is the syntax to drop a column from an existing table?
ALTER TABLE table_name DROP COLUMN column_name;
29
How would you modify an existing column in a table?
ALTER TABLE table_name MODIFY COLUMN column_name new_datatype;