Q18. Create A Table Named As STUDENT With The Following Fields As

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 21

ISM LAB 03213701717

Q18. Create a table named as STUDENT with the following fields as:
 S_no
 Name
 State
 Age
 Marks
Execute the following queries after entering 10 records in the table.
 Display all the details of the given table

 Display the names in alphabetical order

 Display the name along with the marks where marks are greater than 60

 Display the name of students whose name starts with letter ‘A’.

 Display the details of students who live in ‘Delhi’.

 Display the details of students who are older than 10 years.


Ans

TABLE DESIGN VIEW


ISM LAB 03213701717

DATABASE VIEW

NAMES IN ALPHABETICAL ORDER

STUDENT DETAILS WITH MARKS GREATER THAN 60

NAME OF STUDENTS STARTING WITH “A”

STUDENT DETAILS WHO LIVE IN DELHI


ISM LAB 03213701717

STUDENTS DETAILS WHO ARE OLDER THAN 10 YEARS


ISM LAB 03213701717

Q19.Create a table named as STUDENT_MARKS with the following fields as:


 S_no

 Name

 Marks

Execute the following queries after entering 10 records in the table.


 Display the S_no of those students whose names starts with L and ends with A or
marks less than 70

 Display the name and S_no of those students who have scored marks equal to 95

 Display the names and marks of all those students who have scored marks between
75 and 90.

Ans

TABLE DESIGN VIEW

DATABASE VIEW

S_no of those students whose names starts with L and ends with A or marks less than 70
ISM LAB 03213701717

Name and S_no of those students who have scored marks equal to 95

Names and marks of all those students who have scored marks between 75 and 90.
ISM LAB 03213701717

Q 20.Create a table Student with following fields


 ENROLLMENT_NO
 SNAME
 COURSE_ID
 Batch
 Semester
Execute the following queries after entering 10 records in the table.
 Display the list of Students in batch ‘2017-2020’
 Display the ENROLMENT_NO of fourth semester students.
 Display the list of students of batch ‘2017-2020’ and COURSE_IS 17.
Display the number of students in COURSE_ID 44.
Ans

TABLE DESIGN VIEW

DATABASE VIEW
ISM LAB 03213701717

LIST OF STUDENTS IN BATCH ‘2017-2020’

ENROLLMENT_NO of fourth semester students.

List of students of batch ‘2017-2020’ and COURSE_ID 17

Number of students in COURSE_ID 44

Q 21.Create table course with following fields


 COURSE_ID
 COURSENAME
 DURATION
 BATCH
ISM LAB 03213701717

Execute the following queries after entering 10 records in the table.


 Create a relationship of COURSE TABLE with STUDENT TABLE which is created
in previous exercise.
 Display all students enrolled in BBA course.
 Display name of students enrolled in 2 year course.
 Display details of students of BBA course of batch ‘2017-2020’.
Ans

TABLE DESIGN VIEW

DATABASE VIEW
ISM LAB 03213701717

Relationship between COURSE TABLE and STUDENT TABLE

STUDENTS ENROLLED IN BBA COURSE

NAME OF STUDENTS ENROLLED IN 2 YEAR COURSE

DETAILS OF STUDENTS OF BBA COURSE OF BATCH ‘2017-2020’


ISM LAB 03213701717

Q22. Create the following table CUSTOMER having the columns, data types.

Field Name Data Type


Customer_ID Number
Customer_Name Text
Designation Text
City Text
Country Text
Phone Number

Insert the data into table Customer. And apply the queries:
 Display customer details having designation Sales Representative

 Retrieve customer who is living in Canada

 Show details of the customer whose name is Victoria

 Show detail of the customer who lives in Sweden.

Ans.
TABLE DESIGN VIEW

DATABASE VIEW
ISM LAB 03213701717

CUSTOMER DETAILS HAVING DESIGNATION SALES REPRESENTATIVE

RETRIEVE CUSTOMER WHO IS LIVING IN CANADA

DETAILS OF THE CUSTOMER WHOSE NAME IS VICTORIA

DETAIL OF THE CUSTOMER WHO LIVES IN SWEDEN


ISM LAB 03213701717

Q23. Create a table EMPLOYEE either the following fields:


 Emp_id

 Emp_name

 Dept_name

 Salary

 Add

 Date of joining

Perform the following queries on it.


1. Delete the records of the employee whose Emp_id is 101

2. Delete the record of the employees whose Dept_name is HR and salary <10000

3. Delete the record of the employee whose name begins with S or salary >10000

4. Update the record of the employees, set Dept_name = IT where Dept_name is


PRODUCTION.

Update the record of the employee, set salary to 15000 where Dept_name is IT.
Ans.

TABLE DESIGN VIEW

DATABASE VIEW
ISM LAB 03213701717
ISM LAB 03213701717

Delete the records of the employee whose Emp_id is 101

Delete the record of the employees whose Dept_name is HR and salary <10000

Delete the record of the employee whose name begins with S or salary >10000
ISM LAB 03213701717

Update the record of the employees, set Dept_name = IT where Dept_name is


PRODUCTION

Update the record of the employee, set salary to 15000 where Dept_name is IT
ISM LAB 03213701717

Q24. Create a table employee with the following fields:


 Emp_id

 Emp_name

 Contact no.

 Gender

 Salary

 Emp_grade

 Designation

 Address

Execute the following queries on the table created:


1. Display the details of the employees

2. Display the employee id of employee whose name is supriya.

3. Display the name of the employee whose contact no. is 98454863011.

4. Display the details of the employee whose address is D-29, IITM, JANAKPURI.

5. Display the name of the employees whose salary is greater than 10,000.

6. Update the employee details, set EMP_GRADE equal to C whose salary is less than
10000.

7. Delete the record of the employee whose gender is male and designation is manager

8. Display the name, designation, and salary of all the employees whose names begins
with A.

9. Update the employee details; set designation to assistant manger where designation
is trainee.

Display the employee id, name, salary and designation for the employees where emp_grade
is A.
Ans.

DISPLAY THE DETAILS OF THE EMPLOYEES


ISM LAB 03213701717
ISM LAB 03213701717

Display the employee id of employee whose name is supriya

Display the name of the


employee whose contact no. is 98454863011

Display the details of the employee whose add ress is D-29, IITM, JANAKPURI

Display the name of the employees whose salary is greater than 10,000

Update the employee details, set EMP_GRADE equal to C whose salary is less than 10000
ISM LAB 03213701717

Delete the record of the employee whose gender is male and designation is manager

Display the name, designation, and salary of all the employees whose names begins with A

Update the employee details; set designation to assistant manger where designation is
trainee
ISM LAB 03213701717

Display the employee id, name, salary and designation for the employees where emp_grade
is A
ISM LAB 03213701717

Q25. Create a table named as BBA_M1 with the following fields:


 E_no

 Student name

 Address

 Phone no

 Grade

Now create another table named as BBA_M2 with the same field’s. Add
atleast 10 records to the table BBA_M1 (with first 10 enrollment nos and
BBA_M2 with next 10 e_no) and then perform the following queries on it.
1. Create a make table query which contains the A grade students from
BBA_M1

Append the A grade holders from BBA_M2 to the newly created table in the
above query.
Ans.

You might also like