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

MY SQL Practise Question

The document contains SQL practice questions related to an 'Employee' table, including queries for displaying records, updating salaries, adding new rows, and analyzing employee data. It also includes instructions for creating the table and inserting initial records. Additionally, it discusses data types and primary keys for the table structure.

Uploaded by

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

MY SQL Practise Question

The document contains SQL practice questions related to an 'Employee' table, including queries for displaying records, updating salaries, adding new rows, and analyzing employee data. It also includes instructions for creating the table and inserting initial records. Additionally, it discusses data types and primary keys for the table structure.

Uploaded by

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

MY SQL Practise Question

Consider the the following table “Employee”


Write SQL queries for the following:
i) display all records of EMPLOYEE table.
ii) display Emp ID and Name of employees who are from
Dehradun.
iii) Increase salary of all employees by 1000
iv) add new row in the table employee with the following data:
(E0009, ‘Aditya’, ‘IT’, 49800, ‘[email protected]’, ‘Delhi’)
v) display details of all employees in ascending order of
their salary.
vi) display how many employees are from Delhi
vii) display total salary of all the employees
viii) Identify the most appropriate data type for each ]field with
reason.
ix) Identify the suitable primary key. State the reason for
choosing this ]field for the primary key.
x) Add new column Aadhar No in above table.

Ans::::

Q 2) create a table

-- create
CREATE TABLE EMPLOYEE (
empId INTEGER PRIMARY KEY,
name TEXT NOT NULL,
dept TEXT NOT NULL
);

-- insert
INSERT INTO EMPLOYEE VALUES (0001, 'Clark', 'Sales');
INSERT INTO EMPLOYEE VALUES (0002, 'Dave', 'Accounting');
INSERT INTO EMPLOYEE VALUES (0003, 'Ava', 'Sales');

-- fetch
SELECT * FROM EMPLOYEE WHERE dept = 'Sales';

You might also like