SQL Assignment
SQL Assignment
SQL Assignment
SELECT column_name(s)
FROM table_name;
UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value
2. Create three tables with minimum 5 attributes
1. Employee
2. Customer
3. Department
Ans:
Dept varchar(10),
Sal varchar(10),
Hiredate date};
Location varchar(10);
Company varchar(10);
Phone varchar(18)
};
Ans.
6. Write various string, mathematical and data functions and give examples.
Length: it is used yo find the length of the string including the count of blank if
any.
LTrim/rtrimk
Its use is to remove the specified character or character from the string until it
happens to be the first on the left or the right.
Lpad/rpad: its use to pad the string with the specified characteristics from the
left or right.they take 3 arguments:
From emp;
6. Explain
1 ) Create the table by the name employee_master which includes the fields emp_id
as primary key, emp_name, emp_age, emp_address, emp_department,
emp_location.
2) Insert 10 records using insert statement.
3) Delete the records where emp_age is between 30 to 40
4) Update those records in which employee address is rohini to dwarka.
5) Rename the table from employee_master to emp_master.