1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ivann1987 [24]
3 years ago
5

Write an ALTER TABLE statement that adds two new columns to the Products table: one column for product price that provides for t

hree digits to the left of the decimal point and two to the right. This column should have a default value of 9.99; and one column for the date and time that the product was added to the database.
Computers and Technology
1 answer:
matrenka [14]3 years ago
8 0

Answer:

ALTER TABLE Products

ADD Products_price float(5,2) DEFAULT 9.99,

ADD Adding_time datetime;

Explanation:

So at first we need to use ALTER TABLE statement, when we use this statement we also need to provide the table name. In this case, i assume it is 'Products'.

Then, as per question, we need to add two columns.

The first one is 'product_price' and it contains decimal points. So, we need to use ADD statement and give a column name like 'Prodcuts_price' and its datatype 'float' because it contains decimal or floating points. so, for 3 digits on the left and 2 digits on the right, it makes a total of 5 digits. So, we need to declare it like this. (5,2) it means a total of 5 digits and 2 after the decimal point. after that, we need to set our Default value using the DEFALUT statement. so DEFAULT 9.99. it will set the default value to 9.99 for existing products.

And for our next column, we give its a name like 'Adding_time' then it's datatype 'datetime' because it will contain date and times.

You might be interested in
Java code?????
12345 [234]

Answer:

Explanation:

Here is the code for you:

import java.io.*;

import java.util.*;

class GirlScoutCookies

{

public static void main(String[] args)

{

int [] BoxesCategory = new int[5];

Scanner sc = new Scanner(System.in);

System.out.print("Total number of girls in the troop: ");

int numOfGirlScouts = sc.nextInt();

for(int i = 0; i < numOfGirlScouts; i++)

{

System.out.print("Boxes of cookies for girl #"+(i+1)+": ");

int boxes = sc.nextInt();

if(boxes >= 0 && boxes <= 10)

BoxesCategory[0]++;

else if(boxes >= 11 && boxes <= 20)

BoxesCategory[1]++;

else if(boxes >= 21 && boxes <= 30)

BoxesCategory[2]++;

else if(boxes >= 31 && boxes <= 40)

BoxesCategory[3]++;

else if(boxes > 40)

BoxesCategory[4]++;

}

System.out.println("TOTAL BOXES\tNUMBER OF GIRL SCOUTS");

System.out.println(" 0 to 10\t"+BoxesCategory[0]);

System.out.println("11 to 20\t"+BoxesCategory[1]);

System.out.println("21 to 30\t"+BoxesCategory[2]);

System.out.println("31 to 40\t"+BoxesCategory[3]);

System.out.println("41 or more\t"+BoxesCategory[4]);

}

}

And the sample output is:

5 0
3 years ago
Which wireless communication technology is most likely used when synchronizing device information to an automobile?
seropon [69]
Bluetooth is the most reasonable answer
8 0
3 years ago
Write a SELECT statement that joins the Categories table to the Products table and returns these columns: category_name, product
Sphinxa [80]

Answer & Explanation:

1) Query:

SELECT Product_Name, Category_Name, List_Price

FROM Products AS P JOIN Categories AS C

ON C.Category_ID = P.Category_ID

ORDER BY Category_Name, Product_Name ASC;

2) Query:

SELECT C.Last_Name, C.First_Name, Order_Date, P.Product_Name, Item_Price, Discount_Amount, Quantity

FROM Customers AS C JOIN Orders AS O

ON C.Customer_ID = O.Customer_ID

JOIN Order_Items AS OI

ON O.Order_ID = OI.Order_ID

JOIN Products AS P

ON OI.Product_ID = P.Product_ID

ORDER BY Last_Name, Order_Date, Product_Name;

3) Query:

SELECT Category_Name, Product_ID

FROM Categories LEFT JOIN Products

ON Categories.Category_ID = Products.Category_ID

WHERE Product_ID IS NULL;

4) Query:

SELECT 'SHIPPED' AS Ship_Status, Order_Id, Order_Date

FROM Orders

WHERE Ship_Date IS NOT NULL

UNION

SELECT 'NOT SHIPPED' AS Ship_Status, Order_ID, Order_Date

FROM Orders

WHERE Ship_Date IS NULL

ORDER BY Order_Date;

3 0
3 years ago
Outline a scenario in which you might be acting ethically but might still want to remain anonymous while using the Internet. How
kompoz [17]

Answer:

I would like to stay anonymous while criticizing the current government. As there have been many cases when people who wrote against the government's decisions were caught by the police.

So I would prefer to stay anonymous while commenting on various government policies. My friends would know about it because I share my posts only with them.

The government can know about my identity by ordering the social networking site to reveal it.

8 0
3 years ago
Write a program that accepts a number as input, and prints just the decimal portion.
Olegator [25]

<u>Answer:</u>

<em>There are 2 ways to do extract the decimal part: </em>

<u>Explanation:</u>

  • <em>First method using number  </em>

<em>int main() { </em>

<em>  double num = 23.345; </em>

<em>  int intpart = (int)num; </em>

<em>  double decpart = num - intpart; </em>

<em>  printf(""Num = %f, intpart = %d, decpart = %f\n"", num, intpart, decpart); </em>

<em>} </em>

  • <em>Second method using string: </em>

<em>#include <stdlib.h> </em>

<em>int main() </em>

<em>{ </em>

<em>    char* inStr = ""123.4567"";          </em>

<em>    char* endptr;                       </em>

<em>    char* loc = strchr(inStr, '.'); </em>

<em>    long mantissa = strtod(loc+1, endptr); </em>

<em>    long whole = strtod(inStr, endptr);  </em>

<em>    printf(""whole: %d \n"", whole);      </em>

<em>    printf(""mantissa: %d"", mantissa);   </em>

<em>} </em>

8 0
2 years ago
Read 2 more answers
Other questions:
  • Write a complete program to do the following: The main program calls a method to read in (from an input file) a set of people's
    12·1 answer
  • Is it safe to take apart a computer monitor?
    13·1 answer
  • A building is equipped with light sensors that turn off the fluorescent lights when natural light is above a certain brightness.
    5·1 answer
  • How to solve a program that accepts a number as input and prints just the decimal portion
    15·2 answers
  • Choose all that apply.
    11·1 answer
  • Which factor is NOT used to determine who can be let go during a downsizing?
    8·2 answers
  • What is the CPU's role?
    15·2 answers
  • What is wrong with the following code? publicstatic char grade(int score) { if (score &gt;= 9) { return 'A'; } else if (score &g
    6·1 answer
  • What is closeable interface in java.
    12·1 answer
  • Pleaseeeee helpppppppp​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!