Lesson 3 (MIDTERM) Flashcards

(11 cards)

1
Q

Creating a basic table involves naming the table and defining its columns and each column’s data type.
The SQL _______ ______ statement is used to create a new table

A

CREATE TABLE

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

The SQL _________ command is used to add, delete or modify columns in an existing table.

A

ALTER TABLE

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

You would also use ________ command to add and drop various constraints on an existing table.

A

ALTER TABLE

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

To change the name of an existing table

A

ALTER TABLE - ALTER/RENAME TABLE

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

To change the data type of a column in a table

A

ALTER TABLE - ALTER/MODIFY COLUMN

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

is used to remove database objects, such as tables, indexes, or views, from a database.

A

The DROP command

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

in SQL is used to retrieve data from one or more tables. It is one of the fundamental and most commonly used statements in SQL

A

SELECT Statement

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

Optional. Filter the rows based on a specified condition. It restricts the result set to only include rows that satisfy the condition

A

Where Clause

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

Optional. Sorts the result set based on one or more columns. Default is ascending (ASC), but you can specify descending (DESC)

A

ORDER BY Clause

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

Used with aggregate functions to group and filter data.

A

GROUP BY and HAVING CLAUSES

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

SELECT AVG(salary) FROM employees;

A

Aggregate Functions (SUM, AVG, MIN, MAX, COUNT): Perform calculations on data

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