diff --git a/pages/blogs/intermediate-sql-for-data-scientists.jsx b/pages/blogs/intermediate-sql-for-data-scientists.jsx index 952079a..0cf4ddc 100644 --- a/pages/blogs/intermediate-sql-for-data-scientists.jsx +++ b/pages/blogs/intermediate-sql-for-data-scientists.jsx @@ -2,7 +2,7 @@ import React from "react"; import { Fade } from "react-awesome-reveal"; import { Box, Typography } from "@mui/material"; import SyntaxHighlighter from "react-syntax-highlighter"; -import { docco } from "react-syntax-highlighter/dist/esm/styles/hljs"; +import { docco as style } from "react-syntax-highlighter/dist/cjs/styles/hljs/darcula"; export default function BlogContent() { return ( @@ -38,7 +38,7 @@ export default function BlogContent() { component="pre" sx={{ overflow: "auto", bgcolor: "#f5f5f5", p: 2, borderRadius: 1 }} > - + {`SELECT AVG(salary) FROM employees WHERE department = 'Sales';`} @@ -62,12 +62,11 @@ WHERE department = 'Sales';`} component="pre" sx={{ overflow: "auto", bgcolor: "#f5f5f5", p: 2, borderRadius: 1 }} > - + {`SELECT department, COUNT(*) FROM employees GROUP BY department -HAVING - COUNT(*) {">"} 10;`} +HAVING COUNT(*) {">"} 10;`} @@ -85,11 +84,11 @@ HAVING component="pre" sx={{ overflow: "auto", bgcolor: "#f5f5f5", p: 2, borderRadius: 1 }} > - + {`SELECT employees.name, departments.name FROM employees -INNER JOIN - departments ON employees.department_id = departments.id`} +INNER JOIN departments +ON employees.department_id = departments.id`} @@ -111,7 +110,7 @@ INNER JOIN component="pre" sx={{ overflow: "auto", bgcolor: "#f5f5f5", p: 2, borderRadius: 1 }} > - + {`SELECT CONCAT(first_name, ' ', last_name) AS full_name FROM employees;`} @@ -133,13 +132,10 @@ FROM employees;`} component="pre" sx={{ overflow: "auto", bgcolor: "#f5f5f5", p: 2, borderRadius: 1 }} > - - {`SELECT - department, SUM(salary) -FROM - employees -GROUP BY department - WITH ROLLUP;`} + + {`SELECT department, SUM(salary) +FROM employees +GROUP BY department WITH ROLLUP;`} @@ -158,9 +154,8 @@ GROUP BY department component="pre" sx={{ overflow: "auto", bgcolor: "#f5f5f5", p: 2, borderRadius: 1 }} > - - {`SELECT - name, salary, + + {`SELECT name, salary, AVG(salary) OVER (PARTITION BY department) AS avg_department_salary FROM employees;`} @@ -183,7 +178,7 @@ FROM employees;`} component="pre" sx={{ overflow: "auto", bgcolor: "#f5f5f5", p: 2, borderRadius: 1 }} > - + {`WITH recursive_cte AS ( SELECT id, name