You are on page 1of 2

Information Systems

Lab work – week 1


Create a database named MyCompany and make 2 tables Employees and
Departments inside it.

Please follow naming convention while writing script.

The tables should have the following structure and datatypes:

Employees Table
EmpID INT
FirstName VARCHAR(255)
LastName VARCHAR(255)
Age INT
DepartmentID INT
Salary decimal

Departments Table
DepartmentID INT
DepartmentName VARCHAR(255)

After creating the tables enter the following data into them:

EmpID FirstName LastName Age DeparmentID Salary


1 John Smith 29 1 40000.00
2 Sara Jones 28 2 50000.25
3 Donald Duck 33 1 60000.50
4 Jeff Hinton 40 2 80000.00
5 Yoshua Bengio 38 1 75000.10
6 Yaan Lecun 39 1 75000.99

DepartmentID DepartmentName
1 Hardware
2 Software
Write queries for the following:

1. Show all records from the Employees table


2. Show all records from the Departments table
3. Show first name and age of all the employees
4. Show first name and salary of the employees
5. Show all the details of employees table.
6. Drop Departments table.
7. Drop Database MyCompany.

You might also like