Question

Chapter 2 How to use the Management Studio Before you start the exercises... Before you start these exercises, you need to in

2 Murachs SQL Server 2016 for Developers: My Guitar Shop exercises (modified) SELECT COUNT(*) AS NumberOfProducts FROM ProduOrderltems ItemID Administrators AdminlD Email Address Password OrderID ProductID ItemPrice DiscountAmount Quantity FirstName

0 0
Add a comment Improve this question Transcribed image text
Answer #1

To Connect to server follows below steps :

server type:Database Engine

Server name:localhost

Authentication:SQL server Aunthentication

Login:sa

Password:*****

The CREATE DATABASE statement creates a new database.

syntax:

CREATE DATABASE database_name;

Example:

CREATE DATABASE MyGuitarShop;

Once the statement executes successfully, you can view the newly created database in the Object Explorer. If the new database does not appear, you can click the Refresh button or press F5 keyboard to update the object list.

---------------------------------------------------------------------------------------------------------------------------------------------------

This statement lists all databases in the SQL Server:

SELECT name FROM master.sys.databases ORDER BY name;

Or you can execute the stored procedure sp_databases:

EXEC sp_databases;

------------------------------------------------------------------------------------------------------------------------------------------

create new table in MyGuitarShop database:

create table categories(
CategoryID int primary key,
CategoryName varchar(255) not null
);
  
create table Products(
ProductID int primary key,
CategoryID int not null,
ProductCode varchar(10) not null,
ProductName varchar(255) not null,
Description text not null,
list_price decimal(10,2) not null,
Discount_percent decimal(10,2) not null,
Date_added datetime
constraint Products fk categories
);

------------------------------------------------------------------------------------------------------------------------

Select ProductName from Products;

This query shows the ProductName from Product Table.

-----------------------------------------------------------------------------------------------------------------------------------

Delete e at the end of product name

SELECT ProductID,

  TRIM(LEADING 'e' FROM ProductName )

FROM Products;

------------------------------------------------------------------------------------------------------------------------------

select count(*) as NumberOfProducts from Products;

This query gives the total number of products count in this table.

Add a comment
Know the answer?
Add Answer to:
Chapter 2 How to use the Management Studio Before you start the exercises... Before you start...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For this hands-on project, you will use the SQL Server named instance SQLSERVERHOA, and the HandsOnOne...

    For this hands-on project, you will use the SQL Server named instance SQLSERVERHOA, and the HandsOnOne database and tables you created in previous chapters. The objective of this activity is to practice generating keys and encrypting/decrypting data. Document each step by taking a screen shot of the Query Editor window after successfully executing each SQL query. 1.In SQL Server Management Studio, open a new Query Editor window, which you will use for completing all steps in this activity. 2.Create a...

  • For this set of Review Questions, we will create and use a database for the Wedgewood...

    For this set of Review Questions, we will create and use a database for the Wedgewood Pacific Corporation (WPC) that is similar to the Microsoft Access database we created and used in Chapters 1 and 2. Founded in 1957 in Seattle, Washington, WPC has grown into an internationally recognized organization. The company is located in two buildings. One building houses the Administration, Accounting, Finance, and Human Resources departments, and the second houses the Production, Marketing, and Information Systems departments. The...

  • Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins...

    Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins use from clause) Need to Create a Query to display products purchased by customers in Germany that were not purchased by customers in the US. Customers PK Customer D CompanyName Contact Name Contact Title Address City State OrRegion PostalCode Country Phone char(5) varchar(40) varchar(30) varchar(30) varchar(60) varchar(15) varchar(15) varchar(10) varchar(15) varchar(24) varchar(24) Order Details Orders PK OrderID int FK CustomerlD char(5) FK Employeeld int...

  • Write a PHP script that obtains a URL and its description from user and stores the...

    Write a PHP script that obtains a URL and its description from user and stores the information into a database using MySQL. Create and run a SQL script with database named URL and a table named Urltable. The first field of the table should contain an actual URL, and the second, which is named Description, should contain a description of the URL. Use www.deitel.com as the first URL, and input Cool site! as its description. The second URL should be...

  • PHP Programming In this project, you will create a Web page that allows visitors to your...

    PHP Programming In this project, you will create a Web page that allows visitors to your site to sign a guest book that is saved to a database. Create a new document in your text editor and type the <!DOCTYPE> declaration, <html> element, document head, and <body> element. Use the strict DTD and “Guest Book” as the content of the <title> element. Add the following text and elements to the document body: <h2>Enter your name to sign our guest book</h2>...

  • Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins...

    Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins use from clause) Need to Create a Query because Northwind Traders has decided to increase their retail prices. Write a query that shows the product name, the current price, and the new price. Make sure the new price is listed to 2 decimal points. Follow below guidelines on new retail price: a.         If the category is beverages or dairy products, increase the price by...

  • Answer the following and explain so I can double check my answers If you use the Management Studio to create a database, the Studio will automatically create a database file plus a ________________...

    Answer the following and explain so I can double check my answers If you use the Management Studio to create a database, the Studio will automatically create a database file plus a ______________________ file. 10 points    QUESTION 2 When you use the Management Studio to create a check constraint, you can specify whether you want the constraint enforced for insert or __________________ operations. 10 points    QUESTION 3 When you use the Management Studio to create a database, including its tables...

  • Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins...

    Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins use from clause) Need to Create a Query because Northwind Traders wants to make sure that all orders are shipped within 10 days. Display any orders that were not shipped within 10 days. Include the OrderID, the OrderDate, and the number of days it took before the order was shipped. Customers PK Customer D CompanyName Contact Name Contact Title Address City State OrRegion PostalCode...

  • ONLY ODD NUMBERS. YOU MUST USE ORACLE OR MY SQL. THANKS Chapter 3 TAL Distributors Use...

    ONLY ODD NUMBERS. YOU MUST USE ORACLE OR MY SQL. THANKS Chapter 3 TAL Distributors Use SQL to complete the following exercises 1. Create a table named SALES_ REP. The table has the same structure as the REP table shown in Figure 3-11 except the LAST_NAME column should use the VARCHAR data type and the COMMISSION and RATE columns should use the NUMBER data type. Execute the command to describe the layout and characteristics of the SALES_REP table. Add the...

  • Really need help with this. This is for my Advanced Java Programming Class. If anyone is...

    Really need help with this. This is for my Advanced Java Programming Class. If anyone is an expert in Java I would very much appreciate the help. I will provide the code I was told to open. Exercise 13-3   Use JPA to work with the library checkout system In this exercise, you'll convert the application from the previous exercise to use JPA instead of JDBC to access the database. Review the project Start NetBeans and open the project named ch13_ex3_library that's...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT