The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Question:
Using the ch08_saleco database write a T-SQL query to display the customer code and customer last name from the customer table where a record is returned from the invoice table where the customer customer code equals the invoice customer code. (hint: exists)
Â
Using the ch08_saleco database write a T-SQL query to display the customer code, customer last name, and customer phone for phone numbers begin with the prefix 894.
Â
Using the ch08_saleco database write a T-SQL query to display the customer code, invoice number invoice date, and invoice subtotal from invoice conditioned on the invoice subtotal is greater than $100 and from only customer codes 10011 and 10012. (hint:  in)
Â
Â
Â
/* Database Systems, 8th Ed., Rob/Coronel *//* Type of SQL : SQL Server */CREATE TABLE CUSTOMER (CUS_CODE int,CUS_LNAME varchar(15),CUS_FNAME varchar(15),CUS_INITIAL varchar(1),CUS_AREACODE varchar(3),CUS_PHONE varchar(8),CUS_BALANCE float(8));INSERT INTO CUSTOMER VALUES('10010','Ramas','Alfred','A','615','844-2573','0');INSERT INTO CUSTOMER VALUES('10011','Dunne','Leona','K','713','894-1238','0');INSERT INTO CUSTOMER VALUES('10012','Smith','Kathy','W','615','894-2285','345.86');INSERT INTO CUSTOMER VALUES('10013','Olowski','Paul','F','615','894-2180','536.75');INSERT INTO CUSTOMER VALUES('10014','Orlando','Myron','','615','222-1672','0');INSERT INTO CUSTOMER VALUES('10015','O''Brian','Amy','B','713','442-3381','0');INSERT INTO CUSTOMER VALUES('10016','Brown','James','G','615','297-1228','221.19');INSERT INTO CUSTOMER VALUES('10017','Williams','George','','615','290-2556','768.93');INSERT INTO CUSTOMER VALUES('10018','Farriss','Anne','G','713','382-7185','216.55');INSERT INTO CUSTOMER VALUES('10019','Smith','Olette','K','615','297-3809','0');/* -- */CREATE TABLE INVOICE (INV_NUMBER int,CUS_CODE int,INV_DATE datetime,INV_SUBTOTAL float(8),INV_TAX float(8),INV_TOTAL float(8));INSERT INTO INVOICEVALUES('1001','10014','1/16/2010','24.90','1.99','26.89');INSERT INTO INVOICEVALUES('1002','10011','1/16/2010','9.98','0.80','10.78');INSERT INTO INVOICEVALUES('1003','10012','1/16/2010','153.85','12.31','166.16');INSERT INTO INVOICEVALUES('1004','10011','1/17/2010','34.97','2.80','37.77');INSERT INTO INVOICEVALUES('1005','10018','1/17/2010','70.44','5.64','76.08');
Attachments:
Ans-----------wer----------- Fi-----------le-----------