0% found this document useful (0 votes)
4 views1 page

Dbms MySQL Exercise

The document outlines a series of tasks related to creating and managing database tables for students, employees, and purchases. It includes instructions for creating tables with specific constraints, inserting records, updating data, and querying information. The tasks emphasize data integrity through constraints and the calculation of totals and averages for student marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Dbms MySQL Exercise

The document outlines a series of tasks related to creating and managing database tables for students, employees, and purchases. It includes instructions for creating tables with specific constraints, inserting records, updating data, and querying information. The tasks emphasize data integrity through constraints and the calculation of totals and averages for student marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1) a) Create a table Student (regno, name, mark1, mark2, total, average) and insert records.

b) Specify a constraint that no input of marks can be less than zero or greater than 100.
c) Input the following details alone (Regno, name, mark1, mark2) and calculate the total and
average and update the database.
d) Delete the student details for the specified regno.

2) a) Create a table employee (empid, name, dept_name, hire_date, salary) and specify the
corresponding constraints
b) Display the employees who are working in sales department
c) Find out the number of employees working in purchase department.

3) a) Create a table Purchase(customer_id, bill_no, bill_date, item_name, quantity, unit_price,


amount) and insert records.

b) Specify the constraint that bill_no should not be null and grater than 1000.

c) Replace the item_name as ‘Whaet’ which has been misspelled as ‘cheat’

d) Find the maximum number of items purchased.

4) a) Create tables

Student_marks (regno, mark1, mark2, total)

Student_details (regno, name, class, batch_year, semester, result) and insert records

b) Specify a foreign key constraint on regno.

c) Find the total of marks when marks are input and update the database.

You might also like