SQL Flashcards

1
Q

What does SQL stand for?

A

“Structured Query Language”

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

What can SQL do?

A

SQL can retrieve, insert, update, and delete records in a database via executing queries against a database. You can also create new databases, as well as tables, stores procedures, and views in the database.

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

What are the five major commands in SQL?

A

SELECT, UPDATE, DELETE, INSERT, and WHERE.

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

How would you select all entries in the table titled “Customers”?

A

SELECT * FROM Customers;

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

What is another name for a “record”?

A

A “row”. Which is a horizontal entity in a table.

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

What is a column?

A

A vertical entity in a table that contains all information associated with a specific field in a table.

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

Are SQL keywords case sensitive?

A

No.

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

Are semicolons required after SQL statements?

A

Some versions of SQL require it, however it’s standard practice to use a semicolon to separate your statements.

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

What is the SELECT keyword used for?

A

Extracting data from a database.

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

What is the UPDATE keyword used for?

A

Updating data in a database.

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

What is the DELETE keyword used for?

A

Deleting data from a database.

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

What is the INSERT INTO keyword used for?

A

Inserting new data into a dabase.

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

What is the ALTER keyword used for?

A

Modifying existing tables/databses.

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

What is the DROP keyword user for?

A

Deleting existing tables/databases.

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

How would you select only the “City” row from the “Customers” database.

A

SELECT City FROM Customers;

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

Fill in the blank: ______ City, CustomerName FROM Customers;

A

SELECT City, CustomerName FROM Customers;

17
Q

What keyword would you use to select ONLY distinct items from a database?

A

SELECT DISTINCT columnx, columny FROM table_name;

18
Q

What is the WHERE keyword used for?

A

It is used to extract records under a specific condition.

19
Q

Write a SQL statement that will select all from the Customers database where the country equals “Mexico”.

A

SELECT * FROM Customers
Where Country = ‘Mexico’;

20
Q

What operators can be used with the WHERE clause?

A

AND, and OR.

21
Q

Write a statement using AND, and OR in a WHERE clause.

A

SELECT column1
FROM table_name
WHERE condition1 AND condition2

21
Q

Write a statement using AND in a WHERE clause.

A

SELECT column1
FROM table_name
WHERE condition1 AND condition2