0% found this document useful (0 votes)
23 views6 pages

Practical-1 Table - Customer: Output

The documents provide examples of SQL queries on customer and order tables from a database. The queries return customer information for a specific salesman, orders over a certain amount, unique salesman IDs, customer names starting with C, and order numbers, amounts and dates.

Uploaded by

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

Practical-1 Table - Customer: Output

The documents provide examples of SQL queries on customer and order tables from a database. The queries return customer information for a specific salesman, orders over a certain amount, unique salesman IDs, customer names starting with C, and order numbers, amounts and dates.

Uploaded by

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

PRACTICAL-1

Table -Customer
CNUM CNAME CITY RATING SNUM
2001 Harsh London 100 1001
2002 Gita Bombay 200 1002
2003 Lalit Rome 200 1003
2004 Govind Surat 300 1001
2005 Chirag London 100 1004
2006 Chinmay Goa 350 1001

Give all the information about all the customers with salesman number 1001.

Ans-SELECT * FROM Customer WHERE SNUM=1001;

Output
2001 Harsh London 100 1001
2004 Govind Surat 300 1001
2006 Chinmay Goa 350 1001
PRACTICAL -2

ORDER
ONUM AMOUNT ODATE CNUM SNAME
3001 18.69 13/07/2022 2001 1001
3002 767.50 13/07/2022 2002 1005
3003 1500 13/07/2022 2005 1002
3004 1200 13/07/2022 2004 1001
3005 80 13/07/2022 2006 1005
3006 4000 13/07/2022 2003 1004
3007 455 13/07/2022 2008 1002
3008 3500 14/07/2022 2009 1001
3009 1485 14/07/2022 2010 1005
3010 65 14/07/2022 2007 1001
3011 1850 14/07/2022 2011 1004

Ques-. List of all orders for more than Rs. 1000.

SELECT * FROM ORDER WHERE AMOUNT > 1000;

Output

3001 18.69 13/07/2022 2001 1001


3004 1200 13/07/2022 2004 1001
3008 3500 14/07/2022 2009 1001
3010 65 14/07/2022 2007 1001
PRACTICAL -3
ONUM AMOUNT ODATE CNUM SNAME
3001 18.69 13/07/2022 2001 1001
3002 767.50 13/07/2022 2002 1005
3003 1500 13/07/2022 2005 1002
3004 1200 13/07/2022 2004 1001
3005 80 13/07/2022 2006 1005
3006 4000 13/07/2022 2003 1004
3007 455 13/07/2022 2008 1002
3008 3500 14/07/2022 2009 1001
3009 1485 14/07/2022 2010 1005
3010 65 14/07/2022 2007 1001
3011 1850 14/07/2022 2011 1004

QUES-3 List of SNUM of all salesmen with orders in order table without any duplicates.

Sol-
SELECT DISTINCT SNUM FROM order ORDER BY SNUM.

OUTPUT

SNUM

1001
1002
1004
1005
PRACTICAL-4

Table -Customer
CNUM CNAME CITY RATING SNUM
2001 Harsh London 100 1001
2002 Gita Bombay 200 1002
2003 Lalit Rome 200 1003
2004 Govind Surat 300 1001
2005 Chirag London 100 1004
2006 Chinmay Goa 350 1001

Ques -List all customers whose names begins with a letter 'C'.

SOL:-

SELECT CNAME

FROM Customer

WHERE CNAME LIKE ‘C%’

OUTPUT
CNAME
Chinmay
Chirag
PRACTICAL -5
QUES - Produce the order no, amount and date of all orders.
ORDER(TABLE NAME)

ONUM AMOUNT ODATE CNUM SNAME


3001 18.69 13/07/2022 2001 1001
3002 767.50 13/07/2022 2002 1005
3003 1500 13/07/2022 2005 1002
3004 1200 13/07/2022 2004 1001
3005 80 13/07/2022 2006 1005
3006 4000 13/07/2022 2003 1004
3007 455 13/07/2022 2008 1002
3008 3500 14/07/2022 2009 1001
3009 1485 14/07/2022 2010 1005
3010 65 14/07/2022 2007 1001
3011 1850 14/07/2022 2011 1004

Sol-

SELECT ONUM,AMOUNT ,ODATE FROM ORDER

output

ONUM AMOUNT ODATE


3001 18.69 13/07/2022
3002 767.50 13/07/2022
3003 1500 13/07/2022
3004 1200 13/07/2022
3005 80 13/07/2022
3006 4000 13/07/2022
3007 455 13/07/2022
3008 3500 14/07/2022
3009 1485 14/07/2022
3010 65 14/07/2022
3011 1850 14/07/2022

You might also like