SQL KEY CONCEPTS Flashcards

Intro - ch 1

1
Q

What is a table in a database?

A

a collection of related data in a database.
- it is made up of rows & columns
Example - A “Customers” table might have columns for customer names, IDs, & contact information.

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

What is a column in a database?

A

Is a field in a table that stores specific types of data, such as names or dates.
EXAMPLE - In a “Products” table, there might be a column for “Price” & another for “Description.”

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

What is a row in a database?

A
  • is a record in a table, containing related data fields for one entry.
    *Example** - In a “Customers” table, one row could store the name, ID, & contact information of one customer.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a primary key?

A
  • Is a unique identifer for each record in a table.
  • No two rows can have the same primary key.
    Example - A customer ID number might be a primary key in a “Customers” table.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a foreign key?

A
  • is a field in one table that links to the primary key in another table.
  • It is used to create relationships between tables.
    Examples - In an “Orders” table, a foreign key might link to the “Customers” table using the customer ID.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the main SQL commands?

A
  1. SELECT: Retrieves data from a database
  2. INSERT: Adds new data to a table
  3. UPDATE: Modifies existing data.
  4. DELETE: Removes data from a table.
  5. CREATE: Creates new tables or databases.
  6. DROP: Deletes tables or database.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

SELECT
- What is the purpose of SQL commands SELECT?

A

Retrieves data from a database

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

INSERT
- What is the purpose of SQL commands INSERT?

A

Adds new data to a table

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

UPDATE
- What is the purpose of SQL commands UPDATE?

A

Modifies existing data.

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

DELETE
- What is the purpose of SQL commands DELETE?

A

Removes data from a table.

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

CREATE
- What is the purpose of SQL commands CREATE?

A

Creates new tables or databases.

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

DROP
- What is the purpose of SQL commands DROP?

A

Deletes tables or database.

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

Example of table in a database

A

Example - A “Customers” table might have columns for customer names, IDs, & contact information.

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

Example of column in a database

A

EXAMPLE - In a “Products” table, there might be a column for “Price” & another for “Description.”

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

Example of row in a database

A

*Example** - In a “Customers” table, one row could store the name, ID, & contact information of one customer.

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

Example of primary key in a database

A

Example - A customer ID number might be a primary key in a “Customers” table.

16
Q

Example of foreign key in a database

A

Examples - In an “Orders” table, a foreign key might link to the “Customers” table using the customer ID.

17
Q

What is a table in a database? (In More Detail)
- Define:
- Example:

A
  1. Define: A table is a collection of related data in a database. It is made up of rows and columns.
  2. Example: A “Customers” table might have columns for customer names, IDs, and contact information.
18
Q

What is a column in a database? (In More Detail)
- Define:
- Example:

A
  1. Define: A column is a field in a table that stores specific types of data, such as names or dates.
  2. Example: In a “Products” table, there might be a column for “Price” and another for “Description.”
19
Q

What is a row in a database? (In more Detail)
- Define:
- Example:

A
  1. Define: A row is a record in a table, containing related data fields for one entry.
  2. Example: In a “Customers” table, one row could store the name, ID, and contact information of one customer.
20
Q

What is a primary key? (In more Detail)
- Define:
- Example:

A
  1. Define: A primary key is a unique identifier for each record in a table. No two rows can have the same primary key.
  2. Example: A customer ID number might be a primary key in a “Customers” table.
21
Q

What is a foreign key? (In more Detail)
- Define:
- Example:

A
  1. Define: A foreign key is a field in one table that links to the primary key in another table. It is used to create relationships between tables.
  2. Example: In an “Orders” table, a foreign key might link to the “Customers” table using the customer ID.
22
Q
A