SQL Flashcards

1
Q

What is a Database?

A

A structured collection of data organized and stored into a computer. Designed to efficiently to manage, store, retrieve, and manipulate vast amounts of data.

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

What is a relational Database?

A

Type of database that organizes data into tables with predefined relationships between them.

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

What is a Database “Table”?

A

A component in a database that represents data organized into rows and columns.

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 special column or set of columns that uniquely identifies that record. A table can only have one primary key.

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

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

A

It is a column or a set of columns in one table that references the primary key of another table. The number can very from one to many.

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

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

A

A security vulnerability that an attacker can manipulated input data into a query letting the attacker have unauthorized access, allow data manipulation, or even data loss

Prepared statements/Parameterized Queries
Input Validation and Sanitization
Least Privilege Principle
Escape Special Characters
Principle of Least Exposure
Regular updates and security patches
Secure coding practices

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

What is a SQL Server stored procedure?

A

A named and precompiled set of SQL statements and procedural logic that is stored in the database. It is a database object that can be invoked and executed multiple times with different parameters. Manage a database efficiently by providing code reusability, performance optimization , security, and data consistency

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

What language is used to write Stored Procedures?

A

Transact-Structured Query Language, which is a language extension of SQL. Can be used to create complex and logic-driven database objects such as store procedures , functions, and triggers. TSQL is specific to Microsoft

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

What language do you use to communicate with the database?

A

Structured Query Language, SQL
Transact-SQL, which is used only by Microsoft other database managed systems (DBMS) use different dialects of SQL.

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