0% found this document useful (0 votes)
5 views

'Data Visualization Questions'

SQL constraints are rules applied to data in a table, including NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, DEFAULT, and CREATE INDEX. The document also discusses the differences between WHERE and HAVING clauses, star and snowflake schemas, types of databases, and various SQL concepts like indexes, views, and joins. Additionally, it covers data warehouse characteristics, data marts, and the distinctions between primary keys, unique keys, and foreign keys.

Uploaded by

asmaaabdeen27
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

'Data Visualization Questions'

SQL constraints are rules applied to data in a table, including NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, DEFAULT, and CREATE INDEX. The document also discusses the differences between WHERE and HAVING clauses, star and snowflake schemas, types of databases, and various SQL concepts like indexes, views, and joins. Additionally, it covers data warehouse characteristics, data marts, and the distinctions between primary keys, unique keys, and foreign keys.

Uploaded by

asmaaabdeen27
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

What are constraints in sql ??

SQL constraints are used to specify rules for the data in a table

Types of constraints
NOT NULL - Ensures that a column cannot have a NULL value

UNIQUE - Ensures that all values in a column are different

PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely identifies each row in a table

FOREIGN KEY - Prevents actions that would destroy links between tables

CHECK - Ensures that the values in a column satisfies a specific condition

DEFAULT - Sets a default value for a column if no value is specified

CREATE INDEX - Used to create and retrieve data from the database very quickly

Difference between where vs having


he WHERE clause is used to filter records.

It is used to extract only those records that fulfill a specified condition.

he HAVING clause was added to SQL because the WHERE keyword cannot be used with
aggregate functions.

Schemes star & snow


Star Schema:
Star schema is the type of multidimensional model which is used for data warehouse. In star
schema, The fact tables and the dimension tables are contained. In this schema fewer
foreign-key join is used. This schema forms a star with fact table and dimension tables.

Snowflake Schema:
Snowflake Schema is also the type of multidimensional model which is used for data
warehouse. In snowflake schema, The fact tables, dimension tables as well as sub
dimension tables are contained. This schema forms a snowflake with fact tables, dimension
tables as well as sub-dimension tables.
Star Schema Snowflake Schema

In star schema, The fact tables and the While in snowflake schema, The fact tables, dimension
1. dimension tables are contained. tables as well as sub dimension tables are contained.

2. Star schema is a top-down model. While it is a bottom-up model.

3. Star schema uses more space. While it uses less space.

It takes less time for the execution of While it takes more time than star schema for the
4. queries. execution of queries.

In star schema, Normalization is not While in this, Both normalization and denormalization are
5. used. used.

6. It’s design is very simple. While it’s design is complex.

The query complexity of star schema is While the query complexity of snowflake schema is higher
7. low. than star schema.

8. It’s understanding is very simple. While it’s understanding is difficult.

9. It has less number of foreign keys. While it has more number of foreign keys.

10. It has high data redundancy. While it has low data redundancy

What is hypothesis

Types of database??
• Hierarchical databases
• Network databases
• Object-oriented databases
• Relational databases
• NoSQL databases

What is database index


Indexes are used to retrieve data from the database more quickly than otherwise. The users cannot see the indexes,
they are just used to speed up searches/queries
Note: Updating a table with indexes takes more time than updating a table without (because the indexes also need an
update). So, only create indexes on columns that will be frequently searched against.

What is ERD?
Entity Relationship Modeling: “To make the conceptual design”
Entity-Relationship Diagram (ERD): identifies information required by the business by displaying
the relevant entities and the relationships between them.
(Entity .. attributes … relationship )

What is denormalize?
Denormalization is used to combine multiple table data into one so that it can be queried quickly .
=>focus on to achieve the faster execution of the queries through introducing redundancy.
=> number of tables to store that data increases

Types of relations and mapping them


Relationship Mapping
▪ One to Many:
o Binary 🡪 PK of the one side as FK in the many side
o Unary 🡪 add the PK as a FK and change its name
▪ Many to Many:
o Binary 🡪 add PK of the entities as FK in new table “both will be the new PK =>
Composite PK” if there’s an attribute on the relationship will be added to this table
▪ One to One
o May Must 🡪 PK of the may side as FK in the must side
o May May 🡪 take one PK of any side as FK at the other side
o Must Must 🡪 Merge two tables as one table “choose any PK of the two tables”
▪ Ternary relationship 🡪 take all the tables PK as FK in a new table

What is database views


is a logical table based on a table or another view
Contains no data of its own “but it’s like a window through which data from tables can be
viewed or changed”
Base tables
View is stored as a select statement in the data dictionary

When to use mean vs. Median


Mean: (‫)مجموعهم علي عددهم‬

The median is the middle value of the ordered list of numbers.


What is sampling techniques

Types of sampling

What is an operational data store (ods)??


operational database contains current information that is required to run business

Non-volatile in characteristics of data warehouse??


Nonvolatile means that, once entered into the warehouse, data should not change

What is hypothesis testing and types

What is p value

How to find outliers in data


Detecting Outliers using Inter-quartile Range:
What is conditional probability

Why data warehouse


A data warehouse is a subject oriented, integrated, nonvolatile, and time variant collection of data in
support of management’s decisions.

Types of dimensions in data warehouse?


Slowly chaning ,, Fast chaning
sType0 ‫ميبصش ع االبديت‬,,sType 1 ‫بيبص ع االبدين‬,,sType 234 ‫جدول جديد تفصيلي وبفصل بيهم عن الوقت‬
Comferd ‫بكرر الديمنشن في ال فاكت بنفس المعني‬Roll playing ‫بكرر الديمنشن في ال فاكت وبغير المعني‬
Snow flack ‫تدرج للديمنشنز‬
Dwh major??

What is data mart


Data mart contains the subset of organization-wide data. This subset of data is valuable to : Data mart
contains the subset of organization-wide data. This subset of data is valuable to specific groups of an
organization. In other words, we can say that a data mart contains data specific groups of an organization.
In other words, we can say that a data mart contains data specific to a particular group. specific to a
particular group.
Difference between union & join
the UNION operator is used to combine the result-set of two ormore SELECT statements
Note: The column names in the result-set are usually equal to the column names in
the first SELECT statement

A JOIN clause is used to combine rows from two or more tables, based on a related
column between them.

• (INNER) JOIN: Returns records that have matching values in both tables
• LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records
from the right table
• RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records
from the left table
• FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table

Types of schema in data warehouse


Star & snow

Which is denormalized snowflake or star schema and


which is faster in retrieval??
snowflack >> star

Difference between big data and data warehouse


Big data =>Zettabyte / Hadoop

(images videos social media )

data warehouse => collection of data from several sources in one place / excel

Difference between primary key and unique key and


foreign key
The UNIQUE constraint ensures that all values in a column are different.

you can have many UNIQUE constraints per table, but only one PRIMARY KEY constraint per table.

The FOREIGN KEY constraint is used to prevent actions that would destroy links between tables.

A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in
another table.

The table with the foreign key is called the child table, and the table with the primary key is called the
referenced or parent table.
What is the difference between null & not null
SQL IFNULL(), ISNULL(), COALESCE(), and NVL() Functions

The NOT NULL constraint enforces a column to NOT accept NULL values.

What is check constraint in sql


The CHECK constraint is used to limit the value range that can be placed in a column.

If you define a CHECK constraint on a column it will allow only certain values for this column.

If you define a CHECK constraint on a table it can limit the values in certain columns based on
values in other columns in the row.

What is a default constraint in sql


The DEFAULT constraint is used to set a default value for a column.

The default value will be added to all new records, if no other value is specified.

What is self-join
A self join is a regular join, but the table is joined with itself.

4 types of data

What is sql

What is structured query language

What is nvl

What is isnull

How to extract duplicate data


Using the GROUP BY clause to group all rows by the target column(s) – i.e. the column(s) you
want to check for duplicate values on.
Using the COUNT function in the HAVING clause to check if any of the groups have more than 1
entry; those would be the duplicate values.
What is descriptive statistics

When use median not mean

When to use mean and when to use median

Definition of mean vs variance vs standard deviation and

when use them

How to handle outliers

What is cardinality in a database

What is alter in sql


The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.

The ALTER TABLE statement is also used to add and drop various constraints on an existing table.

What is a class

Difference between delete, drop and truncate


=>The DELETE statement is used to delete existing records in a table.

(Here we can use the “ROLLBACK” command to restore the tuple because it does not auto-commit)

=> DROP TABLE statement is used to drop an existing table in a database.ddl

=> truncate is used to delete all the rows of a relation (table) in one go

(Here we can't use the “ROLLBACK” command to restore the tuple because it does not auto-commit)

Which is faster delete or truncate


Truncate

he TRUNCATE command does not remove the structure of the table.

Talk about your favorite movie in english

➢ I like to watch science fiction movies, and my favorite film is

interstellar, this movie tells us, there is only one way to ensure

mankind's survival: interstellar travel.and finding a solution to this

problem, as no one has traveled there before.

Talk about your favorite book in english

Iti majors

Why do u need to join for iti

Why u choose your track

How do you connect it with your studies

Introduce yourself

You might also like