0
0
SQLquery~30 mins

MySQL vs PostgreSQL vs SQL Server overview - Hands-On Comparison

Choose your learning style9 modes available
Comparing MySQL, PostgreSQL, and SQL Server
📖 Scenario: You are working as a junior database assistant in a company that wants to choose the best database system for their new project. They want to understand the basic differences between MySQL, PostgreSQL, and SQL Server.
🎯 Goal: Build a simple database table and write queries to explore basic features of MySQL, PostgreSQL, and SQL Server. This will help you see how each system handles data and queries.
📋 What You'll Learn
Create a table named employees with columns id, name, and department.
Insert three specific employee records into the employees table.
Write a query to select all employees from the employees table.
Write a query to count how many employees are in each department.
💡 Why This Matters
🌍 Real World
Companies use different database systems to store and manage employee data. Knowing how to create tables and query data is essential.
💼 Career
Database administrators and developers must understand how to work with tables and queries in various SQL systems to support business needs.
Progress0 / 4 steps
1
Create the employees table
Write a SQL statement to create a table called employees with three columns: id as an integer primary key, name as a text or varchar, and department as a text or varchar.
SQL
Need a hint?

Use CREATE TABLE employees and define id as INT PRIMARY KEY. Use VARCHAR(100) for name and department.

2
Insert employee records
Write three SQL INSERT INTO employees statements to add these employees exactly: (1, 'Alice', 'HR'), (2, 'Bob', 'IT'), and (3, 'Charlie', 'Finance').
SQL
Need a hint?

Use three separate INSERT INTO employees (id, name, department) VALUES (...) statements with the exact values given.

3
Select all employees
Write a SQL query to select all columns and rows from the employees table using SELECT * FROM employees.
SQL
Need a hint?

Use SELECT * FROM employees; to get all employee data.

4
Count employees per department
Write a SQL query to count the number of employees in each department using SELECT department, COUNT(*) FROM employees GROUP BY department.
SQL
Need a hint?

Use GROUP BY department with COUNT(*) to count employees per department.