SQL

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

8 Terms

1
New cards

SELECT

Use Case: Retrieves specified columns or expressions from one or more database tables.

Syntax:SELECT column1, column2 FROM table_name;

2
New cards

GROUP BY

Use Case: Groups rows that have identical values in specified columns into summary rows, often used with aggregate functions.

Syntax:SELECT column_name, COUNT(*) FROM table_name GROUP BY column_name;

3
New cards

COUNT

Use Case: Returns the number of rows or non-null column values matching specified criteria.

Syntax:SELECT COUNT(column_name) FROM table_name;

4
New cards

ORDER BY

Use Case: Sorts the query results in ascending (ASC) or descending (DESC) order based on one or more columns.

Syntax:SELECT column1, column2 FROM table_name ORDER BY column1 ASC|DESC;

5
New cards

UNION

Use Case: Combines the distinct result sets of two or more SELECT statements into a single result set.

Syntax:SELECT column1 FROM table1 UNION SELECT column1 FROM table2;

6
New cards

CASE WHEN

Use Case: Applies conditional logic within a query to return specific values based on defined conditions.

Syntax:SELECT column1, CASE WHEN condition1 THEN result1 ELSE result2 END FROM table_name;

7
New cards

DROP

Use Case: Permanently deletes an existing database object, such as a table or index, along with all its data.

Syntax:DROP TABLE table_name;

8
New cards

ALTER

Use Case: Modifies the structural definition of an existing database table, such as adding, deleting, or altering columns.

Syntax:ALTER TABLE table_name ADD column_name datatype;