SQL Interview Question and Answers | Optimize/Fine Tuning Queries | SQL Best Practices | Code Decode |
|
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: https://openinapp.co/udemycourse Course Description Video : https://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 : https://youtube.com/playlist?list=PLyHJZXNdCXscoyL5XEZoHHZ86_6h3GWE1 Advance Java Interview Questions and Answers : https://youtube.com/playlist?list=PLyHJZXNdCXsexOO1VQ4vs-BM2-8CKrixd Java 8 Interview Questions and Answers : https://youtube.com/playlist?list=PLyHJZXNdCXsdeusn4OM33415DCMQ6sUKy Hibernate Interview Questions and Answers : https://youtube.com/playlist?list=PLyHJZXNdCXsdC-p2186C6NO4FpadnCC_q Spring Boot Interview Questions and Answers : https://youtube.com/playlist?list=PLyHJZXNdCXsexOO1VQ4vs-BM2-8CKrixd Angular Playlist : https://www.youtube.com/watch?v=CAl7RQSdq2Q&list=PLyHJZXNdCXsfxRtDwtGkDD_lLfTWc1g0i SQL Playlist : https://www.youtube.com/playlist?list=PLyHJZXNdCXse86eLuwy5uZohd_bddE9Ni GIT : https://youtube.com/playlist?list=PLyHJZXNdCXscpl6pxOnL2lRWJlzvzjyZE Subscriber and Follow Code Decode Subscriber Code Decode : https://www.youtube.com/c/CodeDecode?sub_confirmation=1 Linkedin : https://www.linkedin.com/in/codedecodeyoutube/ Instagram : https://www.instagram.com/codedecode25/ #sqlinterviewQuestions #sqlbestpractices #sqlfinetuning |