Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
56 views

CBSE Class 11 Information Practices - Functions in My SQL

The document describes creating an Employee table with various fields and constraints, adding 10 records to the table, and writing SQL queries to retrieve information from the Employee table based on certain conditions. The queries include selecting all records, specific fields, ordering results, filtering by departments, names, dates, and salaries.

Uploaded by

vikas_2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

CBSE Class 11 Information Practices - Functions in My SQL

The document describes creating an Employee table with various fields and constraints, adding 10 records to the table, and writing SQL queries to retrieve information from the Employee table based on certain conditions. The queries include selecting all records, specific fields, ordering results, filtering by departments, names, dates, and salaries.

Uploaded by

vikas_2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Simple Queries in SQL

Q1. Create a Table “Employee” with the following constraints


F IELD NAME DATA TYPE CONSTRAINT F IELD NAME DATA TYPE CONSTRAINT
empcode char(4) PRIMARY empdoj date
KEY,NOT ULL

empname varchar(25) NOT NULL empdept varchar(20)


empadd varchar(30) empphone int
empgender char(1) empdesg varchar(20)
empdob date empsal int

Q2. Add 10 records to the above table “Employee”.

Q3. Write the following SQL commands on the basis of above table “Employee”
a) Show all the information of the employees.
b) Display all the employee names, designation and salary.
c) Display all the employee names and their salary in descending order.
d) Display all the different departments in the company.
e) Display all the details of Female Employee.
f) Display the employee name, address and phone number from “HR” department.
g) Display all the details of employee name starting with “a”.
h) Display all the employee details (name, designation , department and gender)
with salary 1000 OR to 2000 OR.
i) Display all the details of the staff that joined from year 2000.
j) Display the names of all the “GM” in the company. (GM- General Manager).
k) Display the names of all the employees from “finance” department with salary
more than 1000
l) Display the names of all the Male employees from “transport” department with
salary less than 1000 .
m) Display the details of the entire employee NOT from “Sales” department.
n) Display the name, address of employee without phone number.
***

You might also like