SQL | Which SQL Query has a better performance? | #sqlinterviewquestions #sql #sqlforbeginners

preview_player
Показать описание
In this SQL Quiz, there are two SQL Queries. Which one has a better performance?
#sqlinterviewquestions

Must Do Data Analytics Certifications -

Google Data Analytics Professional Certificate

Google Advanced Data Analytics Professional Certificate

Please do not forget to like, subscribe and share.

For enrolling and enquiries, please contact us at
Рекомендации по теме
Комментарии
Автор

The 2nd query will be a better performer in this case.

Query 1 uses a concatenation to combine the two columns, and then it compares the result to the string 'Evelyn Brooks'. This involves additional string manipulation, and it's not very efficient, especially if the table contains a large number of records.
The 2nd query however, directly compares the columns to the respective strings 'Evelyn' and 'Brooks'. This is a more efficient comparison because it doesn't involve any extra string operations.

talzl
Автор

2nd as 1st one uses 2 columns and creates a dummy column for all records then tries matching with the string, however in the 2nd method where condition, it checks for first name and last name simultaneously and filters the records..
Please correct me if I am wrong

kayk
welcome to shbcf.ru