CS401A's Pre-Finals: Info Management Module 07 Flashcards

For pre-final and final exams. (32 cards)

1
Q

SQL Data Manipulation Commands

  • The basic data manipulation commands are:
A

INSERT, SELECT, UPDATE, and DELETE.

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

SQL Data Manipulation Commands

\_\_\_\_ \_\_\_ \_\_\_\_\_\_\_\_\_\_\_\_ to a table
Syntax: INSERT INTO table name (columns) VALUES (values);

A
  • INSERT INTO
    adds new rows/records
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SQL Data Manipulation Commands

— adds new rows/records to a table
Example: \_\_\_\_\_\_ \_\_\_\_ Students (LastName, Section) \_\_\_\_\_\_ (‘Reyes’, ‘IT102’);

A
  • INSERT INTO
    INSERT INTO
    VALUES
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SQL Data Manipulation Commands

○ To \_\_\_ \_\_\_ \_\_\_\_\_\_\_ to \_\_\_ columns of a table
Syntax: INSERT INTO table_name VALUES (values);

A
  • INSERT INTO
    add new records
    all
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SQL Data Manipulation Commands

○ To add new records to all columns of a table
Example: \_\_\_\_\_\_ \_\_\_\_ Students \_\_\_\_\_\_ (‘Reyes’, ‘IT102’);

A
  • INSERT INTO
    INSERT INTO
    VALUES
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SQL Data Manipulation Commands

\_\_\_\_\_\_\_\_\_ \_\_\_\_\_\_ of \_\_\_ \_\_\_\_ or a \_\_\_\_\_\_ \_\_ \_\_\_\_ in a table
Syntax: SELECT columns FROM table_name;

A
  • SELECT
    retrieves values
    all rows
    subset of rows
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

SQL Data Manipulation Commands

— retrieves values of all rows or a subset of rows in a table
Example: \_\_\_\_\_\_ LastName, Section \_\_\_\_ Students;

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

SQL Data Manipulation Commands

○ To \_\_\_\_\_\_ \_\_\_ columns:
Syntax: SELECT * FROM table_name;

A
  • SELECT
    ________select all________
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

SQL Data Manipulation Commands

○ To select all columns:
Example: ` ______ _ ____` Students;

A
  • SELECT
    SELECT * FROM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

SQL Data Manipulation Commands

— an operator used with \_\_\_\_\_\_ to \_\_\_\_\_\_\_\_ \_\_\_\_\_\_ \_\_\_\_\_\_ from \_\_\_\_\_\_\_ in a table
Syntax: SELECT DISTINCT columns FROM table_name;

A
  • DISTINCT
    SELECT
    retrieve unique values
    columns
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

SQL Data Manipulation Commands

— an operator used with SELECT to retrieve unique values from columns in a table
Example: \_\_\_\_\_\_ \_\_\_\_\_\_\_\_ Section \_\_\_\_ Students;

A
  • DISTINCT
    SELECT DISTINCT
    FROM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

SQL Data Manipulation Commands

— an option used with \_\_\_\_\_\_ to \_\_\_\_\_\_ the ` ____ __ ____ based on ________ ________`
Syntax: SELECT columns FROM table_name WHERE condition;

A
  • WHERE
    SELECT
    filter
    rows of data
    provided criteria
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

SQL Data Manipulation Commands

— an option used with SELECT to filter the rows of data based on provided criteria
Example: \_\_\_\_\_\_ _ \_\_\_\_ Students \_\_\_\_\_ Section = ‘IT101’;

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

SQL Data Manipulation Commands

— an option used with SELECT to filter the rows of data based on provided criteria
○ To select numeric fields, do not \_\_\_\_\_\_\_ in ` _________ _____`.
Example: SELECT * FROM Students WHERE Age >= 18;

A
  • WHERE
    enclose
    quotation marks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

SQL Data Manipulation Commands

— an operator used with \_\_\_\_\_\_ to \_\_\_\_\_\_\_\_\_ whether a field is \_\_\_\_\_ \_\_ \_\_\_
Syntax: SELECT columns FROM table_name WHERE column IS NULL;

A
  • IS NULL
    SELECT
    determine
    empty or not
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

SQL Data Manipulation Commands

— an operator used with SELECT to determine whether a field is empty or not
Example: \_\_\_\_\_\_ LastName, Section \_\_\_\_ Students \_\_\_\_\_ Section \_\_ \_\_\_\_;

A
  • IS NULL
    SELECT
    FROM
    WHERE
    IS NULL
17
Q

SQL Data Manipulation Commands

— an operator used with \_\_\_\_\_ to \_\_\_\_\_\_\_\_\_ whether a value \_\_\_\_\_\_\_ a \_\_\_\_\_ \_\_\_\_\_\_ \_\_\_\_\_\_\_
Syntax: SELECT columns FROM table_name WHERE column LIKE pattern;

A
  • LIKE
    WHERE
    determine
    matches
    given string pattern
18
Q

SQL Data Manipulation Commands

— an operator used with WHERE to determine whether a value matches a given string pattern
Wildcards: % represents \_\_\_\_, \_\_\_, or \_\_\_\_\_\_\_\_ \_\_\_\_\_\_\_\_\_\_ while _ represents a \_\_\_\_\_\_ \_\_\_\_\_\_\_\_\_

A
  • LIKE
    zero
    one
    multiple characters
    single character
19
Q

SQL Data Manipulation Commands

— an operator used with WHERE to determine whether a value matches a given string pattern
Example: \_\_\_\_\_\_ _ \_\_\_\_ Students \_\_\_\_\_ LastName \_\_\_\_ ‘_b%’;

A
  • LIKE
    SELECT * FROM
    WHERE
    LIKE
20
Q

SQL Data Manipulation Commands

Example: SELECT * FROM Students WHERE LastName LIKE ‘_b%’;
Meaning: All students with last names have ‘_’ in the \_\_\_\_\_\_ position.

A
  • LIKE
    ________b________
    second
21
Q

SQL Data Manipulation Commands

— an operator used with \_\_\_\_\_ to \_\_\_\_\_ whether a value \_\_\_\_\_\_\_ \_\_\_ \_\_\_\_\_ within a \_\_\_\_\_ \_\_\_\_
Syntax: SELECT columns FROM table_name WHERE column IN (values);

A
  • IN
    WHERE
    check
    matches any value
    given list
22
Q

SQL Data Manipulation Commands

— an operator used with WHERE to check whether a value matches any value within a given list
Example: \_\_\_\_\_\_ _ \_\_\_\_ Students \_\_\_\_\_ Section \_\_ (‘IT101’, ‘IT102’, ‘IT103’);

A
  • IN
    SELECT * FROM
    WHERE
    IN
23
Q

— an operator used with \_\_\_\_\_ to \_\_\_\_\_ whether a value is \_\_\_\_\_\_ a \_\_\_\_\_
Syntax: SELECT column FROM table_name WHERE column BETWEEN value1 AND value2;

A
  • BETWEEN
    WHERE
    check
    within
    range
24
Q

SQL Data Manipulation Commands

— an operator used with WHERE to check whether a value is within a range
Example: \_\_\_\_\_\_ _ \_\_\_\_ Students \_\_\_\_\_ Age \_\_\_\_\_\_\_ 13 \_\_\_ 15;

A
  • BETWEEN
    SELECT * FROM
    WHERE
    BETWEEN
    AND
25
— An option used with `______` to `____ _________ ______` in `_________` or `__________` order ○ *Syntax*: **SELECT** *columns* **FROM** *table_name* **ORDER BY** *columns*;
* **ORDER BY** SELECT sort retrieved values ascending descending
26
— An option used with SELECT to sort retrieved values in ascending or descending order ○ *Example*: `______ _ ____` STUDENTS `_____ __` LastName;
* **ORDER BY** SELECT * FROM ORDER BY
27
— An option used with SELECT to sort retrieved values in ascending or descending order ○ To sort values in `__________` order: `______ _ ____` *table_name* `_____ __` *columns* `____`;
* **ORDER BY** descending SELECT * FROM ORDER BY DESC
28
— `________ ________ _______` in a table ○ *Syntax*: **UPDATE** *table_name* **SET** *column1* = *value1*, ... **WHERE** *condition*;
* **UPDATE** modifies existing records
29
# **SQL Data Manipulation Commands** — modifies existing records in a table ○ *Example*: `______` Students `___` Section = 'IT202', Status = 'Irregular' `_____` StudentID = '2018-100013';
* **UPDATE** UPDATE SET WHERE
30
# **SQL Data Manipulation Commands** — `______ ________ _______` in a table ○ *Syntax*: **DELETE FROM** *table_name* **WHERE** *condition*;
* **DELETE** removes existing records
31
# **SQL Data Manipulation Commands** — removes existing records in a table ○ `______ ____` Students `_____` StudentID = '2018-100013';
* **DELETE** DELETE FROM WHERE
32
# **SQL Data Manipulation Commands** — removes existing records in a table ○ To `______ ___` records: DELETE FROM *table_name*;
* **DELETE** ________delete all________