You are on page 1of 2

Database: HumanResource

Table: Employee
EmpID Deptnam Salary
Empname Jobtitle DateJoi
INT(10) e DECIMAL(9,2
VARCHAR(30 VARCHAR(10 n
unsigne VARCHAR )
) ) DATE
d (10)
1001 Richard Eng Manager 12/04/200 8412.45
Sylvester 0
1002 Adrianna Wong Mech Supervisor 24/07/200 7640.55
Li Ping 5
1003 Muhammad Ali Mech Technician 12/12/201 3000.25
Imran 6
1004 Steven Ong Surv Technician 6/8/2018 2527.40
1005 Baroba Peter Eng Engineer 7/1/2017 5200.65
John

1. Create database
2. Create table below

3. Add the following constraint:


- Primary key (empid)
- Auto_increment (empid)
- Not null (all columns)
- Default value (salary = 0)

4. Show the table structure

5. Insert values into table


6. Show all entries in Employee table

7. Show emp name with salary <5000

8. Show empname and deptname where name start with a.

9. List the year of service for all employees in ascending order.

You might also like