Basics Flashcards

(28 cards)

1
Q

What does SQL stand for?

A

SQL stands for Structured Query Language

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

What does RDBMS stand for?

A

RDBMS stands for Relational Database Management system

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

What is RDBMS?

A

RDBMS is the basis for SQL, and for all modern database systems.
The data in RDBMS is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows.

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

Does SQL case-sensitive language?

A

No

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

To deletes data from a database

A

Use DELETE

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

What we can use Like in SQL

A

with where

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

What does % mean in Like?

A

The percent sign (%) represents zero, one, or multiple characters

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

What does _ mean in Like?

A

The underscore sign (_) represents one, a single character

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

“WHERE CustomerName LIKE ‘a%’ “ means?

A

Finds any values that start with “a”

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

“WHERE CustomerName LIKE ‘%a’” means?

A

Finds any values that end with “a”

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

“WHERE CustomerName LIKE ‘%or%’” means?

A

Finds any values that have “or” in any position

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

“WHERE CustomerName LIKE ‘_r%’” means?

A

Finds any values that have “r” in the second position

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

“WHERE CustomerName LIKE ‘a_%’ “ means?

A

Finds any values that start with “a” and are at least 2 characters in length

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

“WHERE CustomerName LIKE ‘a__%’” means?

A

Finds any values that start with “a” and are at least 3 characters in length

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

‘WHERE ContactName LIKE ‘a%o’” means?

A

Finds any values that start with “a” and end with “o”

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

where we can use ORDER BY in SQL?

A

The ORDER BY keyword is used to sort the result-set in ascending (تصاعدي) or descending (تنازلي) order.

17
Q

what happens if we use order by with several columns?

A

it will sort rows with the first column, and if multi rows have the same value it will sort them with the second column.

18
Q

How many ways we can use to insert a new record?

A

2 ways,
1. Specify both the column names and the values to be inserted:
INSERT INTO table_name (column1, column2, column3, …)
VALUES (value1, value2, value, …);

  1. If you are adding values for all the columns of the table, you do not need to specify the column names in the SQL query. However, make sure the order of the values is in the same order as the columns in the table:
    INSERT INTO table_name
    VALUES (value1, value2, value3, …);
19
Q

what is “UPDATE” syntax?

A

UPDATE table_name
SET column1 = value1, column2 = value2, …
WHERE condition;

20
Q

what happens if we don’t use “where” with the update, and delete statements?

A

it will update/delete all records

21
Q

what is “DELETE” syntax?

A

DELETE FROM table_name WHERE condition;

22
Q

What is ‘Wildcards’?

A

A wildcard character is used to substitute one or more characters in a string.

23
Q

what does [] mean in like query?

A

Represents any single character within the brackets

24
Q

what does % mean in like query?

A

Represents zero or more characters

25
what does _ mean in like query?
Represents a single character
26
what does ^ mean in like query?
Represents any character not in the brackets
27
what does - mean in like query?
Represents any single character within the specified range
28
Where we can use IN
The IN operator allows you to specify multiple values in a WHERE clause. The IN operator is a shorthand for multiple OR conditions. we can use select statement in IN cluse