sql Flashcards

1
Q

What is the fundamental approach of SQL in terms of data manipulation?

A

they are not the core concept of SQL being set-oriented.

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

What is the primary difference between a declarative language like SQL and a procedural language like C++?

A

Declarative: In a declarative language like SQL, you specify what you want to achieve (e.g., “Select all customers from the Customers table”). The system determines how to achieve it.

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

What are the two primary ways SQL can be used?

A

interactive embedded

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

What is the primary function of the SELECT statement in SQL?

A

The primary function of the SELECT statement is to retrieve data from a relational database.

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

What is the primary function of the WHERE clause in a SQL SELECT statement?

A

While the WHERE clause can filter data horizontally (selecting specific rows based on conditions), its primary function is to apply conditions to the dataset.

Here’s a more accurate explanation:

Filtering: The WHERE clause filters rows based on specified conditions.
Conditions: These conditions are typically expressed using comparison operators (e.g., =, <, >, <>, BETWEEN, IN) and logical operators (e.g., AND, OR, NOT).

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

What is the primary function of the GROUP BY clause in a SQL SELECT statement?

A

Grouping: The GROUP BY clause specifies the columns by which you want to group the data.
Aggregation: You often use aggregate functions (like SUM, AVG, COUNT, MIN, MAX) with GROUP BY to calculate values for each group.

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

What is the difference between an inner join and an outer join in SQL?

A

Inner join:

Returns only the rows that have matching values in both tables. It’s like finding the overlap between two sets of data.
Outer join: Returns all rows from one table, even if there are no matching rows in the other table. It’s like merging two sets of data, including the parts that don’t overlap.

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