Questions
stringlengths
5
360
Answers
stringlengths
6
2.23k
what are the three degrees of normalization and how is normalization done in each degree?
null
what are the different database objects?
null
what is collation?
null
what is a constraint and what are the seven constraints?
null
what is a surrogate key?
null
and how can it be improved?
The Derived Column a new column that is generated on the fly by applying expressions to transformation input columns. Ex: FirstName + + LastName AS Full name Derived column affect the performances of the data base due to the creation of a temporary new column. Executio n plan can save the new column to have better performance next time.
what is a transaction?
null
what are the differences between oltp and olap?
OLTP stands fo r Online Transactional Processing OLAP stands for Online Analytical Processing OLTP: Normalization Level: highly normalized Data Usage : Current Data (Database) Processing : fast for delta operations (DML) Operation : Delta operation (update, insert, de lete) aka DML Terms Used : table, columns and relationships OLAP: Normalization Level: highly denormalized Data Usage : historical Data (Data warehouse) Processing : fast for read operations Operation : read operation (select) Terms Used : dimension ta ble, fact table
how do you copy just the structure of a table?
null
what are the different types of joins?
null
what are the different types of restricted joins?
null
what is a subquery?
null
what are the set operators?
null
what is a derived table?
null
what is a view?
null
follow me https www you tubecomcsauravagarwal18 what are the types of views?
null
what is an indexed view?
null
what does with check do?
null
what is a ranking function and what are the four ranking functions?
null
what is partition by?
null
what is temporary table and what are the two types of it they are tables just like
null
explain variables?
Variable is a memory space (place holder) that contains a scalar value EXCEPT table variables, which is 2D data. Variable in SQL Server are created using DECLARE Statement. Variables are BATCH -BOUND. Variables that start with @ are user -defined va riables.
explain dynamics qld sql?
null
what is sql injection attack?
null
what is self join?
null
what is correlated subquery?
null
what is the difference between regular subquery and correlated subquery?
Based on the above explanation, an inner subquery is independent from its outer subquery in Regular Subquery. On the other hand, an inner subqu ery depends on its outer subquery in Correlated Subquery.
what are the differences between delete and truncate?
Delete: Follow Me : https://www.yo utube.com/c/SauravAgarwa l DML statement that deletes rows from a table and can also specify rows using a WHERE clause. Logs every row deleted in the log fi le. Slower since DELETE records every row that is deleted. DELETE continues using the earlier max value of the identity column. Can have triggers on DELETE. Truncate: DDL statement that wipes out the entire table and you cannot delete specific rows. Does m inimal logging, minimal as not logging everything. TRUNCATE will remove the pointers that point to their pages, which are deallocated. Faster since TRUNCATE does not record into the log file. TRUNCATE resets the identity column. Cannot have triggers on TRU NCATE.
what are the three different types of control flow statements?
null
what is table variable explain its advantages and disadvantages?
null
follow me https www you tubecomcsauravagarwal33 what are the differences between temporary table and table variable?
null
what is stored procedures ?
null
what are the four types of sp?
System Stored Procedures (SP_****): built -in stored procedures that were created by Microsoft. User Defined Stored Procedures: stored procedures that are created by users. Common naming convention (usp_****) CLR (Common Language Runtime): stored procedures that are impl emented as public static methods on a class in a Microsoft .NET Framework assembly. Extended Stored Procedures (XP_****): stored procedures that can be used in other platforms such as Java or C++.
explain the types of sp.
SP with a single input parameter: SP with multiple parameters: SP with output parameters: Extracting data from a stored procedure based on an input parameter and outputting them using output variables. SP with RETURN statement (the return value is always single and integer value)
what are the characteristics of sp?
null
what are the advantages of sp?
Precompiled code hence faster. They allow modular programming, which means it allows you to break down a big chunk of code into smaller pieces of codes. This way the code will be more readable and more easier to manage. Reusability. Can enhance security of your application. Users can be granted permission to execute SP without having to have direct permissions on the objects referenced in the procedure. Can reduce network traffic. An operation of hundreds of lines of code can be performed through single statement that executes the code in procedure rather than by sending hundreds of lines of code over the network. SPs are pre -compiled, which means it has to have an Execution Plan so every time it gets executed after creating a new Execution Plan, it will save up to 70% of execution time. Without it, the SPs are just like any regular TSQL statements.
what is user defined functions udf?
null
what is the difference between stored procedure and udf?
null
what are the types of udf?
null
what is the difference between a nested udf and recursive udf?
Nested UDF: calling an UDF within an UDF Recursive UDF: calling an UDF within itself
what is a trigger?
null
what are the types of triggers?
null
what are inserted and deleted tables aka magic tables?
null
what are some string functions to remember len string returns the length of string
null
what are the three different types of error handling?
null
explain about cursors?
Cursors are a temporary database o bject which are used to loop through a table on row -by-row basis. There are five types of cursors: 1. Static: shows a static view of the data with only the changes done by session which opened the cursor. 2. Dynamic: shows data in its current state as the cursor moves from record -to-record. 3. Forward Only: move only record -by-record 4. Scrolling: moves anywhere. 5. Read Only: prevents data manipulation to cursor data set.
what is the difference between tables can and seek?
Scan: going through from the first page to the last page of an offset by offset or row by row. Seek: going to the specific node and fetching the information needed. Seek is the fastest way to find and fetch the data. So if you see your Execution Plan and if all of them is a seek, that means its optimized.
why are the dml operations are slower on indexes?
null
what is a heap table on a heap?
null
what is the architecture in terms of a hard disk extents and pages?
A hard disk is divided into Extents. Every extent has eight pages. Every page is 8KBs ( 8060 bytes).
what are the nine different types of indexes?
null
what is a clustering key?
null
explain about a clustered index?
null
what happens when clustered index is created?
null
what are the four different types of searching information in a table?
null
what is fragmentation?
null
what are the two types of fragmentation?
null
what are statistics?
Statistics allow the Query Optimizer to choose the optimal path in getting the data from the underlying table. Statistics are histograms of max 200 sampled values from col umns separated by intervals. Every statistic holds the following info: 1. The number of rows and pages occupied by a tables data 2. The time that statistics was last updated 3. The average length of keys in a column 4. Histogram showing the dis tribution of data in column
what are some optimization techniques in sql?
null
how do you present the following tree in a form of a table?
null
how do you reverse a string without using reverse string?
null
what is deadlock?
Deadlock is a situation where, say there are two transactions, the two transactions are waiting for each other to releas e their locks. The SQL automatically picks which transaction should be killed, which becomes a deadlock victim, and roll back the change for it and throws an error message for it.
what is a fact table?
The primary table in a dimensional model where the numerical performance measurements (or facts) of the business are stored so they can be summarized to provide information about the history of the operation of an organization. We use the term fact to r epresent a business measure. The level of granularity defines the grain of the fact table.
what is a dimension table?
Dimension tables are highly denormalized tables that contain the textual descriptions of the business and facts in their fact table. Since it is not uncommon for a dimension table to have 50 to 100 attributes and dimension tables tend to be relatively shallow in terms of the number of rows, they are also called a wide table. A dimension table has to have a surrogate key as its primary k ey and has to have a business/alternate key to link between the OLTP and OLAP.
what are the types of measures?
Additive: measures that can be added across all dimensions (cost, sales). Semi -Additive: measures that can be added across few dimensions and not with others. Non -Additive: measures that cannot be added across all dimensions (stock rates).
what is a star schema?
null
what is a snowflake schema?
null
what is granularity?
The lowest level of information that is stored in the fact table. Usually determined by the time dimension table. The best granularity level would be per transaction but it would require a lot of memory.
what is a surrogate key?
null
what are some advantages of using the surrogate key in a data warehouse?
null
what is the data type difference between a fact and dimension tables?
1. Fact Tables They hold numeric data. They contain measures. They are deep. 2. Dimensional Tables They hold textual data. They contain attributes of their fact tables. They a re wide.
what are the types of dimension tables?
null
what is your strategy for the incremental load?
null
what is cdc?
null
what is the difference between a connection and session?
null
what are all different types of collation sensitivity?
Following are different types of collation sensitivity - Case Sensitivity - A and a and B and b. Accent Sensitivity. Kana Sensitivity - Japanese Kana characters. Width Sensitivity - Single byte character and double byte character.
what is clause?
null
what is union minus and interact commands?
null
how to fetch common records from two tables?
null
how to fetch alternate records from a table?
null
how to select unique records from a table?
null
how to remove duplicate rows from table?
null
what is rowid and rownum in sql?
null
how to find count of duplicate rows?
Select rollno, count (rollno) from Student Group by rollno Having count (rollno)>1 Order by count (rollno) desc;
how to find third highest salary in employee table using self join?
Select * from Employee a Where 3 = (Select Count (distinct Salary) from Employee where a.salary<=b.salary;
how to display following using query?
null
how to display date in dd mon yyyy table?
null
the count of that comma separated values?
Student Name Marks Dinesh 30,130,20,4 Kumar 100,20,30 Follow Me : https://www.yo utube.com/c/SauravAgarwa l Sonali 140,10 Select Student_na me, regexp_count (marks,,) + As Marks Count from Student;
what is query to fetch last day of previous month in oracle?
Select LAST_DAY (ADD_MONTHS (SYSDATE, -1)) from dual;
how to display the string vertically in oracle?
null
how to display department wise and month wise maximum salary?
Select Department_no, TO_CHAR (Hire_date,Mon) as Month from Employee group by Department_no, TO_CHAR (Hire_date,mon);
how to calculate number of rows in table without using count function?
null
explain execution plan?
null
what is scala?
Scala is a general -purpose programming language providing support for both functional and Object - Oriented programming.
what is tail recursion in scala?
There are several situations where programmers have to write functions that are recursive in nature. The main problem with recursive functions is that, it may eat up all the allocated stack space. To overcome this situation, Scala compiler provides a mecha nism tail recursion to optimize these Follow Me : https://www.yo utube.com/c/SauravAgarwa l recursive functions so that it does not create new stack space, instead uses the current function stack space. To qualify for this, annotation @annotation.tailrec has to be used before defining the function and rec ursive call has to be the last statement, then only the function will compile otherwise, it will give an error.
what are traits in scala?
Traits are used to define object types specified by the signature of the supported methods. Scala allows to b e partially implemented but traits may not have constructor parameters. A trait consists of method and field definition, by mixing them into classes it can be reused.
who is the father of scala programming language?
Martin Oderskey, a German computer scientist, is the father of Scala programming language.
what are case classes in scala?
Case classes are standard classes declared with a special modifier case. Case classes export their constructor parameters and provide a recursive decomposition mec hanism through pattern matching. The constructor parameters of case classes are treated as public values and can be accessed directly. For a case class, companion objects and its associated method also get generated automatically. All the methods in t he class, as well, methods in the companion objects are generated based on the parameter list. The only advantage of Case class is that it automatically generates the methods from the parameter list.
what is the superclass of all classes in scala?
null
what is a scala set what are methods through which operation sets are expressed?
Scala set is a collection of pairwise elements of the same type. Scala set does not contain any duplicate elements. There are two kinds of sets, mutable and immutable.