Introduction Flashcards

(17 cards)

1
Q

SQL, which stands for Structured Query Language, is a programming language that is used to communicate with and manage databases.

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

Data Definition Language (DDL)

A

It lets you to create, alter, or delete databases and their related objects like tables, views, etc. Commands include CREATE, ALTER, DROP, and TRUNCATE.

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

Data Manipulation Language (DML)

A

It lets you manage data within database objects. These commands include SELECT, INSERT, UPDATE, and DELETE.

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

Data Control Language (DCL)

A

It includes commands like GRANT and REVOKE, which primarily deal with rights, permissions and other control-level management tasks for the database system.

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

What’s a database?

A

A database is an organized collection of data.

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

The SELECT first_name, FROM employees, and WHERE are clauses in the SQL statement. Some clauses are mandatory e.g., the SELECT and FROM clauses whereas others are optional such as the WHERE clause.

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

Each command is composed of tokens that can be literals, keywords, identifiers, or expressions. Tokens are separated by space, tabs, or newlines.

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

Literals

A

Literals are explicit values which are also known as constants. SQL provides three kinds of literals: string, numeric, and binary.

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

String literal consists of one or more alphanumeric characters surrounded by single quotes

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

50 is a number. However, if you surround it with single quotes e.g., ‘50’, SQL treats it as a string literal.

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

SQL is case sensitive with respect to string literals, so the value ‘John’ is not the same as ‘JOHN’

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

Numeric literals are the integer, decimal, or scientific notation, for example:

200
-5
6.0221415E23

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

SQL represents binary value using the notation x’0000’, where each digit is hexadecimal value

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

Keywords

A

SQL has many keywords that have special meanings such as SELECT, INSERT, UPDATE, DELETE, and DROP. These keywords are the reserved words, therefore, you cannot use them as the name of tables, columns, indexes, views, stored procedures, triggers, or other database objects.

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

Identifiers

A

Identifiers refer to specific objects in the database such as tables, columns, indexes, etc. SQL is case-insensitive with respect to keywords and identifiers.

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

When parsing SQL statements with comments, the database engine ignores the characters in the comments.

A comment is denoted by two consecutive hyphens ( –) that allow you to comment the remaining line.
– employees with low salary

17
Q

To document the code that can span multiple lines, you use the multiline C-style notation ( /**/)
/* increase 5% for employees whose salary is less than 3,000 */