SQL and Database Management (1)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

37 Terms

1
New cards

What does SQL stand for?

Structured Query Language.

2
New cards

What is the primary purpose of SQL?

To access and manipulate databases.

3
New cards

When did SQL become a standard of ANSI and ISO?

ANSI in 1986 and ISO in 1987.

4
New cards

What is the function of the SELECT command in SQL?

It is used to query and retrieve data from a database.

5
New cards

What does the SELECT * statement do?

Retrieves all columns from a table.

6
New cards

What is the purpose of the SELECT DISTINCT statement?

Returns only distinct (unique) values in a column.

7
New cards

What does the ORDER BY clause do?

Sorts the result set in ascending or descending order.

8
New cards

What are arithmetic operators used for in SQL?

To perform mathematical operations on numeric data.

9
New cards

List the arithmetic operators used in SQL.

+ (Addition), - (Subtraction), * (Multiplication), / (Division), % (Modulo).

10
New cards

What is a column alias in SQL?

A temporary name given to a column in the result set, often using the AS keyword.

11
New cards

What is a table alias in SQL?

A temporary name given to a table, useful in queries involving multiple tables.

12
New cards

What does the ALTER TABLE command do?

Modifies an existing table by adding, modifying, or dropping columns.

13
New cards

What is the DROP TABLE command used for?

To delete an entire table from a database along with all its data.

14
New cards

What does the RENAME command do in SQL?

Allows you to rename an existing table.

15
New cards

What does CRUD stand for?

Create, Read, Update, Delete.

16
New cards

How do you add data to a table in SQL?

Using the INSERT INTO statement.

17
New cards

What SQL statement is used to retrieve data?

The SELECT statement.

18
New cards

How do you update existing records in SQL?

Using the UPDATE statement along with a WHERE condition.

19
New cards

What is the purpose of the LIMIT clause in SQL?

To restrict the number of rows returned by a query.

20
New cards

What is the significance of using aliases in SQL?

To improve readability and provide temporary names for tables or columns.

21
New cards

What is the purpose of the DELETE FROM statement in SQL?

To delete data from a table based on a specified WHERE condition.

22
New cards

What is a constraint in SQL?

A rule applied to a column in a table to control the kind of data that can be stored in that column.

23
New cards

What does the NOT NULL constraint ensure?

That a column cannot have a NULL value.

24
New cards

What is the DEFAULT constraint used for?

To assign a default value to a column if no value is provided during an insert.

25
New cards

What does the UNIQUE constraint do?

Ensures that all values in a column (or group of columns) are distinct.

26
New cards

What is the PRIMARY KEY constraint?

Uniquely identifies each row in a table and automatically applies NOT NULL and UNIQUE.

27
New cards

What is the purpose of the FOREIGN KEY constraint?

Enforces a link between two tables, ensuring that the value in one column matches a value in another table's primary key.

28
New cards

What is a single-row function in SQL?

A function that takes input from one row and returns a single value for that row.

29
New cards

What are the key characteristics of single-row functions?

They operate on one row at a time and return one result per input row.

30
New cards

What is the GROUP BY clause used for in SQL?

To group rows that have the same values in specified columns, commonly used with aggregate functions.

31
New cards

What does the COUNT() function do?

Counts the number of rows in a group.

32
New cards

What is the purpose of the DISTINCT keyword in SQL?

Removes duplicate values from the result set, returning unique values only.

33
New cards

What are general functions in SQL?

Functions that handle nulls, data types, and general operations.

34
New cards

What do CASE CONVERSION functions do?

Change the letter case in string data.

35
New cards

What are character functions used for?

To manipulate string data.

36
New cards

What do date functions work with?

Date/time values, allowing extraction of parts of those values.

37
New cards

What do number functions perform operations on?

Numeric values.