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

True or False: SQL is used to communicate with databases.

A

True

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

Fill in the blank: The command used to retrieve data from a database is called _____ .

A

SELECT

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

What is the purpose of the WHERE clause in SQL?

A

To filter records based on specified conditions.

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

Which SQL command is used to add new records to a database?

A

INSERT

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

True or False: The SQL command UPDATE is used to delete records from a database.

A

False

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

What is the primary key in a database?

A

A unique identifier for each record in a table.

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

What does the GROUP BY clause do in SQL?

A

It groups rows that have the same values in specified columns into summary rows.

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

Which SQL keyword is used to sort the result set?

A

ORDER BY

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

What is a foreign key?

A

A field in one table that uniquely identifies a row of another table.

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

Fill in the blank: The SQL command used to remove records from a table is _____ .

A

DELETE

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

What is the purpose of the JOIN clause in SQL?

A

To combine rows from two or more tables based on a related column.

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

Which SQL command is used to modify existing records in a database?

A

UPDATE

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

True or False: The DISTINCT keyword is used to return only unique values.

A

True

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

What does the COUNT function do in SQL?

A

Returns the number of rows that match a specified criterion.

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

What is normalization in database design?

A

The process of organizing data to reduce redundancy and improve data integrity.

17
Q

What is the function of the HAVING clause?

A

To filter records after an aggregation has been performed.

18
Q

Fill in the blank: In SQL, the _____ command is used to create a new table.

A

CREATE TABLE

19
Q

What is a subquery?

A

A query nested inside another query.

20
Q

True or False: SQL is a case-sensitive language.

A

False

21
Q

What does the term ‘data type’ refer to in SQL?

A

A classification that specifies which type of value a column can hold.

22
Q

Which SQL function is used to find the maximum value in a set?

A

MAX()

23
Q

What is a view in SQL?

A

A virtual table based on the result of a SELECT query.

24
Q

Fill in the blank: The SQL command to change the structure of an existing table is _____ .

A

ALTER TABLE

25
Q

What is the purpose of the LIMIT clause in SQL?

A

To specify the maximum number of records to return.

26
Q

Which SQL command is used to define a new database?

A

CREATE DATABASE

27
Q

What does the term ‘transaction’ mean in SQL?

A

A sequence of operations performed as a single logical unit of work.