Académique Documents
Professionnel Documents
Culture Documents
Datatype Use
VARCHAR used for columns which will be used to store characters and integers, basically a
string.
CHAR used for columns which will store char values(single character).
Creating a Database
To create a database in RDBMS, create command is used. Following is the syntax
Create table:
INSERT VALUE:
OUTPUT:
Select*from student;
Output:
ALTER TABLE WITH MODIFY:
Drop column:
TRUNCATE TABLE:
QUERIES:
Q1:
Create a table called emp with following structre.
Name type
Empno int
Ename varchar(15)
Job varchar(10)
Solution:
Q2:
Add a column experience to the emp table.
Experience numeric null allowed
Q3:
Modify the column width of the job field of emp table.
Solution:
Q4:
Create dep table with the following structure.
Name type
Deptno int;
Dname varchar(10);
Loc varchar(10);
Solution:
Q5:
Create the emp1 table with ename and empno,add
constraints to check the empno value while entering
empno>100.
Solution:
Q6:
Drop a column experience to the emp table.
Solution:
Q7:
Truncate the emp table and drop the dept table.
Command Description
alter a table .