Basics Flashcards
(28 cards)
What does SQL stand for?
SQL stands for Structured Query Language
What does RDBMS stand for?
RDBMS stands for Relational Database Management system
What is RDBMS?
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.
Does SQL case-sensitive language?
No
To deletes data from a database
Use DELETE
What we can use Like in SQL
with where
What does % mean in Like?
The percent sign (%) represents zero, one, or multiple characters
What does _ mean in Like?
The underscore sign (_) represents one, a single character
“WHERE CustomerName LIKE ‘a%’ “ means?
Finds any values that start with “a”
“WHERE CustomerName LIKE ‘%a’” means?
Finds any values that end with “a”
“WHERE CustomerName LIKE ‘%or%’” means?
Finds any values that have “or” in any position
“WHERE CustomerName LIKE ‘_r%’” means?
Finds any values that have “r” in the second position
“WHERE CustomerName LIKE ‘a_%’ “ means?
Finds any values that start with “a” and are at least 2 characters in length
“WHERE CustomerName LIKE ‘a__%’” means?
Finds any values that start with “a” and are at least 3 characters in length
‘WHERE ContactName LIKE ‘a%o’” means?
Finds any values that start with “a” and end with “o”
where we can use ORDER BY in SQL?
The ORDER BY keyword is used to sort the result-set in ascending (تصاعدي) or descending (تنازلي) order.
what happens if we use order by with several columns?
it will sort rows with the first column, and if multi rows have the same value it will sort them with the second column.
How many ways we can use to insert a new record?
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, …);
- 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, …);
what is “UPDATE” syntax?
UPDATE table_name
SET column1 = value1, column2 = value2, …
WHERE condition;
what happens if we don’t use “where” with the update, and delete statements?
it will update/delete all records
what is “DELETE” syntax?
DELETE FROM table_name WHERE condition;
What is ‘Wildcards’?
A wildcard character is used to substitute one or more characters in a string.
what does [] mean in like query?
Represents any single character within the brackets
what does % mean in like query?
Represents zero or more characters