A
B
C
D
E
100

create a table file, having columns file no.(fno, integer,unique), category(cat, variable size character 12, cannot be empty), date of creation(doc,date) and owner of file(owner, variable character 20)

create table file

(

fno smallint primary key,

cat varchar(12) not null,

doc date,

owner varchar(20)

);

100

To change the age(age) and name(ename) of employee number(empno) 1 to 12  and XYZ in emp table

Update EMP

Set age=12 , ename=’XYZ’

Where empno=1;

100

to add a column sal decimal(7,2) which is positive in emp

Alter table emp

 add sal decimal(7,2) unsigned ;                

100

To make empno as primary key in  table emp

              Alter table emp

              Add primary key(Empno);

100

to change the size of (ename, varchar) to 30 in emp table

              Alter table emp

              Modify ename varchar(30) ;

200

Give syntax for left function

select left(STRING, No. of Charcaters from left);

200

Given syntax for mid

select mid(STRING,pos,No. of Charcaters);

200

give function to retrieve day from a date

select day('YYYY-MM-DD');

200

give function to display name of the day from a given date

select dayname('YYYY-MM-DD');

200

which function converts negative no. to positive no.?

ABS

300

give function to display the system date and time

now()

300

give output for the following

mod(89,7)

5

300

give output for the following

round(934.45,-1)

930

300

give outputs for the following

select mod(87,-5)

select mod(-87,5)

select mod(-87,-5)

 2

-2

-2

300

give output for the following


select mid('The quick brown fox jumps over the lazy dog ', 7, 11); 

ick brown f

400

delete a column enm from emp 

alter table emp

drop enm;

400

give structure of table emp

desc emp;

400

give a query to select all the rows from the table emp

select * from emp;

400

increase the sal of all employees by 7000 where city is MUM in emp table

update emp

set sal=sal+7000

where city='MUM';

400

insert a record in table emp having following columns

eid smallint primary key auto_increment

enm varchar(15) not null

deptid char(3)

dob date

sal decimal(8,2)

insert into emp(enm,deptid,dob,sal) values('abc','xyz','1999-09-06',56000);

500

create a database TYBCOM_777

create database tybcom_777;

500

delete table emp

drop table emp;

500

change the auto_increment sequence from 501 for emp table

alter table emp

auto_increment=501;

500

which function is used to append or merge to different string?

concat

500

output of :

select now('2000-09-11 23:54:43')+0;

20220713220843.000000

M
e
n
u