0% found this document useful (0 votes)
11 views

DBMS Lab-3 - 21066

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

DBMS Lab-3 - 21066

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

DBMS LAB-3

Name:praneeth vedagiri Roll No:AM.EN.U4AIE21066


1)a)

1b)
1c)
2)cust
3)movie master

Invoice

3. Write Query statements for the following

1. Find out the names of all customers


2. Print the entire customer table.
3. Retrieve the list of FNAME and the AREA of all the customers.
4. List the various movie types available from the movie title
5. Find the names of all customers having 'a' in the second letter in their FNAME
6. Find the LNAME of all customers that begin with ‘S’ or ‘J
7. Find the LNAME of all customers that is between ‘B’ and ‘S’

8. Find out the customers who stay in an area whose second letter is ‘a'.
9. Find the list of all customers who stay in area 'ba’ or area ‘mu' or area 'gh’.

10. Print the list of movies with prices greater than 150.
11. Print all the information from the invoice table of customers who have been issued
movies in the month of September.
12. Display the invoice table information for custid 'A01' and 'A02'.

13. Find the movies of type “action” and “Comedy”


14. Find the movies with price greater than 150 and less than or equal to 200.
15. Find the movies that cost more than 159 and also find the new cost as original cost*
15
16. Rename the new column in the above query as new price,

17. List the movies in sorted order of their titles.


18. List the movies in the sorted order of type, title
19. Print the names and types of all the movie except horror movies.
20. Calculate the square root of price of each movie.
21. Display the type and the average price of each movie type.
22. Try out: select * from movie group by(type);
This query is not valid SQL as it does not aggregate non-grouped columns. It's invalid because
the columns in the SELECT list are neither aggregated nor part of the GROUP BY clause

23. Try out: select count(MVNO) from movie where count(MVNO)>2;

This query will result in a syntax error because you cannot use an aggregate function (COUNT)
in the WHERE clause directly.
24. Find the name and movie of the customer who have issued a movie.
25. List the names, areas and customer - id of customers without phone
Numbers.
26. Delete all the records having return date before 10th July'93

27. Change the area of customer – id 'a05' to 'vs'.


28. Select the TITLE, CUSTID, MVNO for all the movies that are issued.
29. Display the month (in alphabets) in which customer are supposed to return the
movies.
30. Find out if the movie starring Tom Cruise is issued to any customer and list the
CUSTID to whom it is issued.
31. Find out the title of the movie that have been issued to the customer whose FNAME
is Vandana.

32. Add a column remark of type varchar and size 25 to the invoice table.
33. Find out the movie number which has been issued to customer whose first name is
‘Pramada’.

34. Change the telephone number of Pramada to 466389.


35. Change the issue date of custid 'a01' to 24/07/93.
36. Change the price of 'Gone with the wind' to Rs. 250.00.
37. Delete the record with invoice number 'i05' from the invoice table.

38. Delete all the records having return date before 10th July '93
39. Change the area of custid a05 to ‘vs’.
40. Insert fname for customer with lname Rukmini
41. Increase the price of all movies by 100.00

42. Change the area of customers name with 2 nd letter r to LA

You might also like