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

3

The document contains a series of SQL queries for managing and retrieving data from a database related to customers, invoices, and movies. It includes SELECT statements for fetching specific fields, updating records, and deleting entries based on certain conditions. Additionally, it showcases the use of string concatenation and date formatting in SQL queries.

Uploaded by

tstanmoy28
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 views2 pages

3

The document contains a series of SQL queries for managing and retrieving data from a database related to customers, invoices, and movies. It includes SELECT statements for fetching specific fields, updating records, and deleting entries based on certain conditions. Additionally, it showcases the use of string concatenation and date formatting in SQL queries.

Uploaded by

tstanmoy28
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/ 2

3.

SELECT fname, lname FROM Cust;

3.2

SELECT * FROM Cust;

3.3

SELECT fname, area FROM Cust;

3.4

SELECT distinct type FROM Movie;

3.5

SELECT 'The Invoice No. of Customer Id ' || cust_id || ' is ' || inv_no || ' and Movie No. is ' || mv_no AS Info_A FROM
Invoice;

SELECT cust_id || ' has taken Movie No. ' || mv_no || ' on ' || TO_CHAR(issue_date, 'DD-MON-YY') || ' and will return
on ' || TO_CHAR(return_date, 'DD-MON-YY') AS Info_B FROM Invoice;

3.6

UPDATE Cust SET phone_no = 466389 WHERE fname = 'Pramada';

3.7

UPDATE Invoice SET issue_date = TO_DATE('24-JUL-93', 'DD-MON-YY') WHERE cust_id = 'a01';

3.8

UPDATE Movie SET price = 250.00 WHERE title = 'gone with the wind';

3.9

DELETE FROM Invoice WHERE inv_no = 'i08';

3.10

DELETE FROM Invoice WHERE return_date < TO_DATE('10-JUL-93', 'DD-MON-YY');

3.11

UPDATE Cust SET area = 'vs' WHERE cust_id = 'a05';

3.12

UPDATE Invoice SET return_date = TO_DATE('16-AUG-93', 'DD-MON-YY') WHERE inv_no = 'i08';

3.13

SELECT fname FROM Cust WHERE fname LIKE '_a%';

3.14

SELECT lname FROM Cust WHERE lname LIKE 'S%' OR lname LIKE 'J%';

3.15

SELECT * FROM Cust WHERE area LIKE '_a';


3.16

SELECT * FROM Cust WHERE area IN ('da', 'mu', 'gh');

3.17

SELECT * FROM Cust WHERE phone_no > 5550000;

3.18

SELECT * FROM Invoice WHERE TO_CHAR(issue_date, 'MON') = 'SEP';

3.19

SELECT * FROM Invoice WHERE cust_id IN ('a01', 'a02');

3.20

SELECT * FROM Movie WHERE type IN ('action', 'comedy');

3.21

SELECT * FROM Movie WHERE price > 150 AND price <= 200;

3.22

SELECT title, price, price * 1.5 AS new_price FROM Movie WHERE price > 150;

3.23

SELECT title, price, price * 1.5 AS "new-price" FROM Movie WHERE price > 150;

3.24

SELECT * FROM Movie ORDER BY title;

3.25

SELECT title, type FROM Movie WHERE type != 'horror';

3.26

SELECT price / (price - 100) AS result FROM Movie WHERE title = 'home alone';

3.27

SELECT fname, lname, area, cust_id FROM Cust WHERE phone_no IS NULL;

3.28

SELECT fname FROM Cust WHERE lname IS NULL;

3.29

SELECT mv_no, title, type FROM Movie WHERE star LIKE 'M%';

3.30

SELECT mv_no, inv_no FROM Invoice WHERE inv_no < 'i05';

You might also like