Data Manipulation Language Flashcards

1
Q

What does SELECT INTO do?

A

Creates a new table based on the result set of a SELECT statement

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

What does the INTO keyword do?

A

Identifies the name of the table to create

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

Where do you place the INTO keyword?

A

The INTO keyword is placed after the last column name in the SELECT clause and before the FROM clause

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

How long do temp tables last?

A

Temp tables are temporary tables that only last for the duration of your SQL Server session

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

What’s the syntax for a local temp table vs a global temp table

A

Local temp tables are prefixed with a hash tag (#), global temp tables are prefixed with two hashtags (##)

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

What does the INSERT statement do?

A

The INSERT statement is used to add one or more rows of
data into an existing table. The data can come from

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

Where does the INSERT statement pull data from?

A

From an external source such as a text file or
Excel spreadsheet

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

What is a ways to enter data into SQL?

A

Enter data manually using the INSERT VALUES clause

INSERT INTO Employee (EmployeeID, LastName, FirstName, Email)
VALUES (101, ‘Doe’, ‘John’, ‘john.doe@example.com’);

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

What is INSERT INTO … SELECT use for?

A

it is used for inserting rows based on the result of a query from another table.

INSERT INTO Customer_temp (CustomerID, LastName, FirstName, Email)
SELECT EmployeeID + 200, LastName, FirstName, Email
FROM Employee
WHERE HireDate > ‘2020-01-01’;

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

How do you remove tables from a database?

A

Drop Table

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

How do you modify existing records in a table?

A

UPDATE statement

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

Which two keywords use the WHERE clause to filter results?

A

The UPDATE and DELETE keywords

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