0% found this document useful (0 votes)
4 views3 pages

Mysql Question Dec2023

The document contains practical SQL questions for MySQL, including tasks such as creating tables with specific constraints, inserting records, updating data, and performing various queries. It outlines steps to create an Employee and Job table, as well as a database named 'Univ' with multiple related tables. Additionally, it includes a series of commands to manipulate and retrieve data from an 'empl' table, covering a range of SQL operations.

Uploaded by

tradexakku012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Mysql Question Dec2023

The document contains practical SQL questions for MySQL, including tasks such as creating tables with specific constraints, inserting records, updating data, and performing various queries. It outlines steps to create an Employee and Job table, as well as a database named 'Univ' with multiple related tables. Additionally, it includes a series of commands to manipulate and retrieve data from an 'empl' table, covering a range of SQL operations.

Uploaded by

tradexakku012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

DAV PUBLIC SCHOOL SCEL KORBA

MySQL – Practical Questions

Qu.1 Write SQL commands to perform the following tasks –

(a) Create table Employee with the following structure:

Ensure the following specification in created table:

 ID should be declared as Primary Key


 User_ID shold be unique
 Salary Must be greater than 5000
 First_Name and Lst_Name must not remain Blank

(b) Create another table Job with following specification:

(a) Show the structure of the table employee.

(b) Show the structure of the table job.

(c) Insert 10 records into the table employee as well as Job.

(d) For record with ID 4 update record with Last_Name, User_ID and Salary.

(e) Make the changes permanent.

(f) Modify the salary and increase it by 1000, for all who get salary less than 6000.

(g)Add one new column in table Employee named „Phone‟.

(h)Provide the phone numbers to all the employees.


(i) Delete the Employee record having First_Name as Manish.

(j) Remove employee table permanently.

(k) Count the total records in the table employee.

Qu.2 Using SQL statements in MySQL, create the tables identified bellow in the following

order.

Database Name: Univ.

Create database if needed. (Underlined Columns depict primary key)

Campus (CampusID, CampusName, Street, City, State, Pin, Phone, CampusDiscount)

Position (PositionID, Position, YearlyMembershipFee)

Members (MemberID, Lastname, FirstName, CampusAddress, CampusPhone,

CampusID, PositionID, ContractDuration)

Qu.3 Consider the following Table named „empl‟ and Write SQL commands from (a) to (n)
(a) Display all the records from table empl.

(b) Display EmpNo and EName of all employees from the table empl.

(c) Display employee name, salary, and department number who are not getting

commission from table empl.

(d) Display employee number, name, sal*12 as Annual salary whose commission is not

NULL from table empl.

(e) List all department numbers from table empl.

(f) List all unique department numbers from table empl.

(g) List the details of all clerks who have not been assigned department as yet.

(h) Display the details of employees whose name have only four letters.

(i) Display the details of all employee whose annual salary is between 25000 to 40000.

(j) How many job types are offered to employees?

(k) List the employees who earn more commission than their salaries.

(l) Display name, job title and salary of employee who do not have manager.

(m) Display the name of employee whose name contains „A‟ as third letter.

(n) Display the name of employee whose name contains „L‟ as any letter.

You might also like