Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If you have not already done so, use MSSQLS Management Studio to create a new da

ID: 3697806 • Letter: I

Question

If you have not already done so, use MSSQLS Management Studio to create a new database named ch08_simpleco. Use the default settings. When the database has been created, run the Ch08_simpleco_SQL.txt script linked above to create and load the database tables and data.

If you have not already done so, use MSSQLS Management Studio to create a new database named ch08_simpleco. Use the default settings. When the database has been created, run the Ch08_simpleco_SQL.txt script linked above to create and load the database tables and data.

Use T-SQL to create a view of the simpleco customer and invoice tables. the view should select for the customer number, customer last name, customer balance, invoice number, invoice date, and invoice amount. Name the view v_cust_invoices.

Explanation / Answer

Creating New DataBase : ch08_simpleco

Create database ch08_simpleco;

Use database ch08_simpleco;

Creating New table : tablename

Create table tablename( Customer_number integer , Customer_firstname varchar(20), Customer_lastname varchar(20) , Customer_balance integer , invoice_number integer , invoice_data varchar(20) , invoice_amount integer);

Inserting values into table:

insert into tablename(Customer_number , Customer_firstname , Customer_lastname , Customer_balance , invoice_number , invoice_data , invoice_amount) values ( 1, 'Alex' , 'Glades' , 2000 ,100, 'abcd' , 1000);

insert into tablename(Customer_number , Customer_firstname , Customer_lastname , Customer_balance , invoice_number , invoice_data , invoice_amount) values ( 2, 'Bob' , 'Glans' , 3000 ,200, 'efgh' , 500);

Retriving data from table:

select * from tablename;

Creating View:

create view v_cust_invoices as select Customer_number , Customer_lastname , Customer_balance , invoice_number , invoice_data , invoice_amount from tablename where Customer_id=1;

View : v_cust_invoices

Customer_number Customer_firstname Customer_lastname Customer_balance invoice_number invoice_data invoice_amount 1 Alex Glades 2000 100 abcd 1000 2 Bob Glans 3000 200 efgh 500
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote