4.5 Databases (SQL) Flashcards

(9 cards)

1
Q

Select Data

Retrieving specifc columns from a table

A
SELECT column1, column2
FROM table_name;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Select With Condition

Retrives all columns from a table where the specified column is true

A
SELECT *
FROM table_name
WHERE condition;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Create Table

Creates a new table with specified columns and data types

A
CREATE TABLE table_name (
column1 datatype,
column2 datatype
);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Insert Data

Adds new rows od data into a table

A
INSERT INTO table_name (column1, column2)
VALUES (value1, values2);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Update Data

Modifies existing data in a table

A
    UPDATE table_name
       SET column1 = value1
   WHERE condition;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Select With Condition on Numeric Values

Retrieves specific columns from a table where a numeric condition is met

A
SELECT column1, column2
FROM table_name
WHERE numeric_column < value;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Select With Multiple Conditions

Retrieves specific columns from table where multiple conditions are met

A
SELECT column1, column2
FROM table_name
WHERE condition1 AND condition2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Select with OR Condition

Retrieves specific columns from table where at least 1 condition is met

A
SELECT column1, column2
FROM table_name
WHERE condition1 OR condition2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Subquery

Uses a nested query to retrive data based on result of another query.

A
SELECT column1, column2
FROM table_name
WHERE column = (
  SELECT column
  FROM table_name
  WHERE condition
);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly