logo

SQL Operations and Constraints

   

Added on  2019-09-16

7 Pages1034 Words382 Views
 | 
 | 
 | 
STUDENT NAME: 8 November 2016DATABASE ASSIGNMENT0 | P a g e0
SQL Operations and Constraints_1

ContentsPART 1...................................................................................................................................................2PART 2...................................................................................................................................................3PART 3...................................................................................................................................................5PART 4...................................................................................................................................................5
SQL Operations and Constraints_2

PART 1a.SELECT * FROM CUSTOMER;b.SELECT CUSTI_ID, CUST_TITLE FROM CUSTOMER;c.SELECT * FROM LEAD WHERE AMOUNT > 12000;d.SELECT * FROM LEAD WHERE AMOUNT <= 12000 AND POSSIBILITY > 50;e.SELECT * FROM LEAD WHERE AMOUNT >= 12000 OR POSSIBILITY > 70;f.SELECT * FROM CUSTOMER WHERE CUST_PC IN (55120, 55124, 37300, 77501);g.SELECT * FROM CUSTOMER WHERE CUST_TITLE LIKE 'B%';h.SELECT * FROM CUSTOMER WHERE CUST_TITLE LIKE '%r';i.SELECT * FROM CUSTOMER WHERE CUST_PC LIKE '_5%';j.SELECT * FROM LEAD WHERE EXPECTED_DATE > '2015-06-01';k.UPDATE LEAD SET AMOUNT = (AMOUNT/2) + AMOUNT;SELECT * FROM LEAD WHERE AMOUNT > 25000 ORDER BY AMOUNT DESCl.SELECT CUST_TITLE, CUST_STATE, CUST_PC FROM CUSTOMER ORDER BY CUST_STATE, CUST_PC DESC;m.SELECT COUNT(*) FROM SLPRS;n.SELECT COUNT(SLPRS_TELEPHONE) FROM SLPRS;o.SELECT COUNT(DISTINCT(CUSTOMER_ID)) AS NO_OF_DIFFERENT_CUSTOMER_LEADS_BELONG FROM LEAD;p.SELECT COUNT(DISTINCT(CUSTOMER_ID)) AS NO_OF_DIFFERENT_CUSTOMER_LEADS_BELONG, COUNT(DISTINCT(SLPRS_ID)) AS NO_OF_DIFFERENT_SALESPERSON FROM LEAD;q.SELECT SUM(AMOUNT) FROM LEAD WHERE POSSIBILITY > 65;r.SELECT SUM(AMOUNT), AVG(AMOUNT), COUNT(LEAD_ID) FROM LEAD WHERE STATUS = 'I';
SQL Operations and Constraints_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents