Professional Documents
Culture Documents
Tybcom Mysql Paper
Tybcom Mysql Paper
(6M)
1) To indicate that there should be 6 integers and 2 decimal positions we use ____.
a) DECIMAL(8,2) b) DECIMAL(6,2) c) DECIMAL(2,6) d) DECIMAL(2,8)
2) To Save the transaction we use _____.
a) Rollback b) Save c) Commit d) Return
3) A Database contains one or more ______.
a) Rows b) Databases c) Columns d) Tables
4) To make changes in the data already entered in the table we use ____.
a) Alter table b) Update & set c) Select d) Create
5) The clause used to arrange the rows in the table is ______.
a) Arrange By b) Sort By c) Order By d) Display By
6) The query Select * from department; will display _______ the rows in the table department.
a) First row b) Last row c) Middle two row d) All
c) populate the above table with 4 rows using 2 INSERT statement each containing
information of 2 rows only.
12 SMIT 5th December, 2009 29 15,000.00
25 SUMIT 7th May, 2012 21 12,000.00
21 ARYAN 3rd December, 2010 22 25,000.00
48 PREM 12th December, 2015 25 14,500.00
2) There exists a table called Employee, containing Employee Number (E_NO Smallint
Unsigned Primary Key), Employee Name (E_NAME Varchar(15)), AGE (E_AGE Smallint
Unsigned), Department (E_DEPT Varchar(8)), Date of joining (DOJ DATE), Salary (E_SAL
Decimal(8,2)). Write MySQL statements for the following;
a) Display all the records.
b) Display department, salary with heading SALARY and name for each employee.
c) Display all the details and HRA as 10% of salary fr all the records.
d) Remove Unsigned attribute from AGE column.
e) Display name, 25% of salary as 'BONUS PAID' and salary of employee no. 5 to employee
no. 12
f) Display a message '<E_NAME> is working for <E_DEPT> department, since <DOJ>' for
each record.
g) Display name, date of joining in the format of 'Thu 22-Feb-2012' and Salary round off to
nearest 10 fr each row.
h) Display records if age is in the range of 25 to 45.
i) Display name and department where 2nd character of department name is A.
j) Display records where first 2 characters of name are same as last 2 characters of name.
3) A table called as STUDENT contains roll number (ROLL), Name of the student (SNAME),
Date of birth (DOB) and marks in 4 subject (M1, M2, M3, M4). Write MySQL statement for the
following;
a) Display all details with total marks and average of marks for all the students.
b) Display name of the student and average of marks with the heading 'Avg Marks'.
c) Display records where marks in any subject are 30 or less.
d) Display records where total of marks is above 300 and name starting with letter D.
e) Display name of the student with prefix “Mr./Mrs.” and average of marks if average is
above 75.
f) Display records where name is not ending with letter H or A or S.
g) Display records where total f marks are not between 150 and 360.
h) Display records where student is born on Sunday or Tuesday.
i) Display records where length of student name is even.
j) Display first 3 character of student name, last 2 charecters of name, 5 th & 6th character of
name for each record.
:) Best of Luck :)