The document provides SQL queries to create two tables, "employees" and "departments", in a database named "my_database". The "employees" table stores information about employees including their ID, name, department ID, and salary. This table is populated with 20 rows of sample employee data. The "departments" table stores department details like ID, name, location, and employee count. This table is populated with 10 rows of sample department data.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
22 views
SQL - Data For Code Based Questions
The document provides SQL queries to create two tables, "employees" and "departments", in a database named "my_database". The "employees" table stores information about employees including their ID, name, department ID, and salary. This table is populated with 20 rows of sample employee data. The "departments" table stores department details like ID, name, location, and employee count. This table is populated with 10 rows of sample department data.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Data provided for code evaluation question (This has to be provided with each set for
students to solve code based questions)
Use the following SQL queries to create two tables: employees and department: -- Create a new database named "my_database" CREATE DATABASE my_database; USE my_database;
-- Create the "employees" table
CREATE TABLE employees ( employee_id INT PRIMARY KEY, first_name VARCHAR(50), last_name VARCHAR(50), department_id INT, salary INT );