Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- student@student:~$ sudo mysql
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 10
- Server version: 8.0.42-0ubuntu0.22.04.1 (Ubuntu)
- Copyright (c) 2000, 2025, Oracle and/or its affiliates.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> USE TCB53;
- Database changed
- mysql> CREATE TABLE EmployeeInfo
- -> (id int(5), name varchar(50), post varchar(50), salary int(5));
- Query OK, 0 rows affected, 2 warnings (0.78 sec)
- mysql> INSERT INTO EmployeeInfo (id, name, post, salary) VALUES
- -> (1, 'Alice Johnson', 'Software Engineer', 75000),
- -> (2, 'Bob Smith', 'QA Engineer', 68000),
- -> (3, 'Cathy Williams', 'Software Engineer', 75000),
- -> (4, 'David Brown', 'UI/UX Designer', 72000),
- -> (5, 'Ella Davis', 'Project Manager', 90000),
- -> (6, 'Frank Wilson', 'Backend Developer', 77000),
- -> (7, 'Grace Lee', 'Frontend Developer', 76000),
- -> (8, 'Henry Clark', 'Software Engineer', 75000),
- -> (9, 'Ivy Lewis', 'QA Engineer', 68000),
- -> (10, 'Jake Hall', 'Intern', 30000),
- -> (11, 'Karen Young', 'Project Manager', 90000),
- -> (12, 'Leo King', 'Security Analyst', 85000),
- -> (13, 'Mona Scott', 'Full Stack Developer', 82000),
- -> (14, 'Nathan Adams', 'Scrum Master', 88000),
- -> (15, 'Olivia Baker', 'Frontend Developer', 76000),
- -> (16, 'Paul Turner', 'Cloud Architect', 98000),
- -> (17, 'Queenie Allen', 'Machine Learning Engineer', 97000),
- -> (18, 'Robert Hill', 'Backend Developer', 77000),
- -> (19, 'Sara Green', 'QA Engineer', 68000),
- -> (20, 'Tom Wright', 'Support Engineer', 65000);
- Query OK, 20 rows affected (0.20 sec)
- Records: 20 Duplicates: 0 Warnings: 0
- mysql> DESC EmployeeInfo;
- +--------+-------------+------+-----+---------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +--------+-------------+------+-----+---------+-------+
- | id | int | YES | | NULL | |
- | name | varchar(50) | YES | | NULL | |
- | post | varchar(50) | YES | | NULL | |
- | salary | int | YES | | NULL | |
- +--------+-------------+------+-----+---------+-------+
- 4 rows in set (0.48 sec)
- mysql> SELECT * FROM EmployeeInfo;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 19 | Sara Green | QA Engineer | 68000 |
- | 20 | Tom Wright | Support Engineer | 65000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> DELETE FROM EmployeeInfo WHERE id = 19
- -> ;
- Query OK, 1 row affected (0.09 sec)
- mysql> SELECT * FROM EmployeeInfo
- -> ;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 20 | Tom Wright | Support Engineer | 65000 |
- +------+----------------+---------------------------+--------+
- 19 rows in set (0.00 sec)
- mysql> INSERT INTO EmployeeInfo(id, name, post, salaray) VALUES (19, John Doe, Intern, 30000);
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Doe, Intern, 30000)' at line 1
- mysql> INSERT INTO EmployeeInfo(id, name, post, salary) VALUES(19, 'John Doe', 'Intern', 30000);
- Query OK, 1 row affected (0.06 sec)
- mysql> SELECT * FROM EmployeeInfo
- -> ;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 20 | Tom Wright | Support Engineer | 65000 |
- | 19 | John Doe | Intern | 30000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> SELECT * FROM EmployeeInfo
- -> ;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 20 | Tom Wright | Support Engineer | 65000 |
- | 19 | John Doe | Intern | 30000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> SELECT * FROM EmployeeInfo;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 20 | Tom Wright | Support Engineer | 65000 |
- | 19 | John Doe | Intern | 30000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> SELECT * FROM EmployeeInfo;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 20 | Tom Wright | Support Engineer | 65000 |
- | 19 | John Doe | Intern | 30000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> UPDATE EmployeeInfo SET id = 19 WHERE name = 'Tom Wright';
- Query OK, 1 row affected (0.06 sec)
- Rows matched: 1 Changed: 1 Warnings: 0
- mysql> SELECT * FROM EmployeeInfo;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 19 | Tom Wright | Support Engineer | 65000 |
- | 19 | John Doe | Intern | 30000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> UPDATE EmployeeInfo SET id = 19 WHERE name = 'John Doe';
- Query OK, 0 rows affected (0.00 sec)
- Rows matched: 1 Changed: 0 Warnings: 0
- mysql> SELECT * FROM EmployeeInfo;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 19 | Tom Wright | Support Engineer | 65000 |
- | 19 | John Doe | Intern | 30000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> UPDATE EmployeeInfo SET id = 20 WHERE name = 'John Doe';
- Query OK, 1 row affected (0.04 sec)
- Rows matched: 1 Changed: 1 Warnings: 0
- mysql> SELECT * FROM EmployeeInfo;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 19 | Tom Wright | Support Engineer | 65000 |
- | 20 | John Doe | Intern | 30000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> INSERT INTO EmployeeInfo (id, name, post, salary) VALUES (21, 'James L', 'Jr. Engineer', 35000);
- Query OK, 1 row affected (0.06 sec)
- mysql> SELECT * FROM EmployeeInfo;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 19 | Tom Wright | Support Engineer | 65000 |
- | 20 | John Doe | Intern | 30000 |
- | 21 | James L | Jr. Engineer | 35000 |
- +------+----------------+---------------------------+--------+
- 21 rows in set (0.00 sec)
- mysql> DELETE FROM EmployeeInfo WHERE id = '21'
- -> ;
- Query OK, 1 row affected (0.14 sec)
- mysql> SELECT * FROM EmployeeInfo;
- +------+----------------+---------------------------+--------+
- | id | name | post | salary |
- +------+----------------+---------------------------+--------+
- | 1 | Alice Johnson | Software Engineer | 75000 |
- | 2 | Bob Smith | QA Engineer | 68000 |
- | 3 | Cathy Williams | Software Engineer | 75000 |
- | 4 | David Brown | UI/UX Designer | 72000 |
- | 5 | Ella Davis | Project Manager | 90000 |
- | 6 | Frank Wilson | Backend Developer | 77000 |
- | 7 | Grace Lee | Frontend Developer | 76000 |
- | 8 | Henry Clark | Software Engineer | 75000 |
- | 9 | Ivy Lewis | QA Engineer | 68000 |
- | 10 | Jake Hall | Intern | 30000 |
- | 11 | Karen Young | Project Manager | 90000 |
- | 12 | Leo King | Security Analyst | 85000 |
- | 13 | Mona Scott | Full Stack Developer | 82000 |
- | 14 | Nathan Adams | Scrum Master | 88000 |
- | 15 | Olivia Baker | Frontend Developer | 76000 |
- | 16 | Paul Turner | Cloud Architect | 98000 |
- | 17 | Queenie Allen | Machine Learning Engineer | 97000 |
- | 18 | Robert Hill | Backend Developer | 77000 |
- | 19 | Tom Wright | Support Engineer | 65000 |
- | 20 | John Doe | Intern | 30000 |
- +------+----------------+---------------------------+--------+
- 20 rows in set (0.00 sec)
- mysql> CREATE TABLE Departments (
- -> depid INT,
- -> dept varchar(50)
- -> );
- Query OK, 0 rows affected (4.47 sec)
- mysql> DESC TABLE Departments;
- +----+-------------+-------------+------------+------+---------------+------+---------+------+------+----------+-------+
- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
- +----+-------------+-------------+------------+------+---------------+------+---------+------+------+----------+-------+
- | 1 | SIMPLE | Departments | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | NULL |
- +----+-------------+-------------+------------+------+---------------+------+---------+------+------+----------+-------+
- 1 row in set, 1 warning (0.59 sec)
- mysql> DESC Departments;
- +-------+-------------+------+-----+---------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +-------+-------------+------+-----+---------+-------+
- | depid | int | YES | | NULL | |
- | dept | varchar(50) | YES | | NULL | |
- +-------+-------------+------+-----+---------+-------+
- 2 rows in set (0.23 sec)
- mysql> clear
- mysql> INSERT INTO Departments (depid, dept) VALUES (1, 'Engineering'), (2, 'Human Resources'), (3, 'Product'), (4, 'Support');
- Query OK, 4 rows affected (0.24 sec)
- Records: 4 Duplicates: 0 Warnings: 0
- mysql> SELECT * FROM Departments
- -> ;
- +-------+-----------------+
- | depid | dept |
- +-------+-----------------+
- | 1 | Engineering |
- | 2 | Human Resources |
- | 3 | Product |
- | 4 | Support |
- +-------+-----------------+
- 4 rows in set (0.00 sec)
- mysql> SELECT e.name, e.post, d.dept
- -> FROM EmployeeInfo e
- -> CROSS JOIN Departments d;
- +----------------+---------------------------+-----------------+
- | name | post | dept |
- +----------------+---------------------------+-----------------+
- | Alice Johnson | Software Engineer | Support |
- | Alice Johnson | Software Engineer | Product |
- | Alice Johnson | Software Engineer | Human Resources |
- | Alice Johnson | Software Engineer | Engineering |
- | Bob Smith | QA Engineer | Support |
- | Bob Smith | QA Engineer | Product |
- | Bob Smith | QA Engineer | Human Resources |
- | Bob Smith | QA Engineer | Engineering |
- | Cathy Williams | Software Engineer | Support |
- | Cathy Williams | Software Engineer | Product |
- | Cathy Williams | Software Engineer | Human Resources |
- | Cathy Williams | Software Engineer | Engineering |
- | David Brown | UI/UX Designer | Support |
- | David Brown | UI/UX Designer | Product |
- | David Brown | UI/UX Designer | Human Resources |
- | David Brown | UI/UX Designer | Engineering |
- | Ella Davis | Project Manager | Support |
- | Ella Davis | Project Manager | Product |
- | Ella Davis | Project Manager | Human Resources |
- | Ella Davis | Project Manager | Engineering |
- | Frank Wilson | Backend Developer | Support |
- | Frank Wilson | Backend Developer | Product |
- | Frank Wilson | Backend Developer | Human Resources |
- | Frank Wilson | Backend Developer | Engineering |
- | Grace Lee | Frontend Developer | Support |
- | Grace Lee | Frontend Developer | Product |
- | Grace Lee | Frontend Developer | Human Resources |
- | Grace Lee | Frontend Developer | Engineering |
- | Henry Clark | Software Engineer | Support |
- | Henry Clark | Software Engineer | Product |
- | Henry Clark | Software Engineer | Human Resources |
- | Henry Clark | Software Engineer | Engineering |
- | Ivy Lewis | QA Engineer | Support |
- | Ivy Lewis | QA Engineer | Product |
- | Ivy Lewis | QA Engineer | Human Resources |
- | Ivy Lewis | QA Engineer | Engineering |
- | Jake Hall | Intern | Support |
- | Jake Hall | Intern | Product |
- | Jake Hall | Intern | Human Resources |
- | Jake Hall | Intern | Engineering |
- | Karen Young | Project Manager | Support |
- | Karen Young | Project Manager | Product |
- | Karen Young | Project Manager | Human Resources |
- | Karen Young | Project Manager | Engineering |
- | Leo King | Security Analyst | Support |
- | Leo King | Security Analyst | Product |
- | Leo King | Security Analyst | Human Resources |
- | Leo King | Security Analyst | Engineering |
- | Mona Scott | Full Stack Developer | Support |
- | Mona Scott | Full Stack Developer | Product |
- | Mona Scott | Full Stack Developer | Human Resources |
- | Mona Scott | Full Stack Developer | Engineering |
- | Nathan Adams | Scrum Master | Support |
- | Nathan Adams | Scrum Master | Product |
- | Nathan Adams | Scrum Master | Human Resources |
- | Nathan Adams | Scrum Master | Engineering |
- | Olivia Baker | Frontend Developer | Support |
- | Olivia Baker | Frontend Developer | Product |
- | Olivia Baker | Frontend Developer | Human Resources |
- | Olivia Baker | Frontend Developer | Engineering |
- | Paul Turner | Cloud Architect | Support |
- | Paul Turner | Cloud Architect | Product |
- | Paul Turner | Cloud Architect | Human Resources |
- | Paul Turner | Cloud Architect | Engineering |
- | Queenie Allen | Machine Learning Engineer | Support |
- | Queenie Allen | Machine Learning Engineer | Product |
- | Queenie Allen | Machine Learning Engineer | Human Resources |
- | Queenie Allen | Machine Learning Engineer | Engineering |
- | Robert Hill | Backend Developer | Support |
- | Robert Hill | Backend Developer | Product |
- | Robert Hill | Backend Developer | Human Resources |
- | Robert Hill | Backend Developer | Engineering |
- | Tom Wright | Support Engineer | Support |
- | Tom Wright | Support Engineer | Product |
- | Tom Wright | Support Engineer | Human Resources |
- | Tom Wright | Support Engineer | Engineering |
- | John Doe | Intern | Support |
- | John Doe | Intern | Product |
- | John Doe | Intern | Human Resources |
- | John Doe | Intern | Engineering |
- +----------------+---------------------------+-----------------+
- 80 rows in set (0.03 sec)
- mysql> CREATE VIEW NoSalary AS
- -> SELECT id, name, post FROM EmployeeInfo;
- Query OK, 0 rows affected (0.18 sec)
- mysql> Select * FROM NoSalary'
- '> ^C
- mysql> Select * FROM NoSalary;
- +------+----------------+---------------------------+
- | id | name | post |
- +------+----------------+---------------------------+
- | 1 | Alice Johnson | Software Engineer |
- | 2 | Bob Smith | QA Engineer |
- | 3 | Cathy Williams | Software Engineer |
- | 4 | David Brown | UI/UX Designer |
- | 5 | Ella Davis | Project Manager |
- | 6 | Frank Wilson | Backend Developer |
- | 7 | Grace Lee | Frontend Developer |
- | 8 | Henry Clark | Software Engineer |
- | 9 | Ivy Lewis | QA Engineer |
- | 10 | Jake Hall | Intern |
- | 11 | Karen Young | Project Manager |
- | 12 | Leo King | Security Analyst |
- | 13 | Mona Scott | Full Stack Developer |
- | 14 | Nathan Adams | Scrum Master |
- | 15 | Olivia Baker | Frontend Developer |
- | 16 | Paul Turner | Cloud Architect |
- | 17 | Queenie Allen | Machine Learning Engineer |
- | 18 | Robert Hill | Backend Developer |
- | 19 | Tom Wright | Support Engineer |
- | 20 | John Doe | Intern |
- +------+----------------+---------------------------+
- 20 rows in set (0.02 sec)
- mysql> SELECT AVG(salary) AS average_salary FROM EmployeeInfo;
- +----------------+
- | average_salary |
- +----------------+
- | 74700.0000 |
- +----------------+
- 1 row in set (0.03 sec)
- mysql> SELECT AVG(salary) AS average_developer_salary FROM EmployeeInfo WHERE post LIKE '%Developer';
- +--------------------------+
- | average_developer_salary |
- +--------------------------+
- | 77600.0000 |
- +--------------------------+
- 1 row in set (0.03 sec)
Advertisement
Add Comment
Please, Sign In to add comment