SQL Deck 1 Flashcards

1
Q

What is a Database?

A

A database is an organized collection of data, generally stored and accessed electronically from a computer system.

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

What is a relational Database?

A

A relational database is a type of database that stores and provides access to data points that are related to one another. Relational databases are based on the relational model, an intuitive, straightforward way of representing data in tables. In a relational database, each row in the table is a record with a unique ID called the key. The columns of the table hold attributes of the data, and each record usually has a value for each attribute, making it easy to establish the relationships among data points.

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

What is a database “Table”?

A

A table is a collection of related data held in a table format within a database. It consists of columns, and rows. In relational databases, and flat file databases, a table is a set of data elements using a model of vertical columns and horizontal rows, the cell being the unit where a row and column intersect.

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

What is a Primary Key and how many can one table have?

A

A primary key is a field in a table which uniquely identifies each row/record in a database table. A table can have only one primary key.

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

What is a Sql Injection Attack and how do you protect yourself against these?

A

SQL Injections attacks are attacks that search for vulnerabilities and ultimately “inject” malicious code in your database.Developers can prevent SQL Injection vulnerabilities in web applications by utilizing parameterized database queries with bound, typed parameters and careful use of parameterized stored procedures in the database

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

What is a Sql Server stored procedure?

A

A stored procedure is a set of Structured Query Language (SQL) statements with an assigned name, which are stored in a relational database management system as a group, so it can be reused and shared by multiple programs.Stored procedures in SQL Server can accept input parameters and return multiple values of output parameters; in SQL Server, stored procedures program statements to perform operations in the database and return a status value to a calling procedure or batch. They allow modular programming and faster execution.

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

What language is used to write Stored procedures?

A

We use SQL (Structured Query Language)

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

What language do you use to communicate with the database?

A

We use SQL (Structured Query Language)

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

What are the different types of statements available to you in TSQL?

A

T-SQL Statements - DML and DDL

DDL (Data Definition Language)
Data Definition Language (DDL) statements defines objects in a database. Use DDL statements to create, alter, or drop objects in a database.

CREATE
ALTER
DROP
RENAME
DISABLE TRIGGER
ENABLE TRIGGER
COLLATIONS
UPDATE STATISTICS

DML (Data Manipulation Language)
Data Manipulation Language (DML) affect the information stored in the database. Use DML statements to insert, update, and delete the rows in the database.

INSERT
DELETE
MERGE
BULK INSERT
TRUNCATE TABLE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are indexes?

A

Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very similar to an index in the back of a book.

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