Lesson 2 (MIDTERM) Flashcards

(43 cards)

1
Q

What does SQL stands for?

A

Structured Query Language

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

is a computer language for storing, manipulating and retrieving data stored in relational database.

A

SQL or Structured Query Language

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

What does RDBMS stands for?

A

Relational Database Management System.

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

SQL is the standard language for _______ _______ ______

A

Relational Database Management System.

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

like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as their standard database language.

A

Relational Database Management System (RDBMS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  • can execute queries against a database
  • can retrieve data from a database
  • can insert records in a database
  • can update records in a database
  • can delete records from a database
  • can create new databases
  • can create new tables in a database
  • can create stored procedures in a database
  • can create views in a database
  • can set permissions on tables, procedures, and views
A

SQL

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

is basically just a software application which we can use to create and manage different databases.

A

Relational Database Management System.

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

is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access

A

Relational Database Management System.

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

What are the components of RDBMS

A
  • Tables
  • Relations
  • Keys
    – Primary Key
    – Foreign Key
  • Normalization
  • ACID properties (Atomicity, Consistency, Isolation, Durability)
  • SQL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the numeric data types

A

TINYINT
SMALLINT
MEDIUMINT(size)
INT
BIGINT
DECIMAL(x,y)

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

can store numbers from -128 to 127

A

TINYINT

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

can store numbers from -32768 to 32767

A

SMALLINT

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

can store numbers from -8,388,608 to 8,388,607

A

MEDIUMINT(size)

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

can store numbers from -2,147,483,648 to 2,147,483,647

A

INT

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

can store numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

A

BIGINT

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

can store decimal number of total x digits (max up to 65) of which y digits (max up to 30) are allocated after the decimal point

A

DECIMAL(x,y)

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

What are the string data types

A

VARCHAR(x)
BINARY(x)
TINYTEXT
MEDIUMTEXT
LONGTEXT

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

can store characters up to given length (max 8000 characters)

19
Q

can store binary strings of fixed length

20
Q

can store up to 255 characters TEXT(x) can store characters up to the given limit (max 65,535 bytes)

21
Q

can store characters up to 16,777,215 characters

22
Q

can store characters up to 4,294,967,295 characters

23
Q

What are the date and time data types

A

TIMESTAMP(fsp)
DATE
TIME(fsp)
Year

24
Q

can store date and time Format: YYYY-MM-DD hh:mm:ss. (‘1970-01-01 00:00:00’ UTC)

A

TIMESTAMP(fsp)

25
can store only date Format: YYYY-MM-DD. The supported range is from '1000-01-01' to '9999-12-31'
DATE
26
can store only time. Format: hh:mm:ss. The supported range is from '-838:59:59' to '838:59:59'
TIME(fsp)
27
A year in four-digit format. Values allowed in four-digit format: 1901 to 2155, and 0000.
Year
28
in a table is a value in a field that appears to be blank, which means a field with a _______ is a field with no value.
NULL
29
are the rules enforced on data columns on table.
Constraints
30
These are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the database.
Constraints
31
Ensures that a column cannot have NULL value. By default, a column can hold NULL values. If you do not want a column to have a NULL value, then you need to define such constraint on this column specifying that NULL is now not allowed for that column. A NULL is not the same as no data, rather, it represents unknown data.
NOT NULL
32
Provides a default value for a column when none is specified. The ________ constraint provides a default value to a column when the INSERT INTO statement does not provide a specific value.
DEFAULT Constraint
33
Ensures that all values in a column are different.
UNIQUE Constraint
34
prevents two records from having identical values in a particular column. In the CUSTOMERS table, for example, you might want to prevent two or more people from having identical age.
UNIQUE Constraint
35
Uniquely identified each rows/records in a database table.
Primary Key
36
is a field in a table which uniquely identifies each row/record in a database table.
Primary Key
37
must contain unique values. A ______ column cannot have NULL values.
Primary Key
38
Uniquely identified a rows/records in any another database table
Foreign Key
39
Use to create and retrieve data from the database very quickly.
Index
40
Technique of organizing data in a database, a systematic approach that aims to reduce data redundancy and anomalies (such as insert, update, delete anomalies) by breaking down large table into smaller tables.
Normalization
41
- Every column should only have 1 value each row. - Each row should be unique. - Not mandatory to have primary key.
1st Normal Form
42
- Builds on 1NF and eliminates partial dependencies. - If a non-key attribute is partial dependent on a candidate key then split them into a separate table and be fully dependent on the primary key.
2nd Normal Form
43
- Build on 2nd . - Avoid Transitive dependencies, meaning no non-key column should depend on another non-key column.
3rd Normal Form