Self SQL
Self SQL
DATABASE INTRO-
1. Warehouse- where all the things are stored
2. Data warehouse- storage of all the data points or data.
2. Goods are stored such that their 2. Data is stored such that its retrieval
4.
a. Data is captured from multiple sources and stored in Excel files or in
databases, such as Oracle.
b. The Extract, Transform, Load (ETL) process is performed on the captured
data in the following manner:
i. Extract: Extracting the information from the data sources
ii. Transform: Transforming the values to the required format, such as
converting rupees to dollars
iii. Load: Loading the data into a central repository, which is none other
than a data warehouse
c. The stored data is either connected to Online Analytical Processing (OLAP)
for further processing or used for creating reports in tools, such as Tableau or
PowerBI.
5. A dimension model is a database structure technique and is used to optimize the
database for the fast retrieval of data. The dimensional model contains two entities:
Facts and Dimensions.
a. Facts are the numerical data that captures factual info. In a data warehouse and
dimensions are the metadata (that is, data explaining some other data) attached
to the fact variables used for analyzing facts. Both facts and dimensions are
equally important for generating actionable insights from a data set.
6. The precursor to designing a database is drawing a well-defined Entity-Relationship
Diagram, or ERD. It can be thought of as a map of the database schema. It gives us
an idea of how different entities are connected. It gives us an idea of how different
entities are connected.
Fields marked with a star are the primary keys for each table.
A line connecting two tables indicates that a relationship exists between them.
A line connecting a table to itself indicates that the table references itself.
7. A schema is an outline of the entire data model which shows how different data sets
are connected and how the different attributes of each data set are used for the
database design.
a. A star schema is a type of schema design that has one fact table connected
to multiple dimension tables.
b. A snowflake schema is called so because the dimension tables surrounding
the fact table can branch off into more dimension tables.
c. Snowflake schema are particularly useful when it becomes difficult to
manage the size of the dimensional tables. For example, a ‘Customer’
dimension may have an attribute called ‘CityID’. The ‘Customer’ table would
be drawn out and difficult to read if it had all the details of the city to which a
customer belongs. Hence, it is a good idea to store the details of the city, such
as the city name and the PIN code, in another dimension table.
8. Constraints- helps us in setting rules on what kind of data can be loaded in data
warehouse. 3 types-
a. Entity constraints-
i. Unique constraints: in this, unique values are req.
ii. Null constraints: used to determine the columns that have null values
Unique and null constraints can co-exist in a relational data model.
b. Referential constraints- used to restrict the values taken by a col. In one table
based on the values that exist in another table.
i. Rule under this- foreign and primary key: the value that appears as a
foreign key in a table is valid only if it also appears as a primary key in
the table to which it refers to. A table has only one primary key but can
have multiple foreign keys.
c. Semantic constraints- impose restrictions on the values in the col. Eg- ph no
have 10 digits and less than 10 digit value won’t be accepted in a data. Also, it
will capture ph no. and not other values like name.
9. Transactional database- are the one which is used for online application serving the
need of the end customers.
10. Data warehouse- is for the analysts used for data analysis
11. RDBMS- in this there has to be an ecosystem where several data tables are
interlinked. While in DBMS, there is no need that data tables has to be interlinked.
WHAT IS SQL
When we have to interact with any RDBMS we use SQL language. Eg- when we want to
communicate with someone we use English as a language. It is technology agnostic. If
today we are working with one database and then the database changes we don’t have to
change our language, we can still use sql to interact with RDBMS.
Q. WHY I SHOULD USE SQL?
To search query or data
Adding new data
Updating data
Sharing data
It is also supported by all the modern database systems such as Oracle,
MySQL, SQL Server and so on.
Types of RDBMS- MySQL, oracle, SQL server, SAP HANA, IBM Informix, Amazon
RDS.
Q. WHY SQL AND NOT OTHER LANGUAGE?
It is an open source.
Its fully functional
Wide community user
Q. INDUSTRIAL APPLICATION OF SQL?
1. banking sector
2. ecommerce- to make the connection between different products.
3. social networking co- eg facebook- relational mapping is used show the suggestion of
friends to us.