PowerBI SQL Modeling
PowerBI SQL Modeling
Power BI Desktop is an application that can be installed. This works nicely with Power BI by providing
data exploration and shaping and creating report with quality visualization. You can save your work to a
file and publish your reports in Power BI site.
Q2) What data sources can Power BI connect with for data exploration?
Content Packs
Connectors to databases and other datasets such as Azure & SQL etc.
They are collection of related documents and files that are stored as in a set.
       Visualizations
       Datasets
       Reports
       Dashboards
       Tiles
Visualization is a visual representation of dataset that extracts information from the data based on the
business.
Report is basically a collection of visualization charts that appear together on one or more pages within
power BI.
Q10) What are all the different types of filters available in Power BI Reports?
       Visual-level Filters
       Page-level Filters
       Report-level Filters
Visual level filters works on only an individual/single visualization, reducing the amount of data that the
visualization can see in power BI.
Page level filters work at the report-page level in power BI. Multiple pages in the same report can have
multiple page-level filters.
Report level filters work on the entire report within power BI project. Filtering all pages and
visualizations will include within the report.
Power BI is a cloud-based business service enables the client to interpret information with higher
efficiency and execution.
The Excel BI Toolkit comprises of Excel and four add-ins that enable us to do the transfer function, shape
transform, create, and to show our analyses.
Q17) What are all the types of Data Refresh Options available in Power BI?
       Package refresh
       Model or data refresh
       Tile refresh
       Visual container refresh
DAX(Data Analysis Expression) do basic calculation and data analysis on data in power pivot. DAX is a
formula language used to compute calculated column and calculated field within power BI.
       SUM
       MIN
       MAX
       AVG
       COUNTROWS
       DISTINCTCOUNT
       IF
       AND
       OR
       SWITCH
This is the only function that allows us to modify filter context of measures or tables.
       The DVI is “Drill Mode On”. In the event, we keep it off, we need to change those settings
        without fail. Rather set the Default to ‘Drill Mode On’.
       Drilling Mode will be on, if the aggregates are at initial level.
       Import
       DirectQuery
Power Pivot helps in analysing our data. It empowers users to import large scale of data from numerous
data sources into a single Excel sheet for better users interface.
Drag any one measure into the worksheet and drag one more dimension along it. Now you go to the
show me pane, and choose the bar chart tile. it can be both vertical and horizontal
By choice there are 4 different types of refreshes that can happen. They are,
       Package refresh
       Model or data refresh
       Tile refresh
       Visual container refresh
For basic calculation and data analysis on data in power pivot we can use DAX. It is a formula language
to compute calculated columns and calculated fields.
For the measure named Total Sales, calculate = SUM of values in the [SalesAmount ] column.
       Measures
       equal signs
       DAX syntax
       Parenthesis
       Reference Table and
       Column name
It does not support email addresses provided by regular email services or telecommunications
providers. So you should sign up using your professional address.
Working email addresses ending in .edu and .org are always supported.
The main engine, xVelocity in-memory analytics engine. This machine can handle large amount of data
as it stores data in columnar databases and in enhances memory analytics which results in faster
processing of data as it loads all data to RAM memory.
No, Power BI is not available as a private or an internal cloud service. However, with Power BI and
Power BI Desktop you can connect to your own on-premises data sources. With the On campus Data
Gateway, you can connect to your on campus SQL Server Analysis Services server as well.
Power BI has its own apps for Android phones, iOS devices, and Windows 10 devices. Download Power
BI apps from below:
BI professions and system integrators use this tool to build their own content packs to share purpose-
built dashboards, reports, and datasets within their organization.
       Power Query
       Power Pivot
       Power View
       Power Map
Q58) State the differences between Direct Query method and Import method.
       User can build larger data sets data visualizations through Direct query method, but Power BI
        desktop supports data visualizations on smaller data sets alone.
       There is no dataset limit for Direct query method and 1 GB dataset limit is not applicable in this
        method.
       User can visualize current data report alone while using direct query.
       User can perform data aggregation for unlimited number of rows but returning data is limited to
        1 million rows alone.
       All the tables have to come from a single data base only.
       While using complex queries, the query editor returns an error. This error has to be removed
        before running a new query.
       Relationship filtering can be allowed only in one direction while using Direct query method.
       There is no support for special treatments in direct query method for time related data present
        in the tables.
DAX is the Data Analysis Expression which is used to perform data analysis and primary calculations of
data in the Power pivot. DAX performs math computing through formulas. It works on column values
and calculated field but cannot work on rows. Also, DAX will not alter a data or insert a new data.
By joining two or more elements present in the existing data, users can build calculated columns in
Power BI. Users are allowed to define new metrics by stating math calculations in an existing column.
They are also allowed to join two columns to make it as one single column.
Q87) State the list of aggregate functions and counting functions in DAX?
Some of the aggregate functions present in DAX are: Average, Min, Max, Sum and SumX. Some of the
counting functions available are: Count, Distinct Count, Count Rows, Count Blank and CountA.
Power BI allows the users to build two basic calculations using DAX: Calculated measures and Calculated
Columns.
Q89) What are the logical and date functions available in DAX?
Q90) What are the information and text functions available in DAX?
Q93) Tell me about REST API and its association with Power BI.
REST APIs are used to operate the data present in Power BI in real time environments. With the
combination of REST API with Power BI, user can build dashboards, datasets, add/delete rows and can
receive groups. This Power BI REST API can be built through many technologies. Some of them are :
       Ruby
       .Net
       JQuery
Users require Azure active directory token to get access applications in Power BI dashboards.
Q110. What do you mean by DAX and explain its basic concepts?
DAX is derived as Data Analysis Expression, which is a group of constants, operators, and functions used
in formulas to return and calculate values. In short, they are used to develop new information from the
existing data. There are three basic concepts included in DAX namely
       Functions: This type of concept use particular values, otherwise called as arguments in the right
        order to execute a calculations, just identical to Excel functions. The categories included in the
        functions are time intelligence, logical, statistical, parent/child, date/time, information,
        mathematical, text, and more.
       Syntax: This indicates the writing format of a formula. It indicates the elements used to
        comprise it. The function in Syntax is SUM. You will get an error message in case your syntax is
        wrong.
       Context: Filter context and row context are two types of context. Row context is used when a
        formula include a function that is used to apply the filter to pick the single row in a single table.
        The filter context is used when there is a number of filters applied in a calculation that indicates
        a value or result.
All the imported Power BI data from various sources of data are stored in either Dimension tables and
Fact tables.
       Dimension table: It’s a database table that holds every attribute values for the stored data in the
        fact table. It held in a star schema that is attached to the fact table.
       Face table: It is the primary or central table of any start schema. It holds the quantitative or
        measured values. It contains the primary keys and these are not normalized usually.
Q118. What are the data types supported by DAX?
       Boolean
       String
       Numeric
       Decimal
       Datetime
Power BI Desktop enables the users to group the data into smaller chunks. You need to use Control +
click to select different elements in the visual for the grouping purpose. You can right-click on any of the
elements, that appear in the groups’ window.
M-Code is the language used in Power Query. It’s a new programming language developed to be user-
friendly, case sensitive and it’s identical to other languages.
       Adding Indexes
       Removing rows and columns
       Applying for a Sort order
Q124. Are there any prerequisites to connect to a database in Azure SQL Database?
Yes, you need to configure the firewall settings to enable remote connections before connecting it to the
database in Azure SQL Database.
You can easily adjust the responsive slicers according to the required sizes and shapes and the data
contained in a report should be realigned according to it.
145. List the most commonly used DAX functions?
Below mentioned are some of the most commonly used DAX functions:
The common Power Query Transformations include Filtering Rows, Changing Data Types, Grouping,
Removing Columns, Adding New Columns, Splitting columns, etc.
Yes, we can use them together. A SQL statement can be used as a source of Power Query for making
additional logical processing. This will help in ensuring that an efficient query is passed to the source
and avoids unnecessary complexities.
Power Query: The ETL (Extract, Transform & Load) Part of the BI is taken care of in Power Query. It is a
Data Transformation Engine. It allows us to Connect a range of information sources ranging from Excel
to Streaming data.
Power Pivot: The Data Modelling Part of the BI Process is performed with the assist of Power Pivot. The
Relationships between the tables are hooked up right here and Calculations are written via Power Pivot
Part of Power BI. It makes use of DAX (Data Analysis Expressions) language to mannequin the data.
Power View: It lets to create Powerful visuals, charts & Graphs from the tables. It can join to the records
sources accessible in the Models and lets you to filter information for every visual or a web page or a
complete report.
Power Map: The Geographical information can be visualized by the usage of Power Map and it used
Microsoft Bing to get the Best visuals primarily based on Latitude and Longitude, Country, State, County,
City, etc.
Power BI Desktop: It is a single device Integrated with Power Query, Power View , Power Pivot and
Power Maps.
Q161. What is the distinction between Measure and Dimension?
Measures: The Measure are used to calculate aggregations such as Sum, Min, Max, Average & Count at
the desk level. It is calculated at the time of the question which says that the Measures are no longer
saved somewhere in the database or in the model. They truely exist.
Calculated Column: The Primary distinction between the measure and the calculated column in the
Evaluation context. The Evaluation of a calculated columns is completed at the row degree the place as
the comparison context of a measure is at the desk level.
Summary:
Bookmarks are sort of Shortcut used in Power BI to navigate to a sure web page that is configured at a
factor of time. We can toggle between a foremost file web page and a bookmark for handy comparison.
Bookmarks are static and all the filter or interactions which are configured won’t exchange till we edit
the bookmarks.
       Admin
       Contributor
       Member
       Viewer
Cardinality capacity the relationship which is set up between two tables in the Modelling view of Power
BI. We can discover if the tables have awesome of multi cases per price for the becoming a member of
columns between the two tables.
       One to One
       One to Many
Q174. What is the issue in phrases of Size of Data in Power BI Premium and Power BI Pro?
In Power BI Pro we can cope with up to 1Gb of statistics & in Power BI Premium we can Handle 10 Gb of
Data per User.
70. State the difference between Count and CounD function.
Count function returns to count, excluding NULL values whereas Countd returns distinct values which
exclude NULL values.
This function gives a difference between 2 dates based on the specified Date part.
If the value is not NULL iFNULL function result is the first expression, if it is not, then it will return the
second expression.
INDEX function helps you to retrieve the index of the respective row.
LTRIM function helps you to remove the white space from the LEFT of the string. RTRIM helps you to
remove it from the right the last index.
MID function returns the string character from the specified index position.
PERCENTILE function allows you to returns the data value of the specific percentile number.
Sign function returns the direction of the values. If it returns 1, if positive then 1, if 0 then 0.
SPLIT function is used to split the string database on the given delimiter.
In, the year 2016 Microsoft discharged new administration which is named as Power BI Embedded.
87. What area do you go to change and reshape data in Power BI?
Data Editing helps you to change and reshape data in Power BI.
88. Data Category settings should be used for mapping information to geographic areas in Power BI?
91. What is the process to refresh Power BI reports when it is uploaded into the cloud?
Power BI, reports can be refresh using Data management, gateway, and Power BI Personal Gateway.
92. What visual would you need to use to show solitary esteem?
98. In, Power Bi, where do you discover the Q&A highlight?
You will get at the highest point of a report in the Power BI benefit.
99. How can you dynamically change the value measure to show multiple measures?
Answer : When the expressions to SUM() consits of anything else than a column name.
Typically when you want to add or multiply the values in different columns:
SUMX() first creates a row context over the Sales table (see 1 above). It then iterates through this table
one row at a time. SUM() is optimized for reducing over column segments and is as such not an iterator.
Answer : CALENDARAUTO function returns a table with a single column named “Date” that contains a
contiguous set of dates. The range of dates is calculated automatically based on data in the model.
Example: In this example, the MinDate and MaxDate in the data model are July 1, 2010 and June 30,
2011.
CALENDARAUTO() will return all dates between January 1, 2010 and December 31, 2011.
CALENDARAUTO(3) will actually return all dates between April 1, 2010 and March 31, 2012.
Answer : DAX has a number of aggregation functions, including the following commonly used
functions:
       SUM
       AVERAGE
       MIN
       MAX
       SUMX (and other X functions)
These functions work only on numeric columns, and generally can aggregate only one column at a time.
However, special aggregation functions that end in X, such as SUMX, can work on multiple columns.
These functions iterate through the table, and evaluate the expression for each row.
       CONCATENTATE
       REPLACE
       SEARCH
       UPPER
       FIXED
These text work very similarly to the Excel functions that have the same name, so if you're familiar with
how Excel handles text functions, you're already a step ahead. If not, you can always experiment with
these functions in Power BI, and learn more about how they behave.
Answer : Both count the distinct values, but VALUES() also counts a possible implictit virtual empty row
because of non matching values in a child table. This is usually in a dimension table.
Answer : DISTINCTCOUNT()
Question 10. What Is A Pattern?
Answer : A pattern is a general reusable solution to a commonly occurring problem.In Microsoft Excel,
you use patterns every day to build tables, charts, reports, dashboards, and more.
Answer : When in row context it transitions to filter context: the filter on the rows of a specific table
propagates through the relationship to the related before the calculation is completed.
It extends or modifies an existing filter context, by adding a filter as its second parameter.
Question 15. What Is The Difference Between Max And Maxa Functions In Dax?
Answer : The MAX function takes as an argument a column that contains numeric values. If the column
contains no numbers, MAX returns a blank. If you want to evaluate values that are not numbers, use the
MAXA function.
Answer :
Answer :
Question 18. How Can You Propagate Row Context Through Relationships?
Answer :
Propagation happens manually by using RELATED() and RELATEDTABLE(). These functions need to be
used on the correct side of a one-to-many relationship: RELATED() on the many side, RELATEDTABLE()
on the one side.
Question 19. How Does Summarizecolumns Relate To Filtering?
Answer :
Answer :
The initial filter context comes from four areas of a pivot table:
    1.   Rows
    2.   Columns
    3.   Filters
    4.   Slicers
It is the standard filtering coming from a pivot table before any possible modifications from DAX
formulas using CALCULATE().
Question 21. Why Don't You Use A Calculate() In The Aggregation Expression Of A
Summarizecolumn()?
SQL Interview:
A JOIN clause is used to combine rows from two or more tables, based on a related column between
them. It is used to merge two tables or retrieve data from there. There are 4 types of joins, as you can
refer to below:
       Inner join: Inner Join in SQL is the most common type of join. It is used to return all the rows
        from multiple tables where the join condition is satisfied.
       Left Join: Left Join in SQL is used to return all the rows from the left table but only the matching
        rows from the right table where the join condition is fulfilled.
       Right Join: Right Join in SQL is used to return all the rows from the right table but only the
        matching rows from the left table where the join condition is fulfilled.
       Full Join: Full join returns all the records when there is a match in any of the tables. Therefore, it
        returns all the rows from the left-hand side table and all the rows from the right-hand side table.
Q6. What is the difference between CHAR and VARCHAR2 datatype in SQL?
Both Char and Varchar2 are used for characters datatype but varchar2 is used for character strings of
variable length whereas Char is used for strings of fixed length. For example, char(10) can only store 10
characters and will not be able to store a string of any other length whereas varchar2(10) can store any
length i.e 6,8,2 in this variable.
Constraints in SQL are used to specify the limit on the data type of the table. It can be specified while
creating or altering the table statement. The sample of constraints are:
        NOT NULL
        CHECK
        DEFAULT
        UNIQUE
        PRIMARY KEY
        FOREIGN KEY
DELETE vs TRUNCATE
DELETE TRUNCATE
You can rollback data after using delete statement. You cannot rollback data.
Apart from this SQL Interview Questions blog, if you want to get trained from professionals on this
technology, you can opt for structured training from edureka!
        Foreign key maintains referential integrity by enforcing a link between the data in two tables.
       The foreign key in the child table references the primary key in the parent table.
       The foreign key constraint prevents actions that would destroy links between the child and
        parent tables.
Data Integrity defines the accuracy as well as the consistency of the data stored in a database. It also
defines integrity constraints to enforce business rules on the data when it is entered into an application
or a database.
Q13. What is the difference between clustered and non-clustered index in SQL?
The differences between the clustered and non clustered index in SQL are :
    1. Clustered index is used for easy retrieval of data from the database and its faster whereas
       reading from non clustered index is relatively slower.
    2. Clustered index alters the way records are stored in a database as it sorts out rows by the
       column which is set to be clustered index whereas in a non clustered index, it does not alter the
       way it was stored but it creates a separate object within a table which points back to the original
       table rows after searching.
3. One table can only have one clustered index whereas it can have many non clustered index.
In SQL, there is a built-in function called GetDate() which helps to return the current timestamp/date.
The phase that identifies a plan for evaluation query which has the least estimated cost is known as
query optimization. The advantages of query optimization are as follows:
Denormalization refers to a technique which is used to access data from higher to lower forms of a
database. It helps the database managers to increase the performance of the entire infrastructure as it
introduces redundancy into a table. It adds the redundant data into a table by incorporating database
queries that combine data from various tables into a single table.
Entities: A person, place, or thing in the real world about which data can be stored in a database. Tables
store data that represents one type of entity. For example – A bank database has a customer table to
store customer information. The customer table stores this information as a set of attributes (columns
within the table) for each customer.
Relationships: Relation or links between entities that have something to do with each other. For
example – The customer name is related to the customer account number and contact information,
which might be in the same table. There can also be relationships between separate tables (for example,
customer to accounts).
An index refers to a performance tuning method of allowing faster retrieval of records from the table.
An index creates an entry for each value and hence it will be faster to retrieve data.
Unique Index:
This index does not allow the field to have duplicate values if the column is unique indexed. If a primary
key is defined, a unique index can be applied automatically.
Clustered Index:
This index reorders the physical order of the table and searches based on the basis of key values. Each
table can only have one clustered index.
Non-Clustered Index:
Non-Clustered Index does not alter the physical order of the table and maintains a logical order of the
data. Each table can have many non-clustered indexes.
Normalization in SQL is the process of organizing data to avoid duplication and redundancy. Some of the
advantages are:
DROP command removes a table and it cannot be rolled back from the database whereas TRUNCATE
command removes all the rows from the table.
There are many successive levels of normalization. These are called normal forms. Each consecutive
normal form depends on the previous one.The first three normal forms are usually adequate.
ACID stands for Atomicity, Consistency, Isolation, Durability. It is used to ensure that the data
transactions are processed reliably in a database system.
       Atomicity: Atomicity refers to the transactions that are completely done or failed where
        transaction refers to a single logical operation of a data. It means if one part of any transaction
        fails, the entire transaction fails and the database state is left unchanged.
       Consistency: Consistency ensures that the data must meet all the validation rules. In simple
        words, you can say that your transaction never leaves the database without completing its
        state.
       Isolation: The main goal of isolation is concurrency control.
       Durability: Durability means that if a transaction has been committed, it will occur whatever
        may come in between such as power loss, crash or any sort of error.
Trigger in SQL is are a special type of stored procedures that are defined to execute automatically in
place or after data modifications. It allows you to execute a batch of code when an insert, update or any
other query is executed against a specific table.
    1. Arithmetic Operators
    2. Logical Operators
    3. Comparison Operators
Apart from this SQL Interview Questions blog, if you want to get trained from professionals on this
technology, you can opt for structured training from edureka!
A NULL value is not at all same as that of zero or a blank space. NULL value represents a value which is
unavailable, unknown, assigned or not applicable whereas a zero is a number and blank space is a
character.
Q27. What is the difference between cross join and natural join?
The cross join produces the cross product or Cartesian product of two tables whereas the natural join is
based on all the columns having the same name and data types in both the tables.
A subquery is a query inside another query where a query is defined to retrieve data or information back
from the database. In a subquery, the outer query is called as the main query whereas the inner query is
called subquery. Subqueries are always executed first and the result of the subquery is passed on to the
main query. It can be nested inside a SELECT, UPDATE or any other query. A subquery can also use any
comparison operators such as >,< or =.
Correlated subquery: These are queries which select the data from a table referenced in the outer
query. It is not considered as an independent query as it refers to another table and refers the column in
a table.
Non-Correlated subquery: This query is an independent query where the output of subquery is
substituted in the main query.
To count the number of records in a table in SQL, you can use the below commands:
Q31. Write a SQL query to find the names of employees that begin with ‘A’?
To display name of the employees that begin with ‘A’, type in the below command:
1SELECT * FROM Table_name WHERE EmpName like 'A%'
Q32. Write a SQL query to get the third-highest salary of an employee from employee_table?
1SELECT TOP 1 salary
2FROM(
4FROM employee_table
Group functions work on the set of rows and return one result per group. Some of the commonly used
group functions are: AVG, COUNT, MAX, MIN, SUM, VARIANCE.
Relation or links are between entities that have something to do with each other. Relationships are
defined as the connection between the tables in a database. There are various relationships, namely:
Q35. How can you insert NULL values in a column while inserting the data?
Q36. What is the main difference between ‘BETWEEN’ and ‘IN’ condition operators?
BETWEEN operator is used to display rows based on a range of values in a row whereas the IN condition
operator is used to check for values contained in a specific set of values.
Example of BETWEEN:
SELECT * FROM Students where ROLL_NO BETWEEN 10 AND 50;
Example of IN:
This statement allows conditional update or insertion of data into a table. It performs an UPDATE if a
row exists, or an INSERT if the row does not exist.
Recursive stored procedure refers to a stored procedure which calls by itself until it reaches some
boundary condition. This recursive function or procedure helps the programmers to use the same set of
code n number of times.
SQL clause helps to limit the result set by providing a condition to the query. A clause helps to filter the
rows from the entire set of records.
Apart from this SQL Interview Questions Blog, if you want to get trained from professionals on this
technology, you can opt for a structured training from edureka! Click below to know more.
Q41. What is the difference between ‘HAVING’ CLAUSE and a ‘WHERE’ CLAUSE?
HAVING clause can be used only with SELECT statement. It is usually used in a GROUP BY clause and
whenever GROUP BY is not used, HAVING behaves like a WHERE clause.
Having Clause is only used with the GROUP BY function in a query whereas WHERE Clause is applied to
each row before they are a part of the GROUP BY function in a query.
Constraints are the representation of a column to enforce data entity and consistency. There are two
levels of a constraint, namely:
Q44. How can you fetch common records from two tables?
You can fetch common records from two tables using INTERSECT. For example:
       LOWER: This function returns the string in lowercase. It takes a string as an argument and
        returns it by converting it into lower case. Syntax:
LOWER(‘string’)
       UPPER: This function returns the string in uppercase. It takes a string as an argument and
        returns it by converting it into uppercase. Syntax:
UPPER(‘string’)
       INITCAP: This function returns the string with the first letter in uppercase and rest of the letters
        in lowercase. Syntax:
INITCAP(‘string’)
Some of the available set operators are – Union, Intersect or Minus operators.
ALIAS command in SQL is the name that can be given to any table or a column. This alias name can be
referred in WHERE clause to identify a particular table or a column.
For example-
In the above example, emp refers to alias name for employee table and dept refers to alias name for
department table.
Q48. What are aggregate and scalar functions?
Aggregate functions are used to evaluate mathematical calculation and returns a single value. These
calculations are done from the columns in a table. For example- max(),count() are calculated with
respect to numeric.
Scalar functions return a single value based on the input value. For example – UCASE(), NOW() are
calculated with respect to string.
You can fetch alternate records i.e both odd and even row numbers. For example- To display even
numbers, use the following command:
Select studentId from (Select rowno, studentId from student) where mod(rowno,2)=0
Select studentId from (Select rowno, studentId from student) where mod(rowno,2)=1
Q50. Name the operator which is used in the query for pattern matching?
You can select unique records from a table by using the DISTINCT keyword.
Using this command, it will print unique student id from the table Student.
There are a lot of ways to fetch characters from a string. For example:
SQL is a query language that allows you to issue a single query or execute a single insert/update/delete
whereas PL/SQL is Oracle’s “Procedural Language” SQL, which allows you to write a full program (loops,
variables, etc.) to accomplish multiple operations such as selects/inserts/updates/deletes.
A view is a virtual table which consists of a subset of data contained in a table. Since views are not
present, it takes less space to store. View can have data of one or more tables combined and it depends
on the relationship.
A view refers to a logical snapshot based on a table or another view. It is used for the following reasons:
A Stored Procedure is a function which consists of many SQL statements to access the database system.
Several SQL statements are consolidated into a stored procedure and execute them whenever and
wherever required which saves time and avoid writing code again and again.
A Stored Procedure can be used as a modular programming which means create once, store and call for
several times whenever it is required. This supports faster execution. It also reduces network traffic and
provides better security to the data.
Disadvantage:
The only disadvantage of Stored Procedure is that it can be executed only in the database and utilizes
more memory in the database server.
       Scalar Functions
       Inline Table-valued functions
       Multi-statement valued functions
Scalar returns the unit, variant defined the return clause. Other two types of defined functions return
table.
Collation is defined as a set of rules that determine how data can be sorted as well as compared.
Character data is sorted using the rules that define the correct character sequence along with options
for specifying case-sensitivity, character width etc.
These variables can be used or exist only inside the function. These variables are not used or referred by
any other function.
Global variables:
These variables are the variables which can be accessed throughout the program. Global variables
cannot be created whenever that function is called.
Autoincrement keyword allows the user to create a unique number to get generated whenever a new
record_is_inserted_into_the_table.
This keyword is usually required whenever PRIMARY KEY in SQL is used.
AUTO INCREMENT keyword can be used in Oracle and IDENTITY keyword can be used in SQL SERVER.
Datawarehouse refers to a central repository of data where the data is assembled from multiple sources
of information. Those data are consolidated, transformed and made available for the mining as well as
online processing. Warehouse data also have a subset of data called Data Marts.
Q64. What are the different authentication modes in SQL Server? How can it be changed?
Windows mode and Mixed Mode – SQL and Windows. You can go to the below steps to change
authentication mode in SQL Server:
       Click Start> Programs> Microsoft SQL Server and click SQL Enterprise Manager to run SQL
        Enterprise Manager from the Microsoft SQL Server program group.
       Then select the server from the Tools menu.
       Select SQL Server Configuration Properties, and choose the Security page.
replacement_string: They are the new characters which are injected in the string.
REPLACE function: This function is used to replace the existing characters of all the occurrences. Syntax:
DATA Modeling
       Physical data model - This is where the framework or schema describes how data is physically
        stored in the database.
       Conceptual data model - This model focuses on the high-level, user’s view of the data in
        question
       Logical data models - They straddle between physical and theoretical data models, allowing the
        logical representation of data to exist apart from the physical storage.
2. What is a Table?
A table consists of data stored in rows and columns. Columns, also known as fields, show data in vertical
alignment. Rows also called a record or tuple, represent data’s horizontal alignment.
3. What is Normalization?
Database normalization is the process of designing the database in such a way that it reduces data
redundancy without sacrificing integrity.
4. What Does a Data Modeler Use Normalization For?
Denormalization is a technique where redundant data is added to an already normalized database. The
procedure enhances read performance by sacrificing write performance.
ERD stands for Entity Relationship Diagram and is a logical entity representation, defining the
relationships between the entities. Entities reside in boxes, and arrows symbolize relationships.
A surrogate key, also known as a primary key, enforces numerical attributes. This surrogate key replaces
natural keys. Instead of having primary or composite primary keys, data modelers create the surrogate
key, which is a valuable tool for identifying records, building SQL queries, and enhancing performance.
8. What Are the Critical Relationship Types Found in a Data Model? Describe Them.
       Identifying. A relationship line normally connects parent and child tables. But if a child table’s
        reference column is part of the table’s primary key, the tables are connected by a thick line,
        signifying an identifying relationship.
       Non-identifying. If a child table’s reference column is NOT a part of the table’s primary key, the
        tables are connected by a dotted line, signifying a no-identifying relationship.
       Self-recursive. A recursive relationship is a standalone column in a table connected to the
        primary key in the same table.
This is a data model that consists of all the entries required by an enterprise.
These are the errors most likely encountered during data modeling.
       Building overly broad data models: If tables are run higher than 200, the data model becomes
        increasingly complex, increasing the likelihood of failure
       Unnecessary surrogate keys: Surrogate keys must only be used when the natural key cannot
        fulfill the role of a primary key
       The purpose is missing: Situations may arise where the user has no clue about the business’s
        mission or goal. It’s difficult, if not impossible, to create a specific business model if the data
        modeler doesn’t have a workable understanding of the company’s business model
       Inappropriate denormalization: Users shouldn’t use this tactic unless there is an excellent reason
        to do so. Denormalization improves read performance, but it creates redundant data, which is a
        challenge to maintain.
The two design schema is called Star schema and Snowflake schema. The Star schema has a fact table
centered with multiple dimension tables surrounding it. A Snowflake schema is similar, except that the
level of normalization is higher, which results in the schema looking like a snowflake.
These are dimensions used to manage both historical data and current data in data-warehousing. There
are four different types of slowly changing dimensions: SCD Type 0 through SCD Type 3.
A data mart is the most straightforward set of data warehousing and is used to focus on one functional
area of any given business. Data marts are a subset of data warehouses oriented to a specific line of
business or functional area of an organization (e.g., marketing, finance, sales). Data enters data marts by
an assortment of transactional systems, other data warehouses, or even external sources.
Granularity represents the level of information stored in a table. Granularity is defined as high or low.
High granularity data contains transaction-level data. Low granularity has low-level information only,
such as that found in fact tables.
Data sparsity defines how much data we have for a model’s specified dimension or entity. If there is
insufficient information stored in the dimensions, then more space is needed to store these
aggregations, resulting in an oversized, cumbersome database.
Entities can be broken down into several sub-entities or grouped by specific features. Each sub-entity
has relevant attributes and is called a subtype entity. Attributes common to every entity are placed in a
higher or super level entity, which is why they are called supertype entities.
17. In the Context of Data Modeling, What is the Importance of Metadata?
Metadata is defined as “data about data.” In the context of data modeling, it’s the data that covers what
types of data are in the system, what it’s used for, and who uses it.
No, it’s not an absolute requirement. However, denormalized databases are easily accessible, easier to
maintain, and less redundant.
19. What’s the Difference Between forwarding and Reverse Engineering, in the Context of Data Models?
Forward engineering is a process where Data Definition Language (DDL) scripts are generated from the
data model itself. DDL scripts can be used to create databases. Reverse Engineering creates data models
from a database or scripts. Some data modeling tools have options that connect with the database,
allowing the user to engineer a database into a data model.
20. What Are Recursive Relationships, and How Do You Rectify Them?
Recursive relationships happen when a relationship exists between an entity and itself. For instance, a
doctor could be in a health center’s database as a care provider, but if the doctor is sick and goes in as a
patient, this results in a recursive relationship. You would need to add a foreign key to the health
center’s number in each patient’s record.
22. Why Are NoSQL Databases More Useful than Relational Databases?
This is a grouping of low-cardinality attributes like indicators and flags, removed from other tables, and
subsequently “junked” into an abstract dimension table. They are often used to initiate Rapidly
Changing Dimensions within data warehouses.
24. If a Unique Constraint Gets Applied to a Column, Will It Generate an Error If You Attempt to Place
Two Nulls in It?
No, it won’t, because null error values are never equal. You can put in numerous null values in a column
and not generate an error.