Question

Write a select statement that shows the product_id, product_code, the product_name, and the description for every...

Write a select statement that shows the product_id, product_code, the product_name, and the description for every product in the products table.
Capitalize all of the text in the product_codes, and only show the first twenty characters of the product description

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

If you have any doubts, please give me comment...

By Using LEFT

SELECT INITCAP(product_id) AS product_id, product_code, product_name, LEFT(description, 20) product_description

FROM products;

(OR)

By Using SUBSTR

SELECT INITCAP(product_id) AS product_id, product_code, product_name, SUBSTR(description, 1, 20) product_description

FROM products;

Add a comment
Know the answer?
Add Answer to:
Write a select statement that shows the product_id, product_code, the product_name, and the description for every...
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
  • Table structure: administrators = admin_id, email_address, password, first_name, last_name categories = category_id, category_name customers = customer_id,...

    Table structure: administrators = admin_id, email_address, password, first_name, last_name categories = category_id, category_name customers = customer_id, email_address, password, first_name, last_name, shipping_address_id, billing_address_id order_items = item_id, order_id, product_id, item_price, discount_amount, quantity orders = order_id, customer_id, order_date, ship_amount, tax_amount, ship_date, ship_address_id, card_type, card_number, card_expires, billing_address_id products = product_id, category_id, product_code, product_name, description, list_price, discount_percent, date_added 5. Write a SELECT statement that uses regular expression functions to get the username and domain name parts of the email addresses in the Administrators table. Return...

  • 5. Write a SELECT statement that returns these columns from the Orders table: OrderID OrderDate ShipDate...

    5. Write a SELECT statement that returns these columns from the Orders table: OrderID OrderDate ShipDate Return only the rows where the ShipDate column contains a null value. 6. Write a SELECT statement that returns all columns from the Addresses table State is equal to CA 7. Write a SELECT statement that returns all columns from the Products table Product name has a "ru" in its name 8. Write a SELECT statement that returns these columns from the Customers table...

  • 2. Write a script that implements the following design: In the Downloads table, the user_id and...

    2. Write a script that implements the following design: In the Downloads table, the user_id and product_id columns are the foreign keys. Create these tables in the ex schema. Create the sequences for the user_id, download_id, and product_id columns. Include a PL/SQL script to drop the table or sequence if it already exists. Include any indexes that you think are necessary. 3. Write a script that adds rows to the database that you created in exercise 2. Add two rows...

  • Figure 3-4 Sample Schema co CO PRODUCTS CUSTOMERS product_id customer_id product_name email_address unit_price full_name product_details product_image...

    Figure 3-4 Sample Schema co CO PRODUCTS CUSTOMERS product_id customer_id product_name email_address unit_price full_name product_details product_image image_mime_type image_charset image_filename image_last_updated ORDER_ITEMS order_id line_item_id product_id unit_price quantity ORDERS order_id order_datetime customer_id order_status store_id STORES store_id store_name web_address physical address latitude longitude logo logo_mime_type logo_charset logo_filename logo_last_updated | 3. Write one SELECT statement to display ten most popular products (only ten rows) in 2018. The most popular means the highest quantity ordered on COMPLETED orders. Display the product id, product name, and...

  • #6 Write a SELECT statement that returns these columns: The count of the number of orders...

    #6 Write a SELECT statement that returns these columns: The count of the number of orders in the Orders table The sum of the tax_amount columns in the Orders table Write a SELECT statement that returns one row for each category that has products with these columns: The category_name column from the Categories table The count of the products in the Products table The list price of the most expensive product in the Products table Sort the result set so...

  • 3. Write a script that adds rows to the database that you created in exercise 2....

    3. Write a script that adds rows to the database that you created in exercise 2. Add two rows to the Users and Products tables. Add three rows to the Downloads table: one row for user 1 and product 2; one row for user 2 and product 1; and one row for user 2 and product 2. Use the SYSDATE function to insert the current date into the download_date column. Use the sequences created in the previous exercise to get...

  • 1. Write an INSERT statement that adds this row to the Categories table: CategoryName: Brass Code...

    1. Write an INSERT statement that adds this row to the Categories table: CategoryName: Brass Code the INSERT statement so SQL Server automatically generates the value for the CategoryID column. 2. Write an UPDATE statement that modifies the row you just added to the Categories table. This statement should change the Category Name column to “Woodwinds”, and it should use the CategoryID column to identify the row. 3.Write an INSERT statement that adds this row to the Products table: ProductID:...

  • An accurate and comprehensive description of pseudogenes must include the statement that (Select all that apply)...

    An accurate and comprehensive description of pseudogenes must include the statement that (Select all that apply) Check All That Apply pseudogenes may have some gene-like features such as a promoter and splice sites. pseudogenes encode proteins, but the translated proteins are non-functional. pseudogenes can provide insight into the evolutionary history of the related functional gene. every pseudogene has a similar DNA sequence to some functional gene. all pseudogene pretent to transcribe other genes when they only transcribe one type of...

  • Write the SQL statement to create a five-field table to contain sample student information. The constraints...

    Write the SQL statement to create a five-field table to contain sample student information. The constraints that need to be satisfied by the attributes of this table are as follows: the attribute First_Name is mandatory and can have up to 16 characters, the attribute Last_Name is mandatory and can have up to 16 characters, the attribute Date_Of_Birth is of type date is required, the StarID field identifies each student and is 8 characters long the GPA field is numeric that...

  • Write a select statement that returns all columns from the orders table, but only returns the...

    Write a select statement that returns all columns from the orders table, but only returns the five newest (most recent) orders in the orders table as shown by the order_date column

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