SQL Flashcards
What is a Database?
A structured collection of data organized and stored into a computer. Designed to efficiently to manage, store, retrieve, and manipulate vast amounts of data.
What is a relational Database?
Type of database that organizes data into tables with predefined relationships between them.
What is a Database “Table”?
A component in a database that represents data organized into rows and columns.
What is a Primary Key and how many can one table have?
A special column or set of columns that uniquely identifies that record. A table can only have one primary key.
What is a Foreign Key and how many can one table have?
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.
What is a SQL Injection Attack and how do you protect yourself against these?
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
What is a SQL Server stored procedure?
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
What language is used to write Stored Procedures?
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
What language do you use to communicate with the database?
Structured Query Language, SQL
Transact-SQL, which is used only by Microsoft other database managed systems (DBMS) use different dialects of SQL.