Create the following table named Employee.
Field Name
Data Type
Size
Remark
Empid
Number
5
Primary Key
FName
Varchar
20
Mname
Varchar
20
SName
Varchar
20
Dno
Varchar
5
Should start with character ‘D’
DOB
Date
Should not take null value
DOJ
Date
Should not take null value & Should later than Date Of Birth
Salary
Number
7
Should take only +ve value
City
Varchar
15
Should not take null value & values should take metro names
b) Write the SQL commands for the following
Display empid, name and bonus for each employee.(Note – Bonus is 10% of the salary).
Increase the salary of each employee by 1000.
Display the year of service and age of each employee.
Delete the employee details whose salary is less than 5000.
Delete all the employee records.
Rename the table to EMP.
Add a new column mobno for storing mobile number of the employees.
Change the data type of the field empid, number to varchar with size 5.
Delete the existence of the table.
Answers
Answered by
0
create table Employee
(
empid integer,
Fname varchar[20],
Sname varchar[20],
............
);
Similar questions