SQL Commands Flashcards

1
Q

Alter Table

A

Adds new column or deletes column or index

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

Add

A

Adds a new column to the table

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

Drop Column

A

Deletes the column

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

Create Index # on Column

A

Creates an index on the table

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

Select

A

Retrieves and sorts information

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

Insert Into

A

Add a row to the table

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

Update, Set

A

Change the value of a column

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

What is a Procedure

A

Stored SQL code to be used later

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

select *

A

select any

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

select gender
, count (*)
from Employee
group by Gender

A

Shows the amount of men and women (shows the amount of people for each classification of genders)

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

CONCAT

A

Adds two or more strings together

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

distinct

A

prevents duplicates from being displayed in the query.

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

where

A

filter records displayed that meet a certain condition

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

or requires how many sides to be true

A

1

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

and requires how many sides to be true

A

both sides

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

IN

A

multiple or statements, returns all values separated by a comma.

17
Q

between

A

selects values within a given range

18
Q

union

A

combine results of 2 select statements with the same number of columns

19
Q

Except

A

Exclude in first query if it happens as well in the second query

20
Q

Intersect

A

Include queries from ONLY both rows

21
Q

’%’

A

Return arbitrary amount of results

22
Q

‘_’

A

Return only a single character

23
Q

cross join

A

comparing each row of the first table with each one of the second table.

24
Q

into

A

combine two completely different table result sets. Both tables need to be accessable
use Student16
go

select * from LobsterFarm.dbo.employee

25
Q

drop table if exists

A

delete a table from the database (unrecoverable if there is no backup, there is no confirmation message)

26
Q

go

A

indicates that prior commands are ready to be executed

27
Q

with

A

allows you to give a subquery block a name

28
Q

insert

A

insert new records into the table

29
Q

update

A

modify existing data

30
Q

delete

A

delete existing records