Full-Stack Basics Flashcards
Learn key React concepts
What is Model Binding?
Model binding retrieves data from requests, populates controller action parameters, takes care of property mapping and type casting typically involved in working with ASP.Net request data.
What is a Database?
A database is an organized collection of structured information, or data, stored in a computer system. It’s set up to easily store, query, and manage data. Commonly stored in tables.
What is a relational Database?
A relational database is a type of database that stores and provides access to data points that are related to one another. These databases are based on relation model, an intuitive, straightforward way of representing data in table.
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.
What is a primary key and how many can on table have?
Primary keys are a columns or a group of columns to uniquely identify and index each record within a table.
A table is only allowed one Primary Key
What is a Foreign Key and how many can one table have?
Foreign keys are a column or a group of columns in a database that are linked to a column in a different table.
This existence of a foreign key column establishes a foreign key constraint.
A table can have multiple foreign keys excluding the primary key column.
What are Indexes?
An index is a data structure that provides a quick lookup mechanism for finding rows in a table based on the values of one or more columns.
If you wanted to delete information from a table what statement would you use?
The delete statement Removes one or more rows from a table or view.
What is the truncate statement used for? What is the key difference between this and your other options to remove data?
the truncate statement removes all rows from a table or specified partitions of a table, without logging the individual row deletions. The delete statement logs each individual row deletion in the transaction logs.
What is data normalization
Database normalization, is technique to organize the contents of the tables for transactional databases and data warehouses to avoid redundancy.
Why would we go through the process of normalizing our data?
There are four goals of data normalization.
- arranging data into logical groupings so that each group describes a small part of the whole.
- minimizing the amount of redundant data in a database.
- organizing the data so that when you modify it, you make the change in only one place.
- building a database in which you can access and manipulate the data quickly and efficiently without compromising the integrity of the storage.
How do you declare a variable in TSQL?
DECLARE { @LOCAL_VARIABLE data_type [ = value ] }
How many normal forms are there?
There are 6 normal forms
the primary forms are:
1NF - Each record entry must contain only a singular value.
2NF - The data must have only one primary key. Then, relationships can be created through new foreign key labels.
3NF - The data in a table must only be dependent on the primary key. If the primary key changes all impacted data must be put into a new table.
What is a SQL Server?
SQL Server: SQL Server is a relational database management system (RDBMS) created by Microsoft. This software allows the user to store and manage data in a structured format, enabling users to interact with the data using the SQL or Structured Query Language, programming language.
What is a SQL Injection Attack and how do you protect yourself against these?
SQL injection is one of the common web attack mechanisms used to steal sensitive data from organizations. It is a code injection technique that hackers use to insert malicious SQL statements into input fields on an application for execution by the underlying database
Protect against these attacks using stored procedures and parameters.
If a stored procedure is too slow how can you enhance the speed?
You can review the execution plan to ensure that ‘table scans’ are minimized and ‘index scans’ are used, instead.
If more information is required you can use SQL Server Profiler to collect information about queries being executed and have SQL Server provide optimization recommendations.
What are higher order components?
A higher Order Component is an advanced way of reusing the component logic. HOC are custom components which wrap other components but they wont modify or copy and behavior from their input component.
What are the limitations of React?
- React is a library not a framework
- Its a very large library and take time to grasp
- It can be difficult to understand
- Coding gets complex as it uses inline templating and JSX
What is a SQL Server stored procedure?
A SQL Server stored procedures are a reusable set of SQL commands that you can save and call whenever you need them.
What language is used to write Stored procedures?
Stored procedures in SQL Server are written using Transact-SQL (T-SQL).
It’s an extension of SQL (Structured Query Language) specifically designed for programming stored procedures, functions, and other database objects.
T-SQL includes additional programming constructs such as variables, control-of-flow statements, and error handling, allowing you to create more complex and powerful database routines.
What language do you use to communicate with the database?
To communicate with a database use a language called SQL (Structured Query Language). SQL is specifically designed for managing and manipulating data stored in relational database management systems (RDBMS). It allows you to perform various operations such as querying data, inserting, update, and deleting records.
What are the different types of statements available to you in TSQL?
- Data Manipulation Language (DML) Statements - These statements are used to manipulate data stored in the database.
- Data Definition Language (DDL) Statements - These statements are used to define, modify, and delete database objects such as tables, views, indexes, and stored procedures.
- Data Control Language (DCL) Statements - These statements are used to control access to the database objects.
- Transaction Control Statements - These statements are used to control transactions in the database.
What are the basic parts of a simple TSQL Query?
- SELECT Clause: Specifies the columns or expressions to be retrieved from the database.
- FROM Clause: Specifies the table or tables from which to retrieve the data. It defines the source of the data for the query.
- WHERE Clause (Optional): Filters the rows returned by the query based on specified conditions.
What are “Joins” used for?
Joins are used when you want to combine data from two or more tables into a single result set based on a related column or condition.
This allows you to retrieve and display information that is spread across multiple tables in the database.
What is an Inner Join?
An inner join is a type of join in SQL that returns only the rows from both tables that satisfy the join condition.
What is a Full Join?
A full join, also known as a full outer join, is a type of join in SQL that returns all rows from both tables being joined, regardless of whether there is a match between the tables.
What is a Left Join?
A left join, also known as a left outer join, is a type of join in SQL that returns all rows from the left table (the “left” side of the join), along with matching rows from the right table (the “right” side of the join). If there is no match for a row in the right table, the columns from the right table will contain NULL values in the result set.
What is a Right Join?
A right join, also known as a right outer join, is a type of join in SQL that returns all rows from the right table (the “right” side of the join), along with matching rows from the left table (the “left” side of the join). If there is no match for a row in the left table, the columns from the left table will contain NULL values in the result set.
What does it mean to be a strongly typed language?
A strongly typed language is a programming language where every variable must be associated with a specific data type, this data type is enforced at compile-time. Once a variable is declared with a certain data type, it cannot be used to store values of any other incompatible data type without explicit conversion.
In .Net how many classes can one class inherit from?
In .NET, a class can inherit from only one base class. This is known as single inheritance. Unlike some other programming languages like C++, which support multiple inheritance
What are Generics in .Net?
Generics in .NET provide a way to define classes, interfaces, and methods with placeholders for the data types they operate on.
Why are Generics so important?
This allows you to create flexible components and algorithms that are type-safe and reusable across different data types which also leads to less redundant code.
-DRY Principle.
- Generics are widely used in defining collection classes. These generic collection classes provide type-safe storage for elements of any data type, making it easy to work with collections of objects.
What is IEnumerable and what significance does it hold?
IEnumerable in .NET represents a list of items that can be enumerated or that you can go through one by one. It’s like a book with pages you can turn, where each page is an item in the list. This interface is important because it allows you to work with collections of objects in a flexible and efficient way. It’s commonly used for tasks like looping through items, filtering data, and performing calculations.
Can you create an instance of an abstract class?
No.
What are Interfaces?
- An interface defines a contract for classes by specifying a set of method and property signatures that implementing classes must provide.
- Interfaces cannot contain any implementation code; they only define method and property signatures.
- A class can implement multiple interfaces, allowing it to adhere to multiple contracts.
- Interfaces are useful for achieving polymorphism and creating loosely coupled systems, as they enable classes to interact with each other without knowing the specific implementation details.
What are Nullable Types?
Nullable value types allow variables to have an additional state beyond their normal range of values. they extend this behavior by allowing variables to have the value of null in addition to their usual range of values. Null the absence of value
What are the different parts of a Connection String?
The Database/server name your trying to access, User credentials, and Password
What are Connection Strings?
Connection strings are strings of text used to specify information needed to connect to a database or another data source.
How do you access the underlying value of a Nullable Type?
There are two ways to access the underlying the value of a nullable type using either the “.Value” property if you know the nullable type has a value.
int? nullableInt = 10;
int intValue = nullableInt.Value ;
If you are unsure you can access the underlying value using the Null-Coalescing Operator “??”. You can use this by placing the nullable type on the left of the “??” and the value to give it, if it is null.
int? nullableInt = 10;
int intValue = nullableInt ?? 0 ;
What is the best way to concatenate strings in .Net and why?
The best way to concatenate strings is to use the “StringBuilder” class. The reason is because it is optimized to be efficient, use less memory, readability, and mutability(allowing you to modify the string buffer directly.
What are Collections in .Net?
Collections are objects that store groups of related elements. some examples: lists, arrays, dictionaries, and sets
How would you declare an array in C#?
typeName[] arrayName = { value1, value2, …, valueN };
What is attribute routing?
Allows developers to define routes directly within their controller classes and action methods using attributes. This means you can specify URLs for your web API endpoints right where you define your methods.
Attribute routing provides a more concise and intuitive way to define routes, making it easier to understand and maintain your API’s URL structure.
How do you store Flags in an Enum?
Storing flags in an enum involves using the [Flags] attribute in C#. This attribute allows you to combine enum values using bitwise operations to represent multiple flags.
What is a static member or property in .Net?
A static property in .NET is a class-level member that belongs to the type itself. It is shared among all instances of the class and can be accessed directly through the class name. No instance necessary