In this video of code decode we have demonstrate how to optimize and fine tuned the SQL queries
asked in Sql interview question and answers
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/udemycourse
Course Description Video :
yt.openinapp.co/dmjvd
This video has Best Practices of SQL and Ways to fine tune your SQL Queries
SELECT fields instead of using SELECT *
Avoid SELECT DISTINCT
Create joins with INNER JOIN (not WHERE)
Use WHERE instead of HAVING to define filters
Avoid too much JOINs on your query: use only what is necessary!
Avoid cursors at all costs!
SELECT DISTINCT is a handy way to remove duplicates from a query. SELECT DISTINCT works by GROUPing all fields in the query to create distinct results. To accomplish this goal however, a large amount of processing power is required. Additionally, data may be grouped to the point of being inaccurate. To avoid using SELECT DISTINCT, select more fields to create unique results.
Some SQL developers prefer to make joins with WHERE clausesThis type of join creates a Cartesian Join, also called a Cartesian Product or CROSS JOIN.
In a Cartesian Join, all possible combinations of the variables are created
This is an inefficient use of database resources, as the database has done 100x more work than required. Cartesian Joins are especially problematic in large-scale databases, because a Cartesian Join of two large tables could create billions or trillions of results.
To prevent creating a Cartesian Join, use INNER JOIN instead:
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
SQL Playlist : • SQL Interview Question...
GIT : • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode : kzitem.info?...
Linkedin : / codedecodeyoutube
Instagram : / codedecode25
#sqlinterviewQuestions
#sqlbestpractices
#sqlfinetuning
Негізгі бет SQL Interview Question and Answers | Optimize/Fine Tuning Queries | SQL Best Practices | Code Decode
Пікірлер: 87