Journal
Journal
2. Implement SQL queries to perform various DML Commands. (Insert minimum 5 rows
using different insert methods, edit and remove data using update and delete commands).
Perform following queries for above table.
1) Insert five records in employee table.
2) Update employee’s salary to 20000 for all employees working in marketing
department.
3) Delete all employees working in finance department.
4. Implement SQL queries using group functions like Avg, Min, Max, Sum and Count etc.
Create table employee with fields (emp_id, emp_name, city, dept, salary)
1) Count total numbers of employees living in Vadodara city.
2) Find out minimum salary of employee.
3) Find out maximum salary of employee.
4) Find out the sum of salary of employees working in marketing department.
5) Find out average of salary of all employees.
7. Write a SQL to find Customers not living in ‘Mumbai’, ‘Ahmadabad’ and ‘Vadodara’
using In Operator.
8. Write a SQL for a particular table and dos various operations on it.
Table Customer (CustomerID, CustomerName, Country, Address)
Perform following constraints
1) CustomerID is primary key.
2) CustomerID should start with ‘C’ e.g. C001, C002…..
3) Customer Name should not be Null.
9. Write a SQL for a particular table and dos various operations on it.
Table student_master(stud_id, stud_name,city, semester, age)
1) Write a SQL to find all students with a City starting with letter “s”.
2) Write a SQL to find out list of students having age less than 23.
3) Write a SQL to find list of students with name ending with the letter “a”.
4) Write a SQL to find students whose second character is ‘a’.
10. Write a SQL to display all customers from the “customer” table, sorted by the “City”
column also try to sort in descending order.
11. Write a SQL statement selects all customers from the city “Mumbai” OR “Ahmedabad”,
in the “customers” table.
12. Write a SQL to create table Sales with fields (O_id, Oder_name, P revious_balance,
Customer). And find all the customers whose Pervious_balance is more than 5000.
15. Perform left join on above both tables Customer and Orders.
16. Create one table employee (empid, empname, salary, designation) also Create sequence
and use it to insert records.
17. Create a SQL to create two tables First with two fields ID, Name and second tables with
same fields ID, Name and perform Union set Operation on it.
18. Create a SQL to perform Intersect set operation on above two tables.
19. Create a SQL to perform minus set operation on above two tables.
20. Create a table name students with column stud_id, stud_name, det, semester, and city
perform following queries.
1) Make stud_id as primary key and insert seven records.
2) Find the students who are living in Baroda city and studying in ‘IMCA’ department.
3) Find all the students whose name is start with ‘A’.
21. Writa SQL to show the user of ALTER and DROP command to modify table.
Table employee (EMP_id, EMP_name, Salary).
1) Add new column to above table.
2) Change column data type
3) Drop table column.